
Here you see how this looks:
First you make sure your movieclip rotates where most of the weight is. In this case a little bit more to the bottom.
Then you create a movieclip inside the object (the car), called 'perim' (for perimeter).
Along the perimeter you place sentries, empty movieclips (in this case they are small white squares) where you want your object to bounce.
Now for each move, you check if each of these sentries hit (with hitTestPoint) another movieclip.
The points find a way out of the bounce object and this influences the speed and rotational speed of the object.
It's that simple.
Here is a result and here are the sources.
Geen opmerkingen:
Een reactie posten