2D at its simplest.


Getting Started

Installation

pip install mandaw

Or To Install The Latest Version


Download The Zip In The Github

On Windows:

Run The install.bat

On Mac and Linux:

python3 setup.py install

Making a Window

First, Import Mandaw

from mandaw import *

Then Call Mandaw

mandaw = Mandaw(title = "Mandaw", width = 800, height = 600, bg_color = "cyan")

And then Run Mandaw with

while True: mandaw.run()

Making A Square

Declare the Square With GameObject

square = GameObject(window = mandaw, shape = "rect", size = (20,20), x = 0, y = 0, color = "white")

Then to Center it, write

square.center()

Then in the while True: loop, write

square.draw()

Collisions Between GameObjects

Make A Ground

ground = GameObject(window = mandaw, shape = "rect", size = (5000, 100), x = 0, y = 500, color = "gray")

Center It's X

ground.center_x()

Draw it in the while True: loop

ground.draw()

Here we can use the collide() function

# Square's y position += 1 x deltaTime
if not square.collide(ground):
square.y += 1 * mandaw.dt
Full Code

Input in Mandaw

if mandaw.input.get_key_pressed(mandaw.keys["A"]):
print("A was pressed!")
if mandaw.input.get_key_pressed(mandaw.keys["D"]):
print("D was pressed!")

if mandaw.input.get_mouse_button(
mandaw.mouse_buttons["LEFT"]):
print("Left mouse button was pressed!)
.