Exemple #1
0
        public AEnnemy(SpriteManager s, EOrientation e)
            : base(s, e)
        {
            state_ = EState.ALIVE;

            deadTimer_ = TimeSpan.Zero;

            random_ = new Random();

            freePath_ = new Dictionary<EOrientation, bool>();

            freePath_.Add(EOrientation.DOWN, false);
            freePath_.Add(EOrientation.UP, false);
            freePath_.Add(EOrientation.RIGHT, false);
            freePath_.Add(EOrientation.LEFT, false);
            freePath_.Add(EOrientation.NEUTRAL, false);

            stateOrientationToSprite_ = new Dictionary<Tuple<EState, EOrientation>, SpriteManager.ESprite>();

            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD, ACharacter.EOrientation.UP), SpriteManager.ESprite.EYESUP);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD, ACharacter.EOrientation.DOWN), SpriteManager.ESprite.EYESDOWN);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD, ACharacter.EOrientation.LEFT), SpriteManager.ESprite.EYESLEFT);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD, ACharacter.EOrientation.RIGHT), SpriteManager.ESprite.EYESRIGHT);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD, ACharacter.EOrientation.NEUTRAL), SpriteManager.ESprite.EYESDOWN);

            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD_ENDING, ACharacter.EOrientation.UP), SpriteManager.ESprite.DEADENDINGUP);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD_ENDING, ACharacter.EOrientation.DOWN), SpriteManager.ESprite.DEADENDINGDOWN);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD_ENDING, ACharacter.EOrientation.LEFT), SpriteManager.ESprite.DEADENDINGLEFT);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD_ENDING, ACharacter.EOrientation.RIGHT), SpriteManager.ESprite.DEADENDINGRIGHT);
            stateOrientationToSprite_.Add(Tuple.Create(EState.DEAD_ENDING, ACharacter.EOrientation.NEUTRAL), SpriteManager.ESprite.DEADENDINGDOWN);
        }
Exemple #2
0
 public Sprite(Vector2 pos_, SpriteManager.ESprite id_)
 {
     id = id_;
     pos = pos_;
     drawn = false;
     step = 0;
 }
Exemple #3
0
 //Random random_;
 public Blinky(SpriteManager s)
     : base(s, EOrientation.LEFT)
 {
     orientationToSprite_.Add(EOrientation.LEFT, SpriteManager.ESprite.BLINKYLEFT);
     orientationToSprite_.Add(EOrientation.RIGHT, SpriteManager.ESprite.BLINKYRIGHT);
     orientationToSprite_.Add(EOrientation.UP, SpriteManager.ESprite.BLINKYUP);
     orientationToSprite_.Add(EOrientation.DOWN, SpriteManager.ESprite.BLINKYDOWN);
     orientationToSprite_.Add(EOrientation.NEUTRAL, SpriteManager.ESprite.BLINKYLEFT);
     position_ = new Vector2(121, 140);
     sprite_ = new Sprite(position_, orientationToSprite_[orientation_]);
     orientation_ = EOrientation.RIGHT;
 }
Exemple #4
0
 public Hero(SpriteManager s)
     : base(s, EOrientation.NEUTRAL)
 {
     orientationToSprite_.Add(EOrientation.LEFT, SpriteManager.ESprite.PACLEFT);
     orientationToSprite_.Add(EOrientation.RIGHT, SpriteManager.ESprite.PACRIGHT);
     orientationToSprite_.Add(EOrientation.UP, SpriteManager.ESprite.PACUP);
     orientationToSprite_.Add(EOrientation.DOWN, SpriteManager.ESprite.PACDOWN);
     orientationToSprite_.Add(EOrientation.NEUTRAL, SpriteManager.ESprite.PACNEUTRAL);
     position_ = new Vector2(113, 92);
     sprite_ = new Sprite(position_, orientationToSprite_[orientation_]);
     power = new TimeSpan(0);
 }
Exemple #5
0
 public Clyde(SpriteManager s)
     : base(s, EOrientation.DOWN)
 {
     orientationToSprite_.Add(EOrientation.LEFT, SpriteManager.ESprite.CLYDELEFT);
     orientationToSprite_.Add(EOrientation.RIGHT, SpriteManager.ESprite.CLYDERIGHT);
     orientationToSprite_.Add(EOrientation.UP, SpriteManager.ESprite.CLYDEUP);
     orientationToSprite_.Add(EOrientation.DOWN, SpriteManager.ESprite.CLYDEDOWN);
     orientationToSprite_.Add(EOrientation.NEUTRAL, SpriteManager.ESprite.CLYDEDOWN);
     position_ = new Vector2(137, 140);
     sprite_ = new Sprite(position_, orientationToSprite_[orientation_]);
     orientation_ = EOrientation.RIGHT;
     intersected = false;
 }
Exemple #6
0
 public ACharacter(SpriteManager s, EOrientation e)
 {
     orientation_ = EOrientation.NEUTRAL;
     totalElapsedTime_ = new TimeSpan();
     timePerFrame_ = new TimeSpan(1000000);
     blocked_ = true;
     orientationToSprite_ = new Dictionary<EOrientation, SpriteManager.ESprite>();
     spriteManager_ = s;
     atIntersection_ = false;
     hitBox_ = new Rectangle((int)position_.X + 4, (int)position_.Y + 4, 8, 8);
     destination_ = e;
     speedPerSec_ = 60;
 }
Exemple #7
0
 public Pinky(SpriteManager s)
     : base(s, EOrientation.RIGHT)
 {
     orientationToSprite_.Add(EOrientation.LEFT, SpriteManager.ESprite.PINKYLEFT);
     orientationToSprite_.Add(EOrientation.RIGHT, SpriteManager.ESprite.PINKYRIGHT);
     orientationToSprite_.Add(EOrientation.UP, SpriteManager.ESprite.PINKYUP);
     orientationToSprite_.Add(EOrientation.DOWN, SpriteManager.ESprite.PINKYDOWN);
     orientationToSprite_.Add(EOrientation.NEUTRAL, SpriteManager.ESprite.PINKYRIGHT);
     position_ = new Vector2(105, 140);
     sprite_ = new Sprite(position_, orientationToSprite_[orientation_]);
     orientation_ = EOrientation.LEFT;
     intersected = false;
 }
Exemple #8
0
 public SceneManager(SpriteManager spm, SoundManager som)
 {
     scenes = new Dictionary<EScene,AScene>();
     scenes.Add(EScene.LEVEL, new Play(this, spm, som));
     scenes.Add(EScene.PAUSE, new Pause(this, spm, som));
     scenes.Add(EScene.LEGEND, new Legend(this, spm, som));
     scenes.Add(EScene.TITLE, new TitleScreen(this, spm, som));
     scenes.Add(EScene.WIN, new WinScreen(this, spm, som));
     spm_ = spm;
     som_ = som;
     activateScene(EScene.TITLE);
     exit_ = false;
     lastState = GamePad.GetState(PlayerIndex.One);
     currentState = GamePad.GetState(PlayerIndex.One);
 }
Exemple #9
0
 public WinScreen(SceneManager sm, SpriteManager spm, SoundManager som)
     : base(sm, spm, som)
 {
     lastState = GamePad.GetState(PlayerIndex.One);
     sm_ = sm;
 }
Exemple #10
0
 public Legend(SceneManager scm, SpriteManager spm, SoundManager som)
     : base(scm, spm, som)
 {
     lastState = GamePad.GetState(PlayerIndex.One);
     textPos = Vector2.Zero;
 }
Exemple #11
0
 public TitleScreen(SceneManager sm, SpriteManager spm_, SoundManager som)
     : base(sm, spm_, som)
 {
     lastState = GamePad.GetState(PlayerIndex.One);
     som_.play(SoundManager.ESound.BEGIN);
 }
Exemple #12
0
 public Play(SceneManager sm, SpriteManager spm, SoundManager som)
     : base(sm, spm, som)
 {
     load();
 }
Exemple #13
0
 public void drawMapScaled(uint x, uint y, SpriteManager.ESprite b)
 {
     if (!heroCentered_)
     {
         tmpPos_.X = (x * 8 - 4) * zoomScale_ + ((graphicsDevice_.Viewport.Width + blackRec_.Width) / 2) - (backgroundRec_.Width / 2) * zoomScale_;
         tmpPos_.Y = (y * 8 + 20) * zoomScale_ + (graphicsDevice_.Viewport.Height / 2) - (backgroundRec_.Height / 2) * zoomScale_;
     }
     else
     {
         tmpPos_.X = (x * 8 - 4) * zoomScale_ + ((graphicsDevice_.Viewport.Width + blackRec_.Width) / 2) - heroPos_.X * zoomScale_;
         tmpPos_.Y = (y * 8 + 20) * zoomScale_ + (graphicsDevice_.Viewport.Height / 2) - heroPos_.Y * zoomScale_;
     }
     spriteBatch_.Draw(spriteTex_, tmpPos_, spriteRec_[b][0], Color.White, 0f, Vector2.Zero, zoomScale_, SpriteEffects.None, 0f);
 }
Exemple #14
0
 public Pause(SceneManager sm, SpriteManager spm, SoundManager som)
     : base(sm, spm, som)
 {
     recent = false;
 }
Exemple #15
0
 public AScene(SceneManager scm, SpriteManager spm, SoundManager som)
 {
     scm_ = scm;
     spm_ = spm;
     som_ = som;
 }
Exemple #16
0
 public Legend(SceneManager scm, SpriteManager spm, SoundManager som)
     : base(scm, spm, som)
 {
     lastState = GamePad.GetState(PlayerIndex.One);
     textPos   = Vector2.Zero;
 }