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

2013/4/25

Making a ship cloak itself....chapter 7 collision detection asteroid

chuckyboy chuckyboy

2013/4/25

#
For an assignment I have one of the requirements it stated by pressing c the ship should be able to cloak itself and to avoid collision with an asteroid the cloak should last 50 moves. Not sure how to write a code to do these actions.
danpost danpost

2013/4/25

#
What do you think you will need to accomplish this task? Have you tried anything? if so, what?
chuckyboy chuckyboy

2013/4/25

#
Well I know how to set it up where when you press the letter c the action take place using the checkKeys method: /** * Check whether there are any key pressed and react to them. */ private void checkKeys() { ignite(Greenfoot.isKeyDown("up")); if (Greenfoot.isKeyDown("left")) { setRotation(getRotation() - 7); } if (Greenfoot.isKeyDown("right")) { setRotation(getRotation() + 7); } if (Greenfoot.isKeyDown("z")) { fire(); } if (Greenfoot.isKeyDown("u"))// { startProtonWave(); }
chuckyboy chuckyboy

2013/4/25

#
Don't know where to go from there
danpost danpost

2013/4/25

#
What do you need to do to make the ship invisible without removing the ship from the world? (Hint: what object does it involve and what do we need to do with it?)
chuckyboy chuckyboy

2013/4/25

#
the objects involved are the ship and the asteroid and we need to make the ship disappear when an asteroid is getting ready to colloid with it
danpost danpost

2013/4/25

#
That does not answer my question. I was asking about how to go about making the ship invisible. What can you do to make the ship not visible yet still be in the world?
You need to login to post a reply.