โ† Lark Noa โ€บ ๐Ÿ  Course Home โ€บ ๐Ÿ“„ Phase 1 โ€” HTML & CSS โšก Phase 2 โ€” JavaScript ๐ŸŽจ Phase 3 โ€” Canvas ๐Ÿ•น๏ธ Phase 4 โ€” Games ๐Ÿค– AI Chapter ๐Ÿš€ Phase 5 โ€” Advanced
Intro Lesson Map Phases โ†“
HU EN
๐Ÿ“‹

Introduction โ€” Why do we learn this way?

The philosophy behind this course

This course does not start with abstract theoretical concepts. Instead, we take real games that run on the internet โ€” Froggy Rush, Turtle Race and Castle Siege โ€” apart piece by piece, learning every concept exactly when we need it.

Core principle

Every lesson solves a concrete problem in one of the games. We never learn something that doesn't have an immediately visible and understandable use.

You need no prior programming knowledge to complete this course. Only two tools are required: a text editor (e.g. VS Code, Notepad++) and a browser (Chrome, Firefox).

What languages do we learn?

HTML (content structure) + CSS (appearance) + JavaScript (program logic). No Python, no C, no server โ€” everything runs in the browser with immediate, visible results.

Why NOT Python or C?

Our goal is to build games that anyone can try on their phone โ€” the browser is the best platform for this. Python and C serve different purposes (data science, systems programming) โ€” those would be topics for a different course.

๐ŸŽฏ

What will you be able to do by the end?

Concrete, measurable outcomes
HTML & CSS
  • Build a webpage from scratch
  • Place text, images and links
  • Set styles, colours and sizes
  • Create a canvas element
  • Make it look good on mobile (responsive)
JavaScript
  • Work with variables and arrays
  • Write conditions and loops
  • Design and call functions
  • Use objects and classes
  • Handle events (click, key, touch)
Canvas & Graphics
  • Draw shapes and images
  • Write an animation loop (game loop)
  • Implement collision detection
  • Simulate movement and physics
Advanced Topics
  • Build a save system
  • Play and manage sounds
  • Program AI opponents
  • Deploy to Netlify
  • Add mobile touch controls
๐Ÿ› 

Required tools

Everything is free, no installation needed for the basics
ToolPurposeWhere to get it
VS CodeWriting code, syntax highlightingcode.visualstudio.com (free)
Chrome / FirefoxRunning the game, debugging (F12)Already installed
Notepad++Alternative text editornotepad-plus-plus.org (free)
NetlifyPublishing your game online (Phase 5)netlify.com (free plan)
First step โ€” try it right now

Open a new file, save it as index.html, type: <h1>Hello!</h1> โ€” then double-click to open it in your browser. That is programming.

๐Ÿ—บ

Course structure โ€” 50 lessons, 5 phases

Estimated time: ~6 months at 3โ€“4 hours per week
1

HTML & CSS Basics โ€” Lessons 1โ€“10

We build the skeleton and appearance of a webpage. We learn document structure through Castle Siege's HTML layout.

HTML5 CSS3 ~5 weeks
2

JavaScript Basics โ€” Lessons 11โ€“20

The logic of programming. From variables to objects, illustrated through Froggy Rush's level generator code.

JavaScript ES6+ ~6 weeks
3

Canvas API & Animation โ€” Lessons 21โ€“30

Drawing, movement, collision โ€” the fundamentals of game graphics. Learned through drawing the turtle and the frog.

Canvas 2D requestAnimationFrame ~6 weeks
4

Dissecting Full Games โ€” Lessons 31โ€“45

We understand every line of three complete games: game state, physics, AI opponent, level generation.

Game Loop AI logic ~8 weeks
5

Advanced Features & Publishing โ€” Lessons 46โ€“50

localStorage, sound handling, mobile D-pad, Netlify deploy. The game goes live on the internet.

localStorage Web Audio Deploy ~3 weeks
๐Ÿ“„

Phase 1 โ€” HTML & CSS Basics

From webpage skeleton to styles ยท Lessons 1โ€“10

In the first phase we learn how a webpage is structured โ€” and along the way, what the Castle Siege game's HTML frame looks like from the inside.

castle_siege.html โ€” the basic skeleton HTML
<!-- Every webpage starts like this -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Castle Siege</title>
  <style> /* CSS goes here */ </style>
</head>
<body>
  <canvas id="c"></canvas> <!-- the game canvas -->
  <script> // JavaScript goes here </script>
</body>
</html>
โ–ถ Open Phase 1 โ€” HTML & CSS โ†’
โšก

Phase 2 โ€” JavaScript Basics

The language of program logic ยท Lessons 11โ€“20

JavaScript is what brings a webpage to life. In this phase we learn from Froggy Rush and Galactic Conquest's code โ€” we always see exactly what each concept is good for in the game.

turtle_race.html โ€” variables and objects in the game JavaScript
// Variables โ€” store data
let lives = 3;          // number
let playerName = "Alex"; // string
let isJumping = false;  // boolean

// Object โ€” related data grouped together
const player = {
  x: 170,       // horizontal position
  y: 406,       // vertical position
  lives: 3,    // number of lives
  energy: 100  // energy level
};

// Array โ€” multiple items in a list
const eggs = [
  { x: 120, y: -200 },
  { x: 260, y: -450 },
  { x: 180, y: -700 }
];
โ–ถ Open Phase 2 โ€” JavaScript โ†’
๐ŸŽจ

Phase 3 โ€” Canvas API & Animation

Game graphics and movement ยท Lessons 21โ€“30

The Canvas is the "drawing board" we draw the game onto. In this phase we learn how to draw shapes, characters โ€” and how to animate them.

froggy_rush.html โ€” the game loop structure JavaScript
// Getting the canvas element and drawing context
const canvas = document.getElementById('gc');
const ctx = canvas.getContext('2d');

// The game loop โ€” runs 60 times per second
function loop() {
  update();  // 1. updates the game state
  draw();    // 2. draws the current frame
  requestAnimationFrame(loop); // 3. calls itself again
}

// Drawing on the canvas
function draw() {
  ctx.clearRect(0, 0, W, H);    // clear
  ctx.fillStyle = '#4aaa22';    // set colour
  ctx.fillRect(100, 200, 50, 30); // draw rectangle
}
โ–ถ Open Phase 3 โ€” Canvas & Animation โ†’
๐ŸŽฎ

Phase 4 โ€” Dissecting the Three Games

Froggy Rush ยท Turtle Race ยท Castle Siege ยท Lessons 31โ€“45

In this phase we take apart three complete games and understand them piece by piece. Each lesson examines one specific mechanism from the inside.

LESSON 31 ยท Froggy Rush

Procedural level generation

How do we place eggs, rocks and seagulls randomly but fairly? The evenSpread() function.

Froggy Rush
LESSON 32 ยท Froggy Rush

Surfaces and speed โ€” strategy pattern

The SURFACES object: how to store all surface properties in one place and read them dynamically.

Froggy Rush
LESSON 33 ยท Froggy Rush

Jump physics โ€” Math.sin() parabola

How we calculate the frog's arc using sin(). The relationship between jumpT timer and jumpH height.

Froggy Rush
LESSON 34 ยท Froggy Rush

Multi-state game โ€” State Machine

play, dead, levelup, gameover โ€” the concept of the state machine. How does the game switch states?

Froggy Rush
LESSON 35 ยท Froggy Rush

Difficulty levels โ€” DIFF_CFG object

How do we change the entire game's behaviour with just one DIFF variable?

Froggy Rush
LESSON 36 ยท Turtle Race

AI opponent โ€” targeting and navigation

How does the turtle AI decide: which egg is closest? How does it avoid seagulls? Weighted scoring.

Turtle Race
LESSON 37 ยท Turtle Race

Resource management โ€” Energy system

Energy drain per surface, recharging by collecting โ€” the mechanics of decision-making and trade-offs.

Turtle Race
LESSON 38 ยท Turtle Race

Camera and world-space coordinates

Why are objects' y coordinates sometimes positive, sometimes negative? Screen-space vs world-space.

Turtle Race
LESSONS 39โ€“40 ยท Turtle Race

Drawing characters in layers

Shadow โ†’ legs โ†’ body โ†’ head โ†’ eyes โ†’ mouth โ€” the correct drawing order and using save/restore.

Turtle Race
LESSONS 41โ€“42 ยท Castle Siege

Tower Defense architecture

How is all of Castle Siege structured? Heroes, towers, enemies, projectiles โ€” all data in the G object.

Castle Siege
LESSON 43 ยท Castle Siege

Dynamic level generation โ€” genLevel()

50 different levels from one function. How do we scale difficulty with mathematics?

Castle Siege
LESSON 44 ยท Castle Siege

Bullet prediction โ€” lead prediction

The tower shoots not where the enemy IS, but where it WILL BE. Calculating speed and travel time.

Castle Siege
LESSON 45

๐Ÿ† Project: Your own mini game

The student designs and builds their own simple game using what they've learned. Independent development.

Own Project
โ–ถ Open Phase 4 โ€” Dissecting Games โ†’
๐Ÿš€

Phase 5 โ€” Advanced Features & Publishing

localStorage, sounds, mobile UI, deploy ยท Lessons 46โ€“50
LESSON 46

localStorage โ€” saving in the browser

How does Castle Siege save level progress? JSON.stringify, JSON.parse, localStorage.setItem.

Data
LESSON 47

Top 10 leaderboard implementation

Sorting arrays, slice() โ€” how to maintain a list of best scores with names and points.

Data
LESSON 48

Web Audio API โ€” music and sound effects

new Audio(), play(), base64 embedding โ€” why this approach and why Android can't load a separate file.

Audio
LESSON 49

Mobile D-pad and touch handling

touchstart, touchend, pointer events โ€” how we built Froggy Rush and Castle Siege's mobile controls.

Mobile
LESSON 50

๐Ÿ† Deploy โ€” Netlify upload

How does the game get onto the internet? Netlify account, drag-and-drop deploy, custom URL. Course wrap-up.

Deploy
What you'll have at the end

After completing the course you'll be able to independently design and build simple browser games using HTML and JavaScript, and publish them online โ€” using nothing but a text editor and a browser.

๐Ÿ“Š

Summary table

The full course at a glance
PhaseTopicLessonsEst. timeExample game
1. HTML & CSS Webpage structure, styles, responsive design 1โ€“10~5 weeksCastle Siege (HUD)
2. JavaScript Variables, conditions, loops, functions, arrays, objects 11โ€“20~6 weeksFroggy Rush (logic)
3. Canvas Drawing, animation, collision, physics, camera 21โ€“30~6 weeksTurtle Race (graphics)
4. Games Full game dissection, AI, state machine, level generation 31โ€“45~8 weeksAll three games
5. Advanced Saving, sounds, mobile UI, deploy 46โ€“50~3 weeksFull implementation
Total 50 lessons ~6 months 3 games live online
Next step

This document is the introductory part of Lesson 1. The individual lesson files contain detailed explanations, code examples and exercises โ€” always connected to specific lines of the games above.