Long Nguyen

Resources and online courses for Math and Computer Science.

How to Write a Platformer(e.g. Super Mario) Game in Java

In this short video series course, we will learn how to write a platformer (or side-scrolling) game like Super Mario. We will write this game from scratch with very basic algebra without relying on any physics engine!

Below are all of the resources including video lectures, code, and labs. I created this curriculum for my AP Computer Science A course during the current school closures due to the coronavirus. Subscribe to my channel.

If you teach AP Computer Science A and would like solutions, feel free to contact me directly.

1) Game Preview

2) Introduction to Processing

3) Creating the Sprite Class

4) Controlling a Sprite Using the Keyboard

5) Creating the Game Map by Using a CSV File

6) Collision Detection

7) Resolving Platform Collisions Part 1

8) Resolving Platform Collisions Part 2

9) Add Jumping

10) Scrolling

11) Animating the Sprite(uses inheritance)

12) Creating Enemies(uses inheritance)

13) Animating the Player(uses inheritance)

14) Finish Up Game


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.