OWIS ECA proposal · Course 3 of 5

Creative Coding with C++

Write real C++, the language games are made in, and finish with a small game you programmed yourself.

Download this proposal (PDF)

Drawn by code: one function called in a loop, the same building blocks students use in C++.

Overview

Students learn C++, the language behind most game engines and much high-performance software, by writing programs that draw, animate and respond to the keyboard and mouse. They use SDL3, a free library used by professional game developers for windows, graphics, input and sound. The course is based on the university programming and game-engine courses I have taught, simplified for secondary students.

Objectives

Scheme of work

This ten-lesson outline is tentative. The order and pace of lessons will be adjusted to the students' ages, experience and interests.

Lesson Focus Students build or do ATL skill
1 Compile and run Open a window from the starter template; change its size and colour Self-management: following a process
2 Drawing Draw shapes with variables for position and size Thinking: planning with coordinates
3 The game loop and input Move a shape with the keyboard Thinking: change over time
4 Decisions and collisions Keep the shape on screen; detect when two shapes touch Thinking: cause and effect
5 Loops and arrays Draw and move many objects at once Thinking: spotting patterns
6 Functions and structures Organise the program into a "ball" and a "paddle" Thinking: breaking problems into parts
7 Motion with vectors Velocity, bouncing and angles Thinking: applying mathematics
8 Images and sound Add pictures and sound effects Research: finding and using resources
9 Mini project Build a Pong-style game and make it feel lively Self-management: planning a project
10 Show and tell Classmates and families play the games; each student explains one part of their code Communication: explaining technical ideas

Lesson structure (60 minutes)

Minutes Stage What happens
5 Warm-up A short code-reading puzzle; recap of last week
15 New idea One new idea, written live and explained
30 Make Students extend the starter code and test it
10 Share and reflect Quick demonstrations; one bug found and how it was fixed

Mixed grades: levels A, B and C

Older students and those with earlier programming experience will usually work at Level C.

Potential competitions

Students who enjoy the course could take part in two SIMCC contests in computational thinking and programming, both open to secondary grades: Bebras (usually February) and the International Junior Informatics Olympiad (usually April–May).

Requirements

Expected outcomes

By the end of the course, students will have written several C++ programs and a small game of their own, and should be able to explain how the game loop, input and collisions work in their code. The course gives a real foundation in a professional programming language. No previous programming experience is needed.

See it in action

  • Tiny Dungeon

    A small dungeon game I wrote in C++ and compiled to run in a web browser.

  • Graphics demo

    An OpenGL graphics demo I made for a university course: dozens of 3D characters drawn by one loop, in the browser.

  • Pong

    Pong in C++, compiled to WebAssembly so it runs in a browser and installs like an app.