Variables exceeding their limit

quantumsheepquantumsheep Member Posts: 8,188
edited November -1 in Working with GS (Mac)
Hey all!

I'm wondering if I'm doing something wrong (probably am).

I'm using integer variables to control certain things - e.g. how many power-ups you can use.

I don't want the player to have more than four power ups. So I put in a rule 'If powerups is equal to, or greater, than 4, make the powerups =4"

It seems though that on occasion, and more and more frequently, the variables *do* go above 4 for example.

Is there a rock solid way of getting a variable to stop at a certain number?

Hope that's clear?

Cheers,

QS :)

Oh, and apologies for all the questions lately! I wouldn't ask if I wasn't honestly stuck!

Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io

Comments

Sign In or Register to comment.