Introduction to Game Programming using Processing heading

Back to main page Main Page / Demo Programs

Demo Programs

The demo programs are tightly related to the book content (and are usually based on it), but connect and integrate content from different book chapters and demonstrate its meaningful application in concrete contexts. They are complete programs that are typically larger in size than the book's brief code examples.

Demo programs show, for instance, the use of real-time controls in a simple two-player action game such as Space Invaders, classes for bricks and a paddle for a BreakOut-style game, and the program structure of a basic Frogger-style game.

The programs provide entry points for readers who are motivated by concrete applications. The programs can serve as starting points for readers to modify and experiment with code and also as starting points for readers' own projects.

Note that the categories are here ordered roughly by sophistication or complexity. The demos in Classes, for example, are more advanced than in Functions, or in Variables and Parameters. There are also many overlaps between categories, of course. Some of the programs are provided in several versions, for instance, first without using classes, and then using classes (in Controls), or first without interaction, and then with (mouse) interaction (in Mouse Interaction).

Game demos are in the categories Classes, Controls and Tiling.

Intro, Day 1

Pixelcoord screenshot Pointer Reticule screenshot

Variables and Parameters

Variables 101 screenshot More Variables screenshot Pass Test int screenshot Return Value screenshot A Toaster screenshot Eyes Trippy screenshot Wonky Eyes screenshot Enum Demo screenshot

Casting

Dice6 screenshot

Conditionals and Decisions

Hover Over screenshot Psycho Mouse screenshot

While Loop

Blue Rects screenshot Grid Cell Highlight screenshot Selection Box screenshot

For Loop

Colour Transition screenshot Size Transition screenshot Green while and for screenshot

Functions

Bird screenshot Bubble screenshot Cake Function screenshot Moving Cat screenshot Moving Cat Function screenshot Target screenshot

Arrays and Arraylists

Arrays, Day 1 screenshot Temperature Array screenshot Find Letter screenshot Four Letter screenshot Array List Example screenshot Space Invaders-style game screenshot Starfield screenshot Blackjack ArrayLists screenshot

Vectors

Follow Reticle screenshot Vectors Mouse Circle screenshot Vector Snow screenshot

Classes

Alien with Class screenshot Button Demo screenshot Classes are Here screenshot Train with Class screenshot Trains with Class and Array screenshot Train Waggons screenshot Train Waggons Smoke screenshot Bricks Ball Classes screenshot Frogger Classes screenshot Sideways Ducks screenshot BreakOut Classes screenshot BreakOut Classes Inheritance screenshot

Text and Fonts

Text Blobs screenshot Letters Reveal screenshot Matrix 2 screenshot Airport Font Display screenshot Fonty McFontface screenshot Fonty McFontface Proportional screenshot

Load and Save

Text Edit screenshot

Images

Pic to Text screenshot

Time and Timefix

Truck Timefixed screenshot Truck Timefixed Classes screenshot Timefixed Elephant Class screenshot Vector Timefixed screenshot Stopwatch screenshot Timer screenshot Ellipses vs Rectangles Ticks screenshot Framerate Test screenshot Uptimer screenshot Uptimer 2 screenshot

Animation

Skating Elephant screenshot

Movement

Two Trains screenshot Six Trains with Arrays and Loop screenshot

Collision Detection

Rects Collision screenshot Click Randomise screenshot Distance Comparison screenshot Shoot to Mouse screenshot Pinball screenshot

Mouse Interaction

Character Sheet screenshot Character Sheet Interactive screenshot Dino Eyes screenshot

Controls

Immediate Movement screenshot Immediate Movement Classes screenshot Continuous Movement Classes screenshot Continuous Movement Classes Multiplayer screenshot Beam Classes screenshot Game State screenshot No Man's Lane screenshot

Libraries and Audio

Organ Simulator screenshot

Tiling

Level Loader screenshot Tiled Level screenshot Tiled Level, Really screenshot Tiled Structure screenshot Tiled Platformer Demo screenshot

Recursion

Minibrowser 3 screenshot Nurtle 4 screenshot

AI

Basic Blackjack screenshot Guard Stationary screenshot

Disk elephant symbolHand-written note, download all demo programs in a single file (1.5 MB)

Code Examples

Chapter 2, Code Example 2 screenshot Chapter 15, Code Example 2 screenshot Chapter 29, Code Example 6 screenshot More symbol

Buggy Code

Hello Buggy image Cat Mask image Random Quad Snowflakes image More symbol

Online Resources

The Coding Train (Daniel Shiffman): Learning Processing from the ground up, YouTube tutorials website screenshot Sprite Land website screenshot Vectors & Dot Product • Math for Game Devs [Part 1] on YouTube website screenshot More symbol