SparkJS
HomeIntermediateRacing Game

🏎️ Racing Game

Fast-paced top-down racing with traffic dodging and smooth lane switching

⏱️ 6 hours⚡ Intermediate🎮 Game Project

Play the Game

Use A/D or Arrow keys to switch lanes

📋 How to Play

  • 1.Press A/D or Left/Right Arrow to switch lanes
  • 2.Dodge oncoming traffic to survive
  • 3.Earn 10 points for each car you pass
  • 4.Don't crash! One collision ends the race

🎯 Key Concepts

Collision Detection

Rectangle-based hit detection to check player vs. traffic collisions.

Sprite Rendering

Drawing cars and road elements using canvas rectangles and colors.

Scrolling Background

Animating road lines to create the illusion of forward motion.

Dynamic Spawning

Random lane selection and timing to keep gameplay challenging.