@@ -46,10 +46,10 @@ def "run_movement"
4646 prevx = playerx
4747 prevy = playery
4848
49- if up.pressed "playeryvel += speed"
50- if down.pressed "playeryvel -= speed"
51- if left.pressed "playerxvel -= speed"
52- if right.pressed "playerxvel += speed"
49+ if up.isKeyDown() "playeryvel += speed"
50+ if down.isKeyDown() "playeryvel -= speed"
51+ if left.isKeyDown() "playerxvel -= speed"
52+ if right.isKeyDown() "playerxvel += speed"
5353 // changes the player velocity based on keys pressed
5454
5555 playerxvel *= 0.6
@@ -71,7 +71,7 @@ def "run_movement"
7171endef
7272
7373def "run_interactions"
74- if "e".pressed .not "can = true"
74+ if "e".isKeyDown() .not "can = true"
7575 // makes sure that you cannot interact again until you finish the current interaction
7676
7777 current_interactables = interactables.key(map_location)
@@ -94,34 +94,34 @@ def "run_interactions"
9494endef
9595
9696def "run_animator"
97- if anim_start != 1 and up.pressed .not and left.pressed .not and right.pressed .not and down.pressed .not (
97+ if anim_start != 1 and up.isKeyDown() .not and left.isKeyDown() .not and right.isKeyDown() .not and down.isKeyDown() .not (
9898 anim_start = 1
9999 anim_frame = 1
100100 anim_length = 4
101101 )
102102
103- if current_anim != "up" and up.pressed (
103+ if current_anim != "up" and up.isKeyDown() (
104104 anim_start = 5
105105 anim_frame = 5
106106 anim_length = 10
107107 current_anim = "up"
108108 )
109109
110- if current_anim != "left" and left.pressed (
110+ if current_anim != "left" and left.isKeyDown() (
111111 anim_start = 5
112112 anim_frame = 5
113113 anim_length = 10
114114 current_anim = "left"
115115 )
116116
117- if current_anim != "down" and down.pressed (
117+ if current_anim != "down" and down.isKeyDown() (
118118 anim_start = 5
119119 anim_frame = 5
120120 anim_length = 10
121121 current_anim = "down"
122122 )
123123
124- if current_anim != "right" and right.pressed (
124+ if current_anim != "right" and right.isKeyDown() (
125125 anim_start = 5
126126 anim_frame = 5
127127 anim_length = 10
@@ -299,20 +299,20 @@ if anim_frame > anim_length "anim_frame = anim_start"
299299// animator, loops through frames of current player animation
300300
301301speed = 4
302- if "shift".pressed "speed += 3"
302+ if "shift".isKeyDown() "speed += 3"
303303// sprint and speed system
304304
305305if load_animate.not (
306306 image current_room game_scale
307307 // draws the room background
308308)
309309
310- if anim_start != 1 or up.pressed or left.pressed or right.pressed or down.pressed (
310+ if anim_start != 1 or up.isKeyDown() or left.isKeyDown() or right.isKeyDown() or down.isKeyDown() (
311311 run_animator
312312 // controls the movement animations of the player
313313)
314314
315- if "any".pressed and load_animate.not (
315+ if "any".isKeyDown() and load_animate.not (
316316 // This is a very good optimisation, these files are laggy
317317
318318 run_movement
0 commit comments