Computer Science Tutorials
Created by Hack Club staff
You can find this tutorial online at https://hackclub.com/workshops/soccer
This workshop has been retired and is no longer maintained or recommended.
Note to leaders running this workshop: we’re replacing Soccer with Dodge. We recommend running this in your clubs instead.
In this tutorial, we’ll walk you through building a single-player soccer game.
From there, the tutorial is designed to have you continue to expand on your game. Here is an example of what you could end up making:
Don’t feel that you have to follow along step-by-step. Figure out the best way to navigate this tutorial for you. This might look like the following:
If you have never programmed before:
If you have programmed a little:
If you have more experience:
Each interactive element in the game (the player, ball, and the goal) is called a sprite.
The entire area on which everything lives is called the canvas:
The instructions below will walk you through step-by-step of how to build a single player soccer game.
1. Initial Setup
2. Add Player Sprite
3. Mouse Movement
4. Dribble Ball
5. Add Goal
What programming languages and libraries are we using?
createSprite, step 2
player, step 2