Long Nguyen

Resources and online courses for Math and Computer Science.

AP Computer Science Java

This is a resource for teachers and students for AP Computer Science A. This curriculum follows the newly revised 2019 College Board curriculum, which consists of 10 units. In addition, the emphasis is to help students learn how to code 2D arcade games using Processing. In particular, students will work on writing a full platformer game like Super Mario from scratch.

Lecture Notes

The following powerpoint lecture slides are adapted from the book Building Java Programs: A Back to Basics Approach by Stuart Reges and Marty Stepp as well as the Runestone's CS Awesome curriculum.

Unit 1: Primitive Types
  1. Basic Java Syntax (PPT, PDF)
  2. Variables and Datatypes (PPT, PDF)
  3. Arithmetic Operations (PPT, PDF)
Unit 2: Using Objects
  1. Objects: Instances of Classes (PPT, PDF)
  2. (OPTIONAL) User Input with Scanner (PPT, PDF)
  3. Methods (PPT, PDF)
  4. Strings (PPT, PDF)
  5. Math Class And Wrapper Classes (PPT, PDF)
Unit 3: Boolean Expressions and if statements
  1. Boolean Expressions and if-else-else if statements (PPT, PDF)
  2. Compound Boolean Expressions and Comparing Objects (PPT, PDF)
Unit 4: Iterations
  1. While Loops (PPT, PDF)
  2. For Loops (PPT, PDF)
  3. Nested Loops (PPT, PDF)
(*Optional*)Computer Animation with Processing
  1. The Basics(PPT, PDF)
  2. Working with Images(PPT, PDF)
  3. Collision Detection(PPT, PDF)
  4. Simple Platformer Game(Mario)(PPT, PDF)
Unit 5: Writing Classes
  1. Anatomy of a Java Class (PPT, PDF)
  2. Writing Methods (PPT, PDF)
  3. Variables, Scope and Semantics (PPT, PDF)
Unit 6: Arrays
  1. Introduction to Arrays(PPT, PDF)
  2. For Each and Array Algorithms(PPT, PDF)
Unit 7: ArrayLists
  1. Introduction to ArrayLists(PPT, PDF)
  2. Searching and Sorting(PPT, PDF)
Unit 8: 2D Arrays
  1. 2D Arrays(PPT, PDF)
Unit 9: Inheritance
  1. Inheritance(PPT, PDF)
  2. Polymorphism(PPT, PDF)
Unit 10: Recursion
  1. Recursion(PPT, PDF)
Preparing for the AP Exam
  1. Preparation for the AP Exam(PPT, PDF)

How to Write a Platformer 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! Here's a short 2-minute preview of the game. The entire Youtube playlist for this curriculum can be found here. The webpage including labs for the curriculum is here.

Coding Challenges

A series of coding challenges. Most are mathematical in focus and require some trignometry. The distribution code is included and provides a template for completing the code. Processing is used for the animation challenges.

  1. Ball Bounces Off Angles This animation challenge simulates a ball drop on an uneven ground. (Demo, Tutorial, Distribution Code) Solutions can be found here.
  2. Inverse Kinematics: Pulling A String This animation challenge simulates pulling a string with the mouse. (Demo, Tutorial, Distribution Code)
  3. Billiard Ball Collisions This animation challenge simulates collisions of billiard balls in 2D. (Tutorial, Distribution Code) Solutions to the two-ball case and the many-ball case with the glitch fix.

Final Projects


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