GameCraft Starter: Space Dodge
Build a 2D game where you control a spaceship to dodge asteroids and rack up points!
Project Overview
Goal: Create a Space Dodge game using JavaScript and p5.js.
Tasks:
- Add the p5.js library via CDN in the HTML tab.
- Draw a spaceship and asteroids using p5.js canvas in the JavaScript tab.
- Implement keyboard controls (arrow keys) to move the spaceship.
- Add collision detection to end the game if the spaceship hits an asteroid.
- Display a score based on survival time or dodged asteroids.
Skills Learned: JavaScript (game logic), p5.js (graphics, input handling), game mechanics (collision detection, scoring).
Get Started
Follow these steps to build your Space Dodge game:
- Plan: Sketch the game layout (spaceship, asteroids, score display).
- Code: Use the OneCompiler editor below, starting from scratch.
- Add p5.js: In the HTML tab, add:
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.2/p5.min.js"></script>
- Learn: Visit the GameCraft course on Xion Apex Academy for p5.js tutorials.
- Submit: Share your game URL for feedback.
Code Workspace
Write your Space Dodge game from scratch in the editor below. Use the HTML tab for the p5.js CDN and the JavaScript tab for game logic.
Prefer coding externally? Use Replit or Download Starter Files (includes p5.js setup).
Submit Your Game
Once your Space Dodge game is ready, submit the URL (e.g., Replit or hosted link) for feedback or share it on Discord!