Esempio n. 1
0
def play():
    global s
    s = S()

    engine.init_engine()
    engine.set_keyboard_handler(input_cb)
    engine.set_mouse_handler(fire_cb)
    s.me = Me()
    engine.add_obj(s.me)

    s.playing = True
    engine.engine()
Esempio n. 2
0
# moving boxes, added in response to mouse click

import engine

WIDTH = 640
HEIGHT = 480


class Box(engine.GameObject):
    def __init__(self):
        super().__init__(0, 0, +1, 0, 'square', 'red')


def mouse_cb(x, y):
    box = Box()
    engine.add_obj(box)
    print('Mouse click at', x, y)


if __name__ == '__main__':
    engine.init_screen(WIDTH, HEIGHT)
    engine.init_engine()
    engine.set_mouse_handler(mouse_cb)
    engine.engine()
Esempio n. 3
0
def game():
	engine.init_engine()
	engine.set_mouse_handler(fire_cb)
	engine.set_keyboard_handler(quit_cb)
	play()
Esempio n. 4
0
# moving boxes, added in response to mouse click

import engine

WIDTH = 640
HEIGHT = 480

class Box(engine.GameObject):
	def __init__(self):
		super().__init__(0, 0, +1, 0, 'square', 'red')

def mouse_cb(x, y):
	box = Box()
	engine.add_obj(box)
	print('Mouse click at', x, y)

if __name__ == '__main__':
	engine.init_screen(WIDTH, HEIGHT)
	engine.init_engine()
	engine.set_mouse_handler(mouse_cb)
	engine.engine()
Esempio n. 5
0
def game():
    engine.init_engine()
    engine.set_mouse_handler(fire_cb)
    engine.set_keyboard_handler(quit_cb)
    play()