I don't know how to do the actual jump, but I think the logic should go like this:
#constant PLAYER_ON_SOLID_GROUND = 0
#constant PLAYER_JUMPING = 1
#constant PLAYER_DOUBLE_JUMPING = 2
playerJumpStatus as integer = PLAYER_ON_SOLID_GROUND
do
// Pressing J key for jump
if GetRawKeyPressed( 74 )
select playerJumpStatus
case PLAYER_DOUBLE_JUMPING:
print("Do nothing, we have used our two jumps")
endcase
case PLAYER_JUMPING:
print("Insert code here to jump again")
playerJumpStatus = PLAYER_DOUBLE_JUMPING
endcase
case PLAYER_ON_SOLID_GROUND:
print("Insert code here to jump")
playerJumpStatus = PLAYER_JUMPING
endcase
endselect
endif
Sync()
loop
Only thing missing is that when the player makes contact with the ground, it should do a
playerJumpStatus=PLAYER_ON_SOLID_GROUND