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

2011/3/21

Collisions in a game

JessikaJobe JessikaJobe

2011/3/21

#
I am setting up a game and rather than having the game count how many times the bird eats the worm, I just want it to count how many times they collide but I dont know what word to use in place of eat(Worm.class) I know how to set up the rest to count everything I am just not sure what word I use instead of "eat"
davmac davmac

2011/3/22

#
You can probably use "getOneIntersectingObject(Worm.class)". It returns null if there is no worm visible. See: http://greenfoot.org/doc/javadoc/greenfoot/Actor.html#getOneIntersectingObject%28java.lang.Class%29
You need to login to post a reply.