Space to rev, RPM slider to set manually Occasionally, the engine may not start correctly. I couldn't figure out why, so if you want the engine to work realistically, you will have to click the green flag over and over again until the green part (fuel valve) goes down, directly before that the the grey part (spark plug) flashes light blue (sparks).
A 4-stroke Petrol engine - No animations, every part is a sprite running based on some other part. RPM reference: Average car idle: 1000 rpm Average car red-line: 6000 rpm F1 car idle: 5000 rpm F1 car red-line: 15000 rpm Large Truck idle: 600 rpm Large Truck red-line: 4000 rpm Explanation: First, some info you might find useful when running the project. The pink colour represents the fuel (1 part) and air (about 15 parts). The orange colour is the fire resulting from combustion, while the dark grey colour is the exhaust. **Stroke 1: Intake (Direction: Down)** As the piston moves down, it creates a partial vacuum above it. With the fuel valve open, this vacuum draws the air-fuel mixture into the combustion chamber. **Stroke 2: Compression (Direction: Up)** As the piston moves back up, the fuel valve closes, sealing the combustion chamber. The piston compresses the air-fuel mixture, causing it to heat up significantly. **Stroke 3: Power (Direction: Down)** Just before the piston reaches the top of its cycle (Top Dead Center, or TDC), the spark plug fires, igniting the air-fuel mixture. The resulting expansion from the heated mixture pushes the piston down with enough force to continue the engine's operation. **Stroke 4: Exhaust (Direction: Up)** After the piston reaches the bottom of its travel (Bottom Dead Center, or BDC), only exhaust gases remain. As the piston moves back up, the exhaust valve opens to release these gases, clearing the way for the next intake of air and fuel. UPDATE: Added audio #all #all