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

2016/5/10

How to make an object explode if it moves too fast?

zai zai

2016/5/10

#
Hello I am making a program where a ship will explode if it hits the ground too fast. The ship is moving based on SmoothMover (version 2.2) and vectors. How do I check for the speed of this ship? I tried importing the variable length from Vector but that didn't work. I'm checking for speed and collision from inside the ship
danpost danpost

2016/5/10

#
From what I can tell, the SmoothMover class only tracks the exact location of an actor. I does not retain anything related to speed, direction, velocity or acceleration. The Vector class is used to retain speed and direction; so you should be able to get the length (which is speed) and direction from it
You need to login to post a reply.