Hey! My games code is saying no

Im making a game and I’d love it to have a really good movement system, so I’ve been working on that for not very long, but for whatever reason, some stuff isn’t working in the slightest.

For one, you’re meant to have 3 dash charges, and then you run out until they regen. But you have infinite for some reason. I just came back to make code after like a year, and so it’s likely something extremely stupid, but I’d appreciate help!

Also it’s meant to disable gravity for the duration of the dash, and then return it, but it just doesn’t return it?

1 Like

My bad, I forgot I could upload a link, https://arcade.makecode.com/S53871-89318-24423-15701

have you tried using variables to go to false after the button is pressed and then when the regeneration timer thing is up have the variable go back to true. you could use this as a sort of countdown in an if then statement. (If (dash number > 0) then (if (variable name) = true & a button is pressed) — Then (set (my sprite) vx (x2) and vy (x2) (turn gravity off) (pause 1 sec) (turn gravity on) (if dash number < 1) then set (variable name) to false)

Hmm. It seems you forgot to directly say “not equal to 0”.