Mandaw

mandaw.main
title = "Mandaw"
width = 800
height = 600
bg_color = (0, 0, 0, 255)

input = mandaw.input.Input()

dt = 1.0 / 60.0

loop(self)



Mandaw(title, width, height, bg_color)

Entity

mandaw.entity
window = type: Mandaw.window
width = 20
height = 20
x = 0
y = 0
color = (255, 255, 255, 255)
rect = sdl2.SDL_FRect(x, y, width, height)

draw(self)
center(self)
center_x(self)
center_y(self)

collide(self, rect = type: Entity)
collidelist(self, rect_list = type: list(Entity))
distance(rect1, rect2)



Entity(window, width, height, x, y, color)

Input

mandaw.input
pressed = sdl2.SDL_GetKeyboardState(None)

keys = { "UP", "DOWN", "LEFT", "RIGHT",
"A", "B", "C", "D" "E", "F", "G",
"H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U",
"V", "W", "X", "Y", "Z",

"0", "1", "2", "3", "4", "5", "6",
"7", "8", "9",

"F1", "F2", "F3", "F4", "F5", "F6",
"F7", "F8", "F9", "F10", "F11",
"F12", "F13", "F14", "F15",

"LCTRL", "RCTRL", "LSHIFT", "RSHIFT",
"LALT", "RALT",

"HOME", "INSERT", "DELETE", "RETURN",
"SPACE", "PLUS"

}


update(self, event)
getMousePos(self)



Input()

Sprite

mandaw.sprite
window = type: Mandaw.window
file = None
width = 200
height = 200
x = 0
y = 0
animations = {}
mirror = None

draw(self)
center(self)
center_x(self)
center_y(self)

add_animation(self, animation, name)
play_animation(self, name)

mirror_x(self)
mirror_y(self)
mirror_default(self)

collide(self, rect = type: Entity)
collidelist(self, rect_list = type: list(Entity))
distance(rect1, rect2)



Sprite(window, file, width, height, x, y)

Animation

mandaw.animation
frames = []
anim_folder = string: Directory
anim_time = int
count = len(frames)



Animation(anim_folder, anim_time)
.