Jun 9, 2024
Player Sprite: s_player
32x32 (can be adjusted in preferences)16x16) for accurate positioningWall Sprite: Duplicate s_player, rename to s_wall
Player Object: o_player
s_playerWall Object: o_wall
s_wallroom0
instances layer is selectedo_player and multiple o_wall objects to shape the game areahsp: Horizontal speedvsp: Vertical speedgrv: Gravity (e.g., 0.1)walksp: Walk speed (e.g., 4)Check for Key Presses:
key_left: Check if left arrow key is pressedkey_right: Check if right arrow key is pressedkey_jump: Check if space bar is pressedCalculate Movement:
key_left and key_right to determine directionhsp by multiplying directional input by walkspX by adding hspHorizontal Collision:
place_meeting to check for a wall collision at the predicted positionVertical Collision:
vsp and grvApplying Gravity:
vsp by adding gravityJumping:
vsp to a negative value to initiate the jump