Example #1
0
 public MobileSprite(Texture2D texture, Vector2 position, Level level)
     : base(texture, position, level)
 {
     this.readyToTurn = false;
     this.rotation = 0;
     this.velocity = 0;
 }
Example #2
0
        public Sprite(Texture2D texture, Vector2 position, Level level)
        {
            this.texture = texture;
            this.position = position;
            this.level = level;
            this.IsActive = true;

            this.origin = new Vector2(texture.Width / 2, texture.Height / 2);
        }
Example #3
0
 public Ghost(Texture2D[] textures, Vector2 position, Level level)
     : base(textures[0], position, level)
 {
     this.nextDirection = -Vector2.UnitY;
     this.velocity = 100;
     this.usual = textures[0];
     this.vulnerable = textures[1];
     this.rand = new Random(unchecked((int)DateTime.Now.Ticks));
     Thread.Sleep(1); // Pour s'assurer que le rand soit aléatoire
 }
Example #4
0
 public Pacman(Texture2D texture, Level level)
     : base(texture, level.StartingPosition, level)
 {
     velocity = 100;
 }
Example #5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            this.level = new Level();
            this.mobileSprites = new List<MobileSprite>();
            this.gums = new List<Gum>();

            for (int y = 0; y < this.level.Height; y++)
            {
                for (int x = 0; x < this.level.Width; x++)
                {
                    if (this.level.Map[y, x] == 0 && (y != 9 || (x != 8 && x != 9 && x != 10)))
                        this.gums.Add(new Gum(new Vector2(x * Level.TILE_WIDTH, y * Level.TILE_HEIGHT), false));
                }
            }

            base.Initialize();
        }