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

2015/1/6

Checking for the speed of an object when it comes in contact with another?

DiplomatikCow DiplomatikCow

2015/1/6

#
I'm having a game where you are controlling a rocket until it hits the earth, however, I want to make it so that when I touch the earth, before the game stops, one of the two interacting objects checks for the speed of the rocket, and if it is higher than three the rocket explodes. No clue how to add this in to my code.
danpost danpost

2015/1/6

#
It is the rocket that will have the vertical movement and speed. It is also the rocket that will explode. Where do you think the best place would be for the code in question. You said 'if it (the speed) is higher than three the rocket explodes'. What code do you think would be synonymous with that? Where in the class do you think that code should go?
xFabi xFabi

2015/1/6

#
http://www.acsu.buffalo.edu/~gauravku/113/Assignments/8/Newtons-Lab-3/doc/SmoothMover.html Gonna get some sleep ._. , wait for Dan to reply if there's still questions Btw, are you hired by greenfoot Dan ^^?
You need to login to post a reply.