Godot Version
4.3
Question
I’m new to this fellas
I want to be able to increase jump height after doing a ‘Slam’ (in other words, a ground pound), but only after doing a ‘Slam’. So if I want to jump extra high, I have to do a ‘Slam’ before I jump, every time. Here’s what I did:
#Slamming
if velocity.y > 0:
states = States.FALLING
if states in [States.FALLING] and Input.is_action_just_pressed("Slam"):
states = States.SLAMMING
if states in [States.SLAMMING]:
velocity.y += SLAM_GRV
stun = true
boost = true #IMPORTANT PART
# Handle jump.
if Input.is_action_just_pressed("Jump") and is_on_floor():
velocity.y = JUMP_VELOCITY
states = States.JUMPING
if boost == true: #IMPORTANT PART
velocity.y = JUMP_VELOCITY - 100
boost == false
I set the ‘boost’ to false in the Jump statement, in hopes of making it so that once I jump after a ‘Slam’, I have to ‘Slam’ again to set the boost to true, in order to gain the extra jump height.
What I’m getting is that I can’t declare the ‘boost variable’ as false, after I set it as true in the same statement. If I can’t do that, then what else am I supposed to do? I hear that using timers for very short intervals leads to bad results, so I’ve avoided using them in this case. Please help because I am proper stumped