How do i put a limit on an attribute?!?
benjaminmage
Member Posts: 74
Game attribute: velocity 80 real
It starts off with 80. I have a timer which adds +5 to velocity every 2 seconds. I would like its maximum value to be 200. How do i do that?
Comments
One way is to use a Rule that says something like this:
That would only add the 5 as long as Velocity is not above 200.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
+1 on @jamie_c's answer
I think that would have to be Velocity ≤ 195
Another way is the min() function which returns the smaller of two values:
Change Attribute game.velocity to min(200,game.velocity+5)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang
Oops. Yeah, I guess you're right, or Velocity < 200.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page