A simple egg toss platformer game implemented in Pyret, inspired by classic vertical jumper mechanics. The player controls an egg that jumps across moving platforms and attempts to reach the top without falling off-screen.
- Dynamic moving platforms with velocity reversal at screen bounds
- Egg jumping mechanics with gravity and airborne detection
- Platform collision and fall detection
- Score tracking and lives system
- Auto-scrolling level transition with new platform generation
- Game over state with reset functionality
- Platforms (top, middle, bottom) move horizontally and reverse at edges.
- Egg jumps when spacebar is pressed (only if it's on a platform).
- Collision Detection triggers landing and score updates.
- Lives are reduced when the egg falls out of bounds.
- Game transitions to the next level by scrolling new platforms in from above.
| Key | Action |
|---|---|
| Spacebar | Jump / Restart game |
You can adjust these constants in main.arr to modify gameplay difficulty, behavior, and visuals.
| Constant | Default | Description |
|---|---|---|
SCREEN-WIDTH |
300 | Width of the canvas |
SCREEN-HEIGHT |
500 | Height of the canvas |
SCREEN-TRANSITION-SPEED |
3 | Scroll speed when transitioning between levels |
FPS |
60 | Updates per second (higher = smoother gameplay) |
| Constant | Default | Description |
|---|---|---|
PLATFORM-WIDTH |
70 | Width of each platform (wider = easier landings) |
PLATFORM-HEIGHT |
13 | Height of each platform (visual only) |
PLATFORM-COLOR |
"brown" | Fill color of platforms |
PLATFORM-VELOCITY-LIMIT |
9 | Max platform movement speed (higher = harder) |
PLATFORM-DISTANCE |
150 | Vertical spacing between platforms |
| Constant | Default | Description |
|---|---|---|
TOP-PLATFORM-Y |
SCREEN-HEIGHT / 4 |
Y-position of the top platform |
MID-PLATFORM-Y |
TOP + 150 |
Y-position of the middle platform |
BOT-PLATFORM-Y |
MID + 150 |
Y-position of the bottom platform |
| Constant | Default | Description |
|---|---|---|
EGG-RADIUS |
20 | Radius of the egg (larger = easier collisions) |
EGG-COLOR |
"blanched-almond" | Fill color of the egg |
EGG-JUMP-HEIGHT |
-20 | Initial jump velocity (more negative = higher) |
EGG-AY |
0.9 | Gravity acceleration (higher = faster fall) |
EGG-INITIAL-X |
100 | Egg's initial horizontal position |
| Constant | Default | Description |
|---|---|---|
SCREEN-WIDTH-PLATFORM-LIMIT |
SCREEN-WIDTH - PLATFORM-WIDTH |
Prevents platforms from going off the screen |