This is an initiative to teach coding/programming concepts to school kids.
This is a fun activity for school kids to learn coding concepts with the help of a parent or an adult who has some fundamental coding concepts.
The kids will be building a game by completing a series of lessons while learning various coding concepts and having fun at the same time.
We will be building a single-player 2D game with multiple moving enemies and treasure objects. The objective of the player is to collect all the treasures by avoiding any collisions with the enemies. The player will lose health if collided with an enemy. The player will also lose a life when the health indicator becomes empty. A player will have three lives to complete the mission by collecting all treasures.
- Integrated Development Environment (IDE)
- Organization of source code files
- Using built-in functions
- Variables
- Creating functions
- Conditional logic
- Control flows
- Loops
- Arrays
- Class and object
- Array of objects
- Random number generation
- Calculations
| Lessons | Contents | Concepts |
|---|---|---|
| Lesson 1 | Setting the coding environment | IDE, source code |
| Lesson 2 | Drawing some basic shapes | 2D coordinates, built-in functions |
| Lesson 3 | Moving a basic shape | Variables, keyboard input |
| Lesson 4 | Restricting the movement of a shape | Control flow and conditional logic |
| Lesson 5 | Creating a complex shape | Functions |
| Lesson 6 | Adding more movements | Class and object |
| Lesson 7 | Creating an enemy | Class and object |
| Lesson 8 | Creating multiple enemies | Arrays of objects, loops |
| Lesson 9 | Moving the enemies | Conditional logic |
| Lesson 10 | Detecting collisions | Conditional logic, loops |
| Lesson 11 | Implementing the health bar | Conditional logic |
| Lesson 12 | Creating a treasure object | Class and object |
| Lesson 13 | Creating multiple treasure objects | Random number generation, loops |
| Lesson 14 | Implementing scoring | Calculations |
| Lesson 15 | Implementing lives | Conditional logic and calculations |
- Mac or Windows
- Visual Studio Code
- Node.js
- Download and install
Visual Studio Code. - Download and install
Node.js. - Download the
CodingForKidsproject from github.com as a zip file by selectingCodeand thenDownload ZIP. - Extract the zip file.
- Run
Visual Studio Code. - Open the extracted folder in
Visual Studio Codeby selectingFileand thenOpen Folder. - Open a new terminal in
Visual Studio Codeby selectingTerminaland thenNew Terminal. - Finally, run the following commands in the
terminalone after another.
npm install
npm run start
- The above commands will open a page on the browser which will automatically refresh as you change your code.
- Open the
LessonGuide.mdand start withLesson 01 Guide. - Have fun!