Syllabus

Duke University TIP Summer Studies Program 2010

Programming for Video Games
Duke University West Campus
Instructor: Yue-Ling Wong, Ph.D.
TA: Brent Driskill

Required Text:
None

Course Descrption and Objectives:
Computer games are an enormous entertainment industry. They have touched so many of our lives in different ways. To many game programmers, what makes game development fascinating is that it is not just about programming, but also a creative process. Programming a game requires programming skills, but computer programming is also an art. Simplicity and elegance in coding are issues that are beyond simply making a working program.

The purpose of this course is to introduce the basic concepts of computer programming and problem-solving in the context of computer games. While the course is Programming for Video Games, the concepts and techniques that students will learn are also core concepts in computer programming and basic problem solving strategies. These concepts and strategies are not limited to game programming, but also applicable to other application context. The programming environment used in this course is Flash/ActionScript 3.0. A reason for choosing Flash/ActionScript 3.0 is that ActionScript is a great language for making games as it supports easy incorporation of graphics and sound. As a result, Flash games are widely popular on the Web. In addition, the syntax of ActionScript 3.0 is very similar to other programming languages. Learning ActionScript 3.0 also lays a foundation for learning other programming languages.

The objectives for this course are that the student will:

Primary

  • Develop an understanding of programming concepts, syntax, and control structures
  • Demonstrate use of Flash ActionScript 3.0 to control animation
  • Demonstrate programming mouse and keyboard interaction
  • Demonstrate object oriented programming with classes and objects
  • Develop and implement a game project at the end of the course

Secondary

  • Demonstrate basic 2D animation skills
  • Demonstrate basic skills for vector graphic creation
  • Develop a historical perspective of the rise and evolution of computer games
  • Develop oral and written skills to communicate understanding of programming concepts and project ideas through presentations and project write-up
  • Develop skills in researching new technology relevant to game programming, and oral skills to communicate the findings through presentation

Assignments and Evaluation:

Practice is always the best way to learn programming. This course is presented in a workshop format. Hands-on practice is followed by a short lecture. The labs are designed to encourage implementation of additional features and creative game play beyond the basic labs. Some labs serve as small practice exercises with one or two topics to reinforce the lecture. Some labs are full games that integrate multiple topics. During the third week, each student will work individually or as part of a two-person team to complete a game, from idea and design to implementation and presentation.

Each student will maintain a publicly available Web page of daily journal to record his/her progress, thoughts, and ideas. It will also serve as a place to post completed assignments and project for other students to try and learn from. Students will also turn in the source code of the assignments and project to the instructor and TA for review.

The class may start with a short discussion topic relevant to computer games, for examples, history of computer games, pioneers in the game industry, and art and design aspects of computer games. Excerpts of TV episodes on computer games will be shown in class to give students a historical perspective of computer game development; some clips will be used to start a discussion while others will be run during the break time.

 

Schedule

Duke University TIP Summer Studies Program 2010

Programming for Video Games
Duke University West Campus
Instructor: Yue-Ling Wong, Ph.D.
TA: Brent Driskill

Schedule:

WEEK ONE

Monday: Overview of Programming for Games and Getting to Know Flash
See the completed files of today's lab »

  • Introductions
  • Review of curriculum, evaluation methods, and expectations
  • Establishment of class community guidelines
  • Discussion: Common elements in computer games
  • Film duing break: TV episode: Icons -- Donkey Kong
  • Topic: Flash workspace
  • Topic: Flash drawing tools
  • Lab: Draw items that will be used in the games to be programmed in this class
  • Topic: Symbols and shapes
  • Topic: Animation basics
  • Lab: Create animated items that will be used in the games to be programmed in this class

Tuesday: Mask and Programming Fundamentals
See the completed files of todays lab »

  • Topic: Mask
  • Topic: Symbols and instances
  • Topic: Variables, data types, operators, functions, if statements
  • Lab: Identify programming constructs (download the Flash file needed »)
  • Topic: trace() statement
  • Lab: Get started to write ActionScript
  • Topic: Properties of movieclip instances
  • Lab: Modify an existing game code using different properties of movieclip instances

Wednesday: Making Game Sprites Move, Controlling Game Sprites with Mouse, Generating Randomness, Detecting Collision, and Keeping Scores
See the completed files of today's lab »

  • Film during break: TV episode: Icons -- Nolan Bushnell (Pong game)
  • Discussion: What made Pong game so popular?
  • Topic: Parameters
  • Topic: Mouse event and frame event listener
  • Topic: 2D collision detection method 1
  • Topic: Generate randomness
  • Topic: Keeping scores
  • Topic: Displaying text and scores
  • Lab: Start a Pong game

Thursday: Controlling Game Sprites with Key Presses, Change Game Sprite Appearance, Modeling Gravity, and More on Collision Detection
See the completed files of today's lab »

  • Topic: Keyboard event listener
  • Lab: Finish up the Pong game (add keyboard interaction, use of functions to organize code)
  • Topic: Change game sprite appearance using multiple frames
  • Lab: Program hairstyle customization
  • Topic: 2D collision detection method 2
  • Topic: Modeling gravity
  • Lab: Start a side-scrolling platform game

Friday: Side-Scrolling Platform Game
See the completed files of today's lab »

  • Review: Modeling gravity, hitTestPoint(), and event listener code
  • Self-test: Modeling gravity, hitTestPoint(), and event listener code
  • Lab: Add gravity and hit test to the platform game
  • Topic: Wrapping and reuse of collectible items in the platform game
  • Lab: Finish up the game play part of coding for the side-scrolling platform game

Saturday: Finish up Platform Game
See the completed files of today's lab »

  • Film: TV episode: Icons -- Mario
  • Topic: Review of parameters
  • Topic: Implementing keyboard interaction that allows simultaneous key presses
  • Lab: Modify the platform game code to implement keyboard interaction that allows simultaneous key presses
  • Lab: Documentation of code, organization of code with functions, replacement of hard-coded values with variables for the side-scrolling platform game

WEEK TWO

Monday : Intro to OOP
See the completed files of today's lab »

  • Review of the evaulation of last week's platform game file
  • Topic: Documentation of code
  • Topic: Controlling motion of an animated character
  • Lab: Add a second ball to the Pong game without OOP
  • Topic: Classes and objects
  • Lab: Convert the previous Pong game into 3-ball Pong game with OOP (without score keeping)

Tuesday: Arrays and Loops, Linear Perspective in 3D Games
See the completed files of today's lab »

  • Review: OOP
  • Topic: static
  • Lab : Add score keeping to the 3-ball Pong game
  • Topic: Arrays
  • Topic: for loops
  • Lab: Add array and for loops in multi-ball Pong game
  • Lab: Pre-lab for tomorrow's 3d fly-through lab
  • Topic: How to reduce code duplication with loops
  • Lab: Start programming a 3D fly-through game
  • About group research and presentation of new technology relevant to game programming

Wednesday: Linear Perspective in 3D Games, Human Perception of Depth, and 3D Fly-through Game
See the completed files of today's lab »

  • Film: TV episode: Icons -- Final Fantasy
  • Review: Use of array and for loops to handle multiple objects
  • Review: The basic ideas and setup of our 3D fly-through game
  • Topic: Linear perspective
  • Topic: Human perception of depth
  • Topic: 3D fly-through lab follow-up
  • Lab: Finish up programming the 3D fly-through game
  • Group research project of new technology relevant to game programming (motion tracking, online multiplayer games, 3D API, and augmented reality)

Thursday: Working with Sound, and Inheritance
See the completed files of today's lab »

  • Discussion: Different usages of sound in computer games. Examples of good and bad use of sound in games.
  • Field Trip: Visit Physics class's roller coasters student projects
  • Topic: Inheritance
  • Lab: Add varieties to the 3D fly-through game by applying inheritance
  • Topic: Adding sound
  • Lab: Add sound to previous labs
  • Continue on group research project of new technology relevant to game programming and preparation for presentation

Friday: Research Project Presentation

  • Presentation: group research project presentation (Groups 1-3)
  • Individual meetings to review inheritance worksheet questions
  • Topic: The keyword super
  • Lab: Add a racer to the 3d fly-through lab using inheritance (no polymorphism yet)
  • Guest lecture: Attend physics class's lecture on projectile motion (The physics class attends the programming for video games lecture.)

Saturday: Polymorphism, Timer, and Generate Random Timing
See the completed files of today's lab »

  • Presentation: group research project presentation (Group 4)
  • Topic: Polymorphism
  • Lab: Revise the racer code in the 3d fly-through lab to using polymorphism
  • Topic: Timer and Timer events
  • Topic: Generate random timing with timer

WEEK THREE

Monday: Platform Game Revisited
See the completed files of today's lab »

  • Review: Timer and Timer events
  • Topic: Math class in ActionScript
  • Lab: Get ready for the programming activity with the physics class--program shooting a ball in straight line (without physics) given a speed and an angle
  • Lab: Convert the platform game using OOP, create classes for coin and box in the platform game
  • Lab: Add extra features to the 3d fly-through game using inheritance and polymorphism
  • Individual meetings: Term project idea discussion
  • Lab: Pair up with students from the physics class to program a projectile game (afternoon sesssion)

Tuesday: Working with Color and Filters

  • Individual meetings: Term project idea discussion
  • Topic: Access specifiers
  • Topic: Hexadecimal notation
  • Topic: Color representation on computer
  • Topic: Glow and Blur Filters
  • Lab: Add filters to a previous lab
  • Topic: Controlling color with ActionScript
  • Lab: Interactive hair coloring
  • Lab: Start final project

Wednesday: Toggling, Snapping, and Dragging
See the completed files of today's lab »

  • Topic: Game programming examples using other programming languages: Java, C++, and Objective C/iPhone SDK
  • Topic: Toggle
  • Lab: Add toggle to a previous lab, or create a simple file to show toggling a flashlight on and off
  • Topic: Dragging
  • Lab: Add snapping to a grid in a previous lab, or create a simple file to show dragging and snapping a battleship to a grid
  • Topic: Mask
  • Lab: Add draggable mask to a previous lab, or create a simple file to show draggable x-ray effect with mask
  • Lab: Continue working on final project

Thursday: Debugging, switch Statements, Scope of Variables, and Additional Topics by Demands

  • Topic: switch statement
  • Topic: Troubleshooting strategies and debugger
  • Topic: Scope of variables
  • Topic: Topics arising from student project needs. Possible topics may include 2D arrays, nested loops, tiling, shuffling, adding mouse and keyboard event handling in classes.
  • Lab: Continue working on final project

Friday: Project Presentations

  • Lab: Finishing up final project
  • Student presentation and demonstration of their final projects

Saturday: Parent Conferences and Departure