Gradually getting smaller platform?!
http_gamesalad
Member Posts: 1,340
Hello I recently asked a question about how to make my game harder! it worked perfectly but i ran into a problem! LOL uh i want a gradually getting smaller platform! It starts out at a width of 200 but i want it to end at a width of 50! I tried using the formula of getting my game harder , but how do i tell gamesalad to stop at a width of 50! idk if your get what im trying to say
Comments
You would use the max() function that is in the function drop-down list. You can also type it in directly since it's not an attribute name. Max() returns the larger of two values.
Something like this:
constrain attribute self.size.Width to max([formula],50).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang okay that didnt work , uh I used the change size behavior and timer ill ttpe it out exactly how it put it ! (This is for my platform)
Timer: Every 1 second
Change size : -2
(Then I added what you said to put)
constrain attribute self.size.Width to max([formula],50)
Then I have move from earlier which you told me how to do it says
Move in direction 180
At a speed of : game.game.speed (which is at a speed of 200 its an integer)
That's in one rule
That's what I have and its making the platforms spaz up. I came up with that formula by my self I know little to nothing with Gamesalad so I was shocked that it worked! LMAO. If you can give me a better way for it to work that'll be perfect!
Thanks, Victor
the platform spazed out when I added your "constrain attribute self.size.Width to max([formula],50)"
Sorry, I thought you had an actual formula, that is a mathematical formula.
I wouldn't use Change Size and constrain the size at the same time. That will give unpredictable results.
Try doing something like:
Timer every 1 second change attribute self.size.Width to max(self.size.Width-10,50) change attribute self.size.Height to max(self.size.Width-10,50)
I would put that in a rule that says When self.size.Width > 50 just so it doesn't run continuously after the actor is size 50.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User