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

2012/7/12

Help pls

erdelf erdelf

2012/7/12

#
This is working after I paused and resumed, but not while running. btw I had no idea how to call the discussion because I don't get what the error is. The following is in act. boss is an Actor.
if(boss != null)
            {
                if(boss.getX() < getWidth() - 200)
                    boss.setLocation(getWidth() - 200, boss.getY());
danpost danpost

2012/7/12

#
Could you not, still, copy/paste the error message in your post?
erdelf erdelf

2012/7/12

#
I don't get an error message, this is why I don't know what could be wrong
danpost danpost

2012/7/12

#
Maybe you should check to see if the boss is in the world?
if(boss != null && boss.getWorld() != null)
Just a thought.
erdelf erdelf

2012/7/12

#
hm, I see that the boss is in the world, and my code works after I paused the game
danpost danpost

2012/7/12

#
Do you have a started() method? or any conditions before reaching that statement?
erdelf erdelf

2012/7/12

#
ok, that was it. I said that he should wait 8 secs after creation of the boss.
You need to login to post a reply.