Arcade Dash Project Guide
7th Grade Python • CodeSkulptor3
Arcade Dash Project Guide
Name: ____________________________
Date: _____________________________
Your Mission
Design and code a playable keyboard-controlled arcade game in CodeSkulptor3 (py3.codeskulptor.org). Your player will move smoothly using keyboard input, stay inside the game screen, and react to collisions with collectibles or hazards.
Part 1
Game Concept & Controls Blueprint
Plan before you code!
Game Title & Theme:
Player Character & Main Goal:
Keyboard Controls Plan (What does each key do to player_vel?)
| Key Pressed |
Direction / Action |
Velocity Change (vx, vy) |
| Up / W |
|
|
| Down / S |
|
|
| Left / A |
|
|
| Right / D |
|
|
Canvas Layout Sketch (600 × 400 px)
Sketch your player, targets/hazards, and score display
(0, 0) (600, 400)
Phase 1
Canvas, Player & Keyboard Movement
import simplegui
1 Set Up the Frame & Draw Your Player
Starter Code
Create your window size constants, a list for the player's position [x, y], and a list for velocity [vx, vy]. Inside draw(canvas), update the position by adding velocity each frame, then draw your player.
import simplegui
WIDTH, HEIGHT = 600, 400
player_pos = [300, 200]
player_vel = [0, 0]
SPEED = 4
def draw(canvas):
player_pos[0] += player_vel[0]
player_pos[1] += player_vel[1]
canvas.draw_circle(player_pos, 18, 2, "Cyan", "Teal")
Checkpoint 1: My 600×400 canvas opens and shows my player at the center.
[ ] Done
2 Add Smooth Keyboard Input (keydown & keyup)
Input Handlers
Use keydown to set velocity when a key is pressed, and keyup to reset velocity back to 0 when released. Then create the frame and register all handlers at the bottom:
def keydown(key):
if key == simplegui.KEY_MAP["left"]: player_vel[0] = -SPEED
if key == simplegui.KEY_MAP["right"]: player_vel[0] = SPEED
if key == simplegui.KEY_MAP["up"]: player_vel[1] = -SPEED
if key == simplegui.KEY_MAP["down"]: player_vel[1] = SPEED
def keyup(key):
if key in (simplegui.KEY_MAP["left"], simplegui.KEY_MAP["right"]): player_vel[0] = 0
if key in (simplegui.KEY_MAP["up"], simplegui.KEY_MAP["down"]): player_vel[1] = 0
frame = simplegui.create_frame("Arcade Dash", WIDTH, HEIGHT)
frame.set_draw_handler(draw)
frame.set_keydown_handler(keydown)
frame.set_keyup_handler(keyup)
frame.start()
Checkpoint 2: Holding a key moves my player smoothly; letting go stops it.
[ ] Done
3 Keep the Player Inside the Screen (Boundaries)
Stop your player from flying off-screen! After updating player_pos in draw, check if player_pos[0] < 18 or > WIDTH - 18 (and do the same for y and HEIGHT).
My Player Customization Notes (Colors, Size, Speed, or Custom Shape):
Phase 2
Collisions, Challenges & Scoring
import random, math
4 Spawn a Collectible Target or Moving Hazard
Import random and math at the top of your file, and initialize score = 0 and star_pos = [random.randrange(30, 570), random.randrange(30, 370)] as globals. Draw star_pos inside draw(canvas)!
5 Detect Collisions Using Distance
Math Connection
Two circles collide when the distance between their centers is less than r1 + r2. Because draw(canvas) reassigns score and star_pos, declare them with global at the top of draw to avoid a NameError:
def distance(p, q):
return math.sqrt((p[0] - q[0]) ** 2 + (p[1] - q[1]) ** 2)
At the top of draw(canvas), add:
global score, star\_pos
if distance(player\_pos, star\_pos) < 18 + 12:
score += 1
star\_pos = \[random.randrange(30, 570), random.randrange(30, 370)\]
Checkpoint 3: Touching the target adds +1 to score and respawns it.
[ ] Done
6 Add a Challenge Twist & HUD Display
Level Up
Draw your score and lives with canvas.draw_text("Score: " + str(score), [20, 35], 24, "White"). Then add at least one challenge: a moving enemy that costs a life, a speed boost every 5 points, or a "GAME OVER" screen when lives == 0.
My Collision & Challenge Plan (What happens on hit? How do you win or lose?):
Checkpoint 4: My game displays Score/Lives and has a working challenge or Game Over.
[ ] Done
Phase 3
Playtest, Debug & Reflect
Final Stretch
7 Peer Playtest Log
Have 2 classmates test your game for 3 minutes each
| Playtester |
Smooth Controls? |
Collisions Work? |
One Bug Found or Idea to Improve |
|
Yes / Almost |
Yes / Almost |
|
|
Yes / Almost |
Yes / Almost |
|
Final Pre-Submit Checklist
[ ] Canvas runs without Python errors
[ ] Collisions trigger score or life changes
[ ] Keydown & keyup move/stop smoothly
[ ] Score/Lives are clearly visible on screen
[ ] Player cannot leave the canvas edges
[ ] Code has # comments explaining sections
Part 2
Developer Reflection
1. Biggest Bug & Fix: What was one bug you ran into while coding, and how did you solve it?
2. Proudest Feature: What part of your game are you most proud of, and why?
3. Next Level Upgrade: If you had one more week to work on this game, what would you add?