Problems with my difficulty variables

so i started working on setting up 3 different difficulties recently, i first set it up for the ammo, which everything seemed to work fine for it, changing the values based on what difficulty was selected. then I moved onto the HP, and thats where everything started fallling apart! for some reason, now the ammo value is staying locked at 1000 and the player is starting with 0 HP, (well thats atleast what the health bar shows) when the mission starts, which triggers a game over as soon as the scene starts!

There’s no conditions for change the ammo to 1000. So, it’s being set to 1,000 on each frame.

I noticed the fire behavior keeps firing if the ammo quantity isn’t a whole number. You may need to use something like trunc() or round().
I don’t see anything that changes the health settings.

I played around with the concept. It would be easier to use a structure of structures and then get the value based on the level. That way you can use one event group to set all the values. You can add any children that you want.

try me:

project: (click the green [code] button and [download zip]

Scene variables.

You get and set the variables with Difficulty[childname].childname
like: Difficulty[DifficultyLevel].AmmoValue

Here’s an example:
It has a button with 3 instances. So, I set the label text based on an instance variable name caption.
I used a gun object and player object so I could test the gun by shooting the player.
The gun has the fire behavior and the player has the health.