How to make an egg and spoon race in Python

Hi all,

Sorry for the strange title, but it sums up my qusetion.

I want to make a game mechanic where a car has a bomb that explodes if the car lurches violently, or is hit by weapons. How would I do this?

To make things fair I would have an on screen indicator (a circle within a square) so when the circle touches the edge of the square the bomb goes off.

Any thoughts would be ace.

Cheers

Paul

Well, you could compare the speed values of the car. If you’re using linear velocity, you can get it with obj.getLinearVelocity() - get the linear velocity from the past frame (before you assign it again), get the current speed, and check to see if it’s over a tolerance value. If it is, an explosion happens, OR you can increment a value that, when it reaches a certain threshold, an explosion happens (so that an explosion won’t happen the minute you tap a wall).

The simplest way?

Just a marble game. Make the labyrinth as a bowl. When the marble hits a wall kabooom.
You can even use a top-down view as your indicator.


|           | <- hit this to explode
.\  <-O->  /.
..^-------^..

Thanks SolarLune and Monster!