So I am still working on my Frogger project and when my bee touches a flower, i want it to move with the flowers (the flowers automatically move on their own). I can't tell what exactly is wrong with my code here. Any help?
This code is in the bee class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public void act() { movement(); hitBird(); touchFlower1(); } public void touchFlower1() { Actor Flower1 = getOneIntersectingObject(flower1. class ); if (Flower1 != null ) { this .setLocation(Flower1.getX(),Flower1.getY()); } } |