コード例 #1
0
ファイル: Explorer.cs プロジェクト: Bob-Thomas/Pyramid-Panic
 //constructor
 public Explorer(PyramidPanic game,Vector2 position,float speed)
 {
     this.initialize();
     this.game = game;
     this.startpos = position;
     this.texture = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Player\Explorer");
     this.CollisionText = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Player\blokje");
     this.position = position;
     this.rectangle = new Rectangle((int)this.position.X + 16, (int)this.position.Y + 16, texture.Width/4, texture.Height);
     this.CollisionRect = new Rectangle((int)this.position.X, (int)this.position.Y, texture.Width/4, texture.Height);
     this.speed = speed;
     this.state = new Idle(this);
 }
コード例 #2
0
 //Constructor
 public MummyChase(Mummy mummy)
     : base(mummy)
 {
     this.mummy = mummy;
     this.i = 0;
     this.chaseState = new Dictionary<string, AnimatedSprite>()
     {
         { "up", this.mummy.MummyUp }, //new MummyUp(mummy)},
         { "down", this.mummy.MummyDown }, //new MummyDown(mummy)},
         { "left", this.mummy.MummyLeft }, //new MummyLeft(mummy)},
         { "right", this.mummy.MummyRight } //new MummyRight(mummy)}
     };
     /* Default waarde up */
     this.state = this.chaseState["up"];
 }
コード例 #3
0
 //Constructor
 public Explorer(PyramidPanic game, Vector2 position, float speed)
 {
     this.game = game;
     this.position = position;
     this.speed = speed;
     this.texture = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Explorer\Explorer");
     this.rectangle = new Rectangle((int)position.X + 16,
                                    (int)position.Y + 16,
                                    this.texture.Width/4,
                                    this.texture.Height);
     this.collisionText = this.game.Content.Load<Texture2D>(@"PlaySceneAssets\Explorer\collisionTexture");
     this.collisionRectangle = new Rectangle((int)position.X,
                                             (int)position.Y,
                                             32,
                                             32);
     this.color = Color.White;
     this.state = new Idle(this);
 }