Help with interpolate bug that's driving me nuts :P
thumbfrenzylabz
Member, PRO Posts: 50
Hi Saladers,
I'm using an actor to fill a progress bar by starting off 10px wide and then as the player collects snowballs the progress bar gets wider with the formula: interpolate self.width = 10+30*snowballsEaten
However, for whatever reason it isn't working.... This seems pretty straight forward but I'm not sure why I can't find the bug.. I've tried lots of things.
I'm sure that the snowballsEaten counter is going up because if snowballsEaten >= snowballsNeeded then the game stops as planned... thus verifying that snowballsEaten counter is working.
Have a look at this screenshot of my backend "code".... why isn't interpolate working with self.width? By the way, if I replace 10+30*snowballsEaten with 10+30*3 it works. So I know that interpolate can work for width..but it isn't recognizing that snowballsEaten has incremented.
Thanks guys and gals
.B.
I'm using an actor to fill a progress bar by starting off 10px wide and then as the player collects snowballs the progress bar gets wider with the formula: interpolate self.width = 10+30*snowballsEaten
However, for whatever reason it isn't working.... This seems pretty straight forward but I'm not sure why I can't find the bug.. I've tried lots of things.
I'm sure that the snowballsEaten counter is going up because if snowballsEaten >= snowballsNeeded then the game stops as planned... thus verifying that snowballsEaten counter is working.
Have a look at this screenshot of my backend "code".... why isn't interpolate working with self.width? By the way, if I replace 10+30*snowballsEaten with 10+30*3 it works. So I know that interpolate can work for width..but it isn't recognizing that snowballsEaten has incremented.
Thanks guys and gals
.B.
Comments
اصنع self.attribute .
ثم ضع فيها المعادلة الرياضية التي تريد .
And Now ::
Make interpolate
Self.size.width TO self.attribute
^^ I'm not good for English..
^^Translate this from arabic Language
@adlaim said "Stay away from the use of mathematical formulas when using interpolate. Create self.attribute. Then place the mathematical equation that you want. And Now :: Make interpolate Self.size.width TO self.attribute"
So, I tried it... and it still isn't working. I set self.barWidth = 10+30*(snowballsEaten/snowballsNeeded)
then I used interpolate self.width to self.barWidth
Still not working... hmmm
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
What´s the issue? Does it not add. Is that what you saying?
Here is how I would do to say when to interpolate.
Make a new attribute(integer) and call it SnowBallsCurrentEaten(or something)
And then make a rule that says
If attribute game.SnowballsCurrentEaten is not equal to game.SnowballsEaten
Change attribute game.SnowballsEaten to game.SnowballsCurrentEaten
Interpolate self.size.width to 10+30*snowballsEaten.
I did check it out my self and it did work
//Fajlajp
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
You know, I did even think of that possibility but I was thinking that um..duh no that isn't necessary because it will always interpolate based on the current value of snowballsEaten... I was wrong but I should have checked it... *shrug*
Thanks for taking the time to reply
The good news is LEVEL 1 COMPLETE! YES!
The following 59 (or so) levels of my game should be faster now!
//Fajlajp