-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
63 lines (57 loc) · 1.95 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
def on_b_pressed():
dah_Wizard.set_scale(0.5, ScaleAnchor.BOTTOM)
controller.B.on_event(ControllerButtonEvent.PRESSED, on_b_pressed)
def on_b_released():
dah_Wizard.set_scale(1, ScaleAnchor.BOTTOM)
controller.B.on_event(ControllerButtonEvent.RELEASED, on_b_released)
dah_Wizard: Sprite = None
scene.set_background_image(assets.image("""
sus sky
"""))
tiles.set_current_tilemap(tilemap("""
level1
"""))
dah_Wizard = sprites.create(assets.image("""
dah Wizard right
"""),
SpriteKind.player)
tiles.place_on_tile(dah_Wizard, tiles.get_tile_location(2, 14))
scene.camera_follow_sprite(dah_Wizard)
def on_forever():
dah_Wizard.set_velocity(0, 50)
forever(on_forever)
def on_forever2():
if controller.left.is_pressed():
dah_Wizard.x += -2
dah_Wizard.set_image(assets.image("""
dah Wizard left
"""))
if controller.right.is_pressed():
dah_Wizard.x += 2
dah_Wizard.set_image(assets.image("""
dah Wizard right
"""))
forever(on_forever2)
def on_forever3():
if controller.A.is_pressed():
dah_Wizard.start_effect(effects.warm_radial)
if dah_Wizard.image.equals(assets.image("""
dah Wizard right
""")):
dah_Wizard.set_image(assets.image("""
dah Wizard red right
"""))
elif dah_Wizard.image.equals(assets.image("""
dah Wizard left
""")):
dah_Wizard.set_image(assets.image("""
dah Wizard red left
"""))
else:
effects.clear_particles(dah_Wizard)
forever(on_forever3)
def on_forever4():
if controller.up.is_pressed():
if dah_Wizard.tile_kind_at(TileDirection.BOTTOM, sprites.castle.tile_path2) or (dah_Wizard.tile_kind_at(TileDirection.BOTTOM, sprites.castle.tile_path1) or dah_Wizard.tile_kind_at(TileDirection.BOTTOM, sprites.castle.tile_path3)):
dah_Wizard.set_velocity(0, -20000)
forever(on_forever4)