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

2013/10/4

Help me with code its urgent

JERRY**5 JERRY**5

2013/10/4

#
can anyone give me the code such that the ball should fall on a man and the man should disappear and in place of man blood should appear.
danpost danpost

2013/10/4

#
Since the man is involved in both (1) ball hits man and (2) man becomes blood, you should probably have the man detect the ball and add the blood to the world before removing himself.
JERRY**5 JERRY**5

2013/10/4

#
can you please give me the code
danpost danpost

2013/10/4

#
You should try to code it yourself and then if you run into problems, post the code you tried and explain what is happening that shouldn't, and what should happen; AND, if you are getting error messages, copy/paste the complete message here and point out exactly where the error occurred or what line was highlighted.
JERRY**5 JERRY**5

2013/10/4

#
public void die() { Actor Man = getOneObjectAtOffset(0, 0, Man.class); //this line is creating error if (Man != null) { getWorld().removeObject(Man); //how to replace this object with another one Greenfoot.playSound("aah.wav"); } }
erdelf erdelf

2013/10/4

#
Maybe u should read what danpost said, it would be better to write the code in the class of the Man. and if u are getting errors, copy/paste them
You need to login to post a reply.