What should I do?Remove lines 41 through 54 and change your act method to this:
}
}
Anything wrong?Bullet doesn't want to remove?Sorry I wrote my comments in the code.My bullet doesn't disappear when it touches the zombie anyway?
RandomGuy wrote...
RandomGuy wrote...
RandomGuy wrote...
danpost wrote...
RandomGuy wrote...
I don't see anything here(correct me if I am wrong)?
Please send me an edited version of my code if possible.
It might work?public void act() {
move(6);
if (isAtEdge() || collidesWithZombie()) {
getWorld().removeObject(this);
Sooy i accidentally wrote my comment in my code:)
Thanks the error is fixed but my bullet isn't removed?
[code]import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Bullet here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Bullet extends Actor
{
/**
* Act - do whatever the Bullet wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public Bullet()
{
}
public void act() {
move(6);
if (isAtEdge() || collidesWithZombie()) {
getWorld().removeObject(this);
}
}
private boolean collidesWithZombie() {

