eEventGotScore && game.score

Started by Joseph, Fri 04/06/2010 22:25:37

Previous topic - Next topic

Joseph

Hola IM back ;D ;D ;D

just want a custome-made Gui to pop-open when my turtle gets a certain amount of points for mating :o
I did this in the on_event function--->
if (event==eEventGotScore && game.score==69)showTurtletreat();
if (event==eEventGotScore && game.score==169)showTurtletreat();

when the score gets to 69 or over...i see my window popup, (cool), but when the game continues and the score keeps going up, when it get to 169 or over, i dont see my turtle treats window :(
i DONt give points equally, sometime a turtle can get 1 pointm, sometime 6, so i never know when the playuer will get EXACTLY 69 points or 169.

Can someone help meeeeee???

Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Calin Leafshade

Well you can use the greater than symbol (>) but then the turtle would be shown *every time* after 69.

So you need to set a flag of some kind.

Set a variable to the previous score before the new points were added. if that variable is less than 69 but the current score is greater than 68 you know that the threshold has only just been passed.



Joseph

Mr. Leafshade, Im sorry but Im really pretty stupid, I dont realy understand how to do that :(
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Dualnames

Hey Jo, I'm wondering if this works your way better:
Code: ags

if (event==eEventGotScore && game.score>=69) {
if (Game.DoOnceOnly("scoresixnine")) {
showTurtletreat();
}
}
if (event==eEventGotScore && game.score>=169){
if (Game.DoOnceOnly("scoreonesixnine")) {
showTurtletreat();
}
}
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Joseph

WOwzers, if you guys were turtles I would offer you a 20% discount on turtle wax and throw in a few bags of treats for the kids  :o :o

Not only does it wurkk but I now LuVv you guys  :-* :-*

Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Calin Leafshade

I totally forget about DoOnlyOnce. Nice one Dual

SMF spam blocked by CleanTalk