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

2014/9/1

cannot find symbol - method hitAZombie(), how do i fix?

roshiyoshi roshiyoshi

2014/9/1

#
private Fish myShip; public Shot(Fish myShip) { this.myShip=myShip; } public void eat () { Actor zombie; zombie=getOneObjectAtOffset(0,0,Zombie.class); if(zombie!=null) { World world; hitAZombie(); world=getWorld(); world.removeObject(zombie); } }
danpost danpost

2014/9/1

#
You are calling the 'hitAZombie' method as if it was in the Shot class. If you do not have a 'hitAZombie' method in the Shot class, then that is why the compiler cannot find it.
roshiyoshi roshiyoshi

2014/9/1

#
thank you so much! I just realised my stupid mistake
You need to login to post a reply.