How to increase and decrease score using the same variable

https://studio.code.org/projects/gamelab/gEP6nQqnMV01v7Xm8vTkRtHh3WvSJzF7r8PJVYbqPmU/edit

I have scenario where I need the health number to go down when the SPACE BAR IS PRESSED, but when I press the up Arrow, I need the health number to go up, but instead when the Up arrow is pressed it will immediately go down because of the variable.

Any ideas how I can do that using the same number as a variable?

Hi @dajanim,

Welcome to the forum! The link does not go to your project but perhaps I can help without it.
Based on your description it sounds like you have two different if statements with two different actions to take if the if statement is true. So in pseudocode(ish):
set a global var health;
if space bar is pressed → health = health - 1
if up arrow is pressed → health = health +1

Hope that helps but if not, try sending another link by clicking share and copy link to project.
~Michelle