How do game events work?
<p>I'v always wondered how this works. Does having more slow down the game? for example how would one represent checking if a car has flipped. It could be seen as:</p>

<pre><code>if (player.car.angle.y == 180)
{
do something
}
</code></pre>

<p>The parts that puzzle me is, when would the game check for it?  The way I see it, every thing that can happen in the game seems to evolve an if. I'm just wondering how these are handled.</p>

<p>Also, since the game runs through a loop, what if the car is flipped for more than 1 frame, would a Boolean really be used to check if the event has been fired</p>

<p>Thanks</p>
