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

2012/4/13

i want to add 2 enemys

-nic- -nic-

2012/4/13

#
but only one appers hellp please |:)
pubic void killninja()
{
Actor TheNinja ; 
TheNinja= getOneObjectAtOffset(0,0,TheNinja.class);
if(TheNinja!=null)
{
getWorld().removeObject(TheNinja);
getWorld().addObject(TheNinja,100,100);
getWorld().addObject(TheNinja,400,400);
}
}
when one ninja is killed i want 2 more to spawn but only 1 spwans help pleas!!!
davmac davmac

2012/4/13

#
You're not adding two ninjas, you're adding the same ninja at two different locations (which doesn't work). If you want to add a new ninja, then you must create a new ninja. And, if there's going to be more than one ninja, then "TheNinja" is a bad name for the class! How about just "Ninja"?
-nic- -nic-

2012/4/13

#
ill change it it was quite late when i named it :D:P:D:) ps how would i add another Ninja
-nic- -nic-

2012/4/13

#
anyway igot it working (felling smug)
You need to login to post a reply.