This site requires JavaScript, please enable it in your browser!
Greenfoot back
kirajim
kirajim wrote ...

2020/6/14

Trying to spawn actors at different times

1
2
3
4
kirajim kirajim

2020/6/17

#
Ok now I just need one last thing and I am finally done how can i count the coins as i collect them. I want it to show the amount of coins I collected after i lose the game at the end up right corner is that possible?
danpost danpost

2020/6/17

#
kirajim wrote...
Ok now I just need one last thing and I am finally done how can i count the coins as i collect them. I want it to show the amount of coins I collected after i lose the game at the end up right corner is that possible?
Is that what your counter field in your world class is for? -- to count coins collected? If so,
((FlappyWorld)getWorld()).counter++;
should work to keep its value updated.
kirajim kirajim

2020/6/17

#
No it was for counting the score for when the bird goes inside a pipe. I want a new counter for every time the bird collects the coin that appear at the end when it displays game over
danpost danpost

2020/6/18

#
kirajim wrote...
No it was for counting the score for when the bird goes inside a pipe. I want a new counter for every time the bird collects the coin that appear at the end when it displays game over
Then, add a field for it. Call it "int coinsCollected:".
You need to login to post a reply.
1
2
3
4