Game Programming Class6

esse quam videri
Revision as of 17:12, 3 March 2015 by Jeff (talk | contribs) (PacMan Class Simplified and Generalized)
Jump to: navigation, search


c# Box2D


Separation of Concerns

Single Responsibility Principle

PacMan Class Simplified and Generalized

<csharp> public enum PacManState { Spawning, Still, Chomping, SuperPacMan }

   public class PacMan 
       protected PacManState _state;
       public PacManState State
           get { return _state; }
               if (_state != value)
                   this.Log(string.Format("{0} was: {1} now {2}", this.ToString(), _state, value));
                   _state = value;
       public PacMan()
           //Set default state will call notify so make sure this.Ghosts is intitialized first
           this.State = PacManState.Still;
       //Extra method for logging state change
       public virtual void Log(string s)


Simple Animation

what extra fields do we need for animation?

Platformer Example

Show platformer starter kit

simple and elegant but not that flexible

Animation Classes

Way too many classes for me to type here

  • PacMan States
  • PacMan Dying Animation
  • PacMan Eating

IntroAnimation Project

Complicated but flexible

  • DrawableAnimatableSprite.cs
  • CelAnimationManager.cs


Shooting Game

  • must use game components
  • must be multiplayer (both on keyboard or multiple game pads) don't use networking
  • must be able to shoot at each other or work together to shoot enemies
  • include shot manager and or shot manager