Min and Max
charliehgreen
ArizonaMember Posts: 233
Hey I was wondering if someone could school me on these two?! (Min and Max)..
For example: I have a scene where if you kill an enemy you'll gain 1 point, and having 1 point will allow you access to a certain power up.
But let's say if you kill 2 enemies, you'll have 2 points now, right?!
So now since you have 2 points, the power you had access to is no longer available since you now have 2 points.
Basically, how exactly can I set it up so that as long as your score equal 1 through 10 you'll still have access to this power up?
I've been messing with the min and max and watching Tshirtbooth but I can't get anything
Please help?
Thanks!
For example: I have a scene where if you kill an enemy you'll gain 1 point, and having 1 point will allow you access to a certain power up.
But let's say if you kill 2 enemies, you'll have 2 points now, right?!
So now since you have 2 points, the power you had access to is no longer available since you now have 2 points.
Basically, how exactly can I set it up so that as long as your score equal 1 through 10 you'll still have access to this power up?
I've been messing with the min and max and watching Tshirtbooth but I can't get anything
Please help?
Thanks!
Comments
@charliehgreen Hi, by the sound of it, min and max functions won't be needed in this particular situation: So in this case, you'd use the less than sign:
Rule: When Score < 11
--power up behaviours
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
And that works Grrr
lol so simple, how could I not put that together.
Lol it's always the simple things, thanks!!!
You're welcome. :-)
For the record, you'd use the max function in the following scenario: say you have a score, and a previous score, and want the result of the highest score between them.
max(scoreA, scoreB) ---so this will give the value of that attribute scoreA or scoreB, whichever is the highest. (For interest, you can add as many integer or real attributes as you want to this function, for instance max(scoreA, scoreB, scoreC, scoreD, scoreE)
And straightforwardly, in a similar manner, using min in place of max with the above examples, will give you the lowest value as the result.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps