-
Notifications
You must be signed in to change notification settings - Fork 3
/
ExamplePyleste.py
47 lines (40 loc) · 1.19 KB
/
ExamplePyleste.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
if __name__ == '__main__':
# import PICO-8 emulator and Celeste
from PICO8 import PICO8
from Carts.Celeste import Celeste
# useful Celeste utils
import CelesteUtils as utils
# create a PICO-8 instance with Celeste loaded
p8 = PICO8(Celeste)
# swap 100m with this level and reload it
room_data = '''
w w w w w w w w w w . . . . w w
w w w w w w w w w . . . . . < w
w w w v v v v . . . . . . . < w
w w > . . . . . . . . . . . . .
w > . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . b . . . b . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . ^ . . . . . . . . . . .
. . . . w > . . . . . . . . . .
. . . . w > . . . . . . . . . .
. . . . w > . . p . . . . . . .
w w w w w w w w w w w w w w w w
'''
utils.replace_room(p8, 0, room_data)
utils.load_room(p8, 0)
# skip the player spawn
utils.skip_player_spawn(p8)
# view the room
print(p8.game)
# hold right + x
p8.set_inputs(r=True, x=True)
# run for 20f while outputting player info
print(p8.game.get_player())
for f in range(20):
p8.step()
print(p8.game.get_player())