2D at its simplest.
Getting Started
Installation
Or To Install The Latest Version From Github
pip install
https://github.com/mandaw2014/
mandawenginesdl/archive/master.zip
Making a Window
First, Import Mandaw
Then Call Mandaw
mandaw = Mandaw(title = "Mandaw", width = 800, height = 600, bg_color = (0, 0, 0, 255))
And then Run Mandaw with
mandaw.loop()
Making A Square
Declare the Square With Entity
square = Entity(window = mandaw, width = 20, height = 20, x = 0, y = 0, color = color["white"])
Then to Center it, write
square.center()
Then to draw it, write
@mandaw.draw
def draw():
square.draw()
Collisions Between GameObjects
Make A Ground
ground = Entity(window = mandaw, width = 5000, height = 100, x = 0, y = 500, color = (200, 200, 200, 255))
Center It's X
ground.center_x()
Draw it in the @mandaw.draw function
@mandaw.draw
def draw():
ground.draw()
Here we can use the collide() function
# Square's y position += 1
if not square.
collide(ground):
square.
position.
y +=
1
Input in Mandaw
if mandaw.
input.
pressed[mandaw.
input.
keys[
"A"]]:
print(
"A was pressed!")
if mandaw.
input.
pressed[mandaw.
input.
keys[
"D"]]:
print(
"D was pressed!")
.