Not counting score properly?
drakee510
Member Posts: 49
Hi guys, so I've been getting a piece of the flappy birds cake and making my own slender spinoff. All has been going well, but for some reason it sometimes misses the score. I watched a tutorial and followed the code and theirs worked perfectly. I evaluated the code and it still didn't work. Any help?
https://www.dropbox.com/s/60qnre12ki0x9qx/Flappy Slender.gameproj?m=
FIXED LINK: https://www.dropbox.com/s/ylwnodcmrbavdki/Flappy Slender.zip
Comments
Your thinking about things too complex. I would do this a different way that's better imo.
Create an integer attribute called Buzzy X. You need to get Buzzy's Position to trigger the points after it passes the obstacles.
In Buzzy actor, change attribute, game.buzzy X to self.position.X - this will give the game attribute Buzzy's position to call the score.
In Bottom obstacle (or Top, only needs to be one) Create a Rule, if self.position.X is < game.buzzy X change game.score to min(game.score +1 ,9999)
(Where 9999 is your Max point value if any.)
Edit: Also I would recommend creating another game attribute called Point Value. This will allow you to plug a number in at a later point if you wanted to change the point value for passing an obstacle with a power up or something later. This "Point Value" would take the place of the "1" in min(game.score +1 ,9999)
Edit2: I should explain what you were doing wrong in the first place so you can learn better. Sorry, I tend to jump to solutions quickly. lol
Anyway, the problem you were having was that your "Goal" actor was not positioned correctly on the Y. So Buzzy would sometimes collide with it and sometimes not, and again sometimes he would it it twice. And to explain why you are thinking too complex; You already have obstacles passing by buzzy, so adding another one was extra work. See images.
Illustration Portfolio:: |
Our Christmas Wishes for iPad:: |
Astropak for iPhone,
Android
and Kindle Fire
Sorry for the late response @JDuaneJ, but this helped a lot. Thanks!