Hey there,
i have search for a solution but i do not found them. I think i have used the wrong search key words, but i have no idea what i should do search for.
Well, the question is: How can i realize a general collisions dedection for all fruits?
I have this objects:
Mr_Wombat
Fruit
+-Bannana
+-Appel
+-Orange
+-...
Now i used this in the Mr_Wombat.act()
It works, but i will put more fruits in the game and i think it is not posible when i use the redundant code for each fruit like this
Easyer solution?
I think at this
But this dont work.
if (getOneIntersectingObject(Bannana.class) != null){
countPoints();
}if (getOneIntersectingObject(Bannana.class) != null){
countPoints();
}
if (getOneIntersectingObject(Appel.class) != null){
countPoints();
}
if (getOneIntersectingObject(Orange.class) != null){
countPoints();
}
...if (getOneIntersectingObject(Fruits.class) != null){
countPoints();
}


