APCS Projects

Table of Contents

1. Turtles projects: Introduction to Java syntax

SummaryA sequence of projects uses turtle graphics as an introduction to basic Java syntax. A special IDE makes it possible for students to actually see how the computer evaluates their code.
TopicsLoops and Recursion
AudienceAppropriate for an introductory Java course
DifficultyMultiple sub-assignments provide a wide range of difficulties, from direct application of simple ideas like counting loops, to much more advanced use of math and computing concepts
StrengthsThe visual nature of turtles makes them more motivating and more easy to debug. The CodeMotion IDE allows students to see precisely how the computer executes their code.
WeaknessesCodeMotion is still in beta development and does not yet have some helpful features that exist in more established IDEs, such as "spell checking" syntax as you type.
DependenciesIntended as an introduction to programming, this unit is usually taught to students who know only the very basics of how to use a computer
VariantsBoth turtles and CodeMotion permit a wide range of experimentation on the part of the student.


CodeMotion Manual
(For the introductory projects I use a special IDE I developed that animates the process of executing code. It shows the result of one operation at a time, rather than a whole line of code at a time, and is designed to clarify initially confusing concepts like the difference between double and int numbers and the idea of calling methods and returning values from them. The goal is to give students a very visual display of how the computer treats their code, with the intention of building up their own skills in hand simulation of code by modeling exactly how they might imagine code running.)

Assignment: Geometer
(Turtle graphics provides a rich range of possibilities when it comes to learning simple looping syntax. Most of these geometric shapes can be drawn using counting loops, but many require nested loops or clever method decomposition)

Assignment: FractalTurtle
(Instead of teaching recursion using the typical functional examples like gcf() and fibonacci(), it is much more natural to present it as a way to draw fractals, shapes in which the whole shape is made up of several smaller copies of itself. Students are amazed by how a simple program can generate a complex result)

Project: MeshTurtle
(As a capstone project for the unit on basic Java syntax, this project contains a wide variety of sub-assignemnts that require the use of loops and recursion and a good understanding of method and class design)

2. Asteroids project: Understanding inheritance

SummaryThe concept of inheritance is emphasized in writing a game that requires students to take a class providing the basic capabilities of an animated, moving object and subclass it to produce all the entities needed in a complex game.
TopicsIssues involved in subclassing, such as inheritance, constructors, and overriding methods
AudienceAppropriate at any point after basic Java syntax has been taught; lessons that go along with this project are designed to use it to introduce inheritance at the same time that students build up their games.
DifficultyStudents in our computer club were able to make simple games with this engine after only a few weeks, but much more complex projects will be possible for more advanced students
StrengthsThe game engine is so general-purpose that it gives free rein to students' imagination - they can create almost any sort of game that they want
WeaknessesA student who doesn't want to challenge themself can get by without using any complex code at all.
DependenciseStudents must know about control structures; the project will introduce them to inheritance
VariantsI have seen students use this engine to create a networked multiplayer platform game; I myself use it for physics demos.


Project: Asteroids
(One of the hardest ideas to understand in introductory computer science is the idea of inheritance, and in particular, the idea that a subclass can not only add new abilities that never existed in the superclass, but also completely alter the behaviors inherited from the superclass. In the Asteroids game engine, the GameObject class has the capability to draw an animated image, move around on the screen, and vanish when it collides with another objects; this class can be subclassed and these behaviors overriden to produce all the objects needed for a complicated game)

3. RPG project: Working with arrays and strings

SummaryArrays, string parsing, and file reading are taught using a role-playing game engine that students gradually assemble.
TopicsArrays and strings
AudienceMost likely AP students or advanced introductory students
DifficultyHard, for my first-year students. Requires a fairly sophisticated level of understanding of arrays.
StrengthsStudents enjoy creating their own world using the editor and adding features such as magic and cut scenes.
WeaknessesIn order to get teh game to a playable state students need to work for a long time with no feedback but JUnit; this depletes their motivation.
DependenciesA solid understanding of arrays and strings, including string parsing.
VariantsStudents have used this engine to make computer board games, or more modern-looking RPGs.


Project: RPG
(A simple role-playing game like those of the 1980s requires students to learn how to store information in one- and two-dimensional arrays, and how to read in text from a file and parse Strings to extract numerical data. This project allows students to design the guts of the engine - a Level class that stores information on the terrain of a level and the creatures and items in it - but provides them with an engine that can take that data and turn it into a game playing on the screen. Careful scaffolding and extensive JUnit test cases guide students step by step through assembling the engine. Then, because at that point they themselves have assembled all the classes that describe the world of their RPG, they can be set free to add whatever features they wish, with guidelines available for several popular enhancements)

4. Vectorized: Using linked lists and abstract data types

SummaryLinked lists and abstract data types such as priority queues are needed to construct data structures representing a three dimensional world. The engine them allows exploration of and interaction with that world.
TopicsLinked lists, abstract data types
AudienceAPCS students
DifficultyHard, although the notes and test cases attempt to guide students as much as possible through the hard parts.
StrengthsIntroduces the basics of 3D games, without all the complexity that more modern systems like Open GL use. Students all enjoy creating and exploring their own worlds in the map editor.
WeaknessesIn order to get teh game to a playable state students need to work for a long time with no feedback but JUnit; this depletes their motivation.
DependenciesA very solid understanding of linked lists.
VariantsOne of my students last year turned this into a fully texture-mapped 3D game using JOGL.


Project: Vectorized
(The Vectorized project provides students with a first exposure to the programming problems involved in 3D, first-person games. A simplified 3D world design consists of polygonal rooms, each defined by the coordinates of their vertices on a map view, the floor and ceiling height, and what room each wall connects to. Students are responsible for implementing the classes that will describe this world, using a combination of linked lists and other data structures; the Vectorized engine can interface with their classes and produce the playable game. As in RPG, online notes and JUnit test cases guide students through the development of the engine. A featureful level editor allows students to enjoy the ability to create their own worlds for their game, and helps model for them how the data might be represented in their program.)

5. Full class notes for APCS A, making use of these projects

Lessons
(This website also contains notes on what was done every day in class, so that theoretically a student could work through the entire curriculum using only this website. Daily homework, and all the tests taken in the 2006 year, are also available here)