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

Report as inappropriate.

aburden9
aburden9 presents ...

2012/4/27

Robot Invasion

game i made for class. I couldn't get the rocket to move smoothly though. Any suggestions would be greatly appreciated

2010 views / 483 in the last 7 days

Tags: game with-source

open in greenfoot
Your browser does not support the canvas tag.
aburden9aburden9

2012/5/7

if anyone has any suggestions for fixing the movement of the space ship I'm open to them. I can't for the life of me figure it out :/.
tylerstylers

2012/5/7

if you look at your code in space you have got this public void act() { if(Greenfoot.getRandomNumber(200)<10) {addObject(new robot(), Greenfoot.getRandomNumber(700), 0); } addObject(new rocket(), 300,500); } where you add the rocket that needs to be in the constructor instead of being in act like this. public space() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(600, 600, 1); setPaintOrder(scoreboard.class,robot.class,rocket.class,counter.class); addObject(score,100,560); addObject(new rocket(), 300,500); } that should work :P
aburden9aburden9

2012/5/7

Well idk if it was what you suggested or not but i decided to see if it had something to do with the rocket image so i changed the image and did what you said also and it works fine. Trying to upload the new version now

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.