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

2014/12/15

How can I say my score counter that one object is in a specific cell?

Markulu Markulu

2014/12/15

#
Hey guys, i'm programming a game in which someone has to put food in his house... I programmed a score counter which gets a new value after eating food. My problem is that it shouldn't get a new value after eating something. I want to get a new score after placing the food in a specific cell (e.g. width 5, height 6...). To get a new score I just have to put in counter.add(1); but I don`t know the program line for "saying" the counter that one object is in a specific cell.... Can someone help me please? Thank you for your help!
danpost danpost

2014/12/15

#
Sounds like the player ('someone') has to keep track of whether it has eaten food (and possibly how much food was eaten since the last time at the house). Then when at the house, that someone needs to bump the counter for each food eaten this go-around and re-zero the food eaten field.
You need to login to post a reply.