Example #1
0
        /// <summary>
        /// Konstruktor dla odpalonej rakiety
        /// </summary>
        /// <param name="content">XNA Content</param>
        /// <param name="rectangle">Prostokat reprezentujacy obiekt na mapie</param>
        /// <param name="x">indeks x na mapie obiektów</param>
        /// <param name="y">indeks y na mapie obiektów</param>
        /// <param name="direction">kierunek poruszania odpalonej rakiety</param>
        public Racket(ContentManager content, Rectangle rectangle, int x, int y, Game.direction direction)
            : base(content, rectangle, x, y)
        {
            this.points = 50;
            this.is_fired = true;
            this.direction = direction;
            this.TypeTag = Map.ElementType.RACKET;

            switch (direction)
            {
                case Game.direction.down:
                    texture = content.Load<Texture2D>("Textures\\racket_down");
                    break;
                case Game.direction.up:
                    texture = content.Load<Texture2D>("Textures\\racket_up");
                    break;
                case Game.direction.left:
                    texture = content.Load<Texture2D>("Textures\\racket_left");
                    break;
                case Game.direction.right:
                    texture = content.Load<Texture2D>("Textures\\racket_right");
                    break;

            }
        }
Example #2
0
        /// <summary>
        /// Konstruktor dla odpalonej rakiety
        /// </summary>
        /// <param name="content">XNA Content</param>
        /// <param name="rectangle">Prostokat reprezentujacy obiekt na mapie</param>
        /// <param name="x">indeks x na mapie obiektów</param>
        /// <param name="y">indeks y na mapie obiektów</param>
        /// <param name="direction">kierunek poruszania odpalonej rakiety</param>
        public Racket(ContentManager content, Rectangle rectangle, int x, int y, Game.direction direction)
            : base(content, rectangle, x, y)
        {
            this.points    = 50;
            this.is_fired  = true;
            this.direction = direction;
            this.TypeTag   = Map.ElementType.RACKET;

            switch (direction)
            {
            case Game.direction.down:
                texture = content.Load <Texture2D>("Textures\\racket_down");
                break;

            case Game.direction.up:
                texture = content.Load <Texture2D>("Textures\\racket_up");
                break;

            case Game.direction.left:
                texture = content.Load <Texture2D>("Textures\\racket_left");
                break;

            case Game.direction.right:
                texture = content.Load <Texture2D>("Textures\\racket_right");
                break;
            }
        }
Example #3
0
 /// <summary>
 /// Poruszanie - ustalenie aktualnego kierunku poruszania
 /// </summary>
 /// <param name="direction">kierunek poruszania</param>
 public void Move(Game.direction direction)
 {
     if (direction != Game.direction.none)
     {
         view_direction = direction;
     }
     current_direction = direction;
 }
Example #4
0
 /// <summary>
 /// Poruszanie - ustalenie aktualnego kierunku poruszania
 /// </summary>
 /// <param name="direction">kierunek poruszania</param>
 public void Move(Game.direction direction)
 {
     if (direction != Game.direction.none)
         view_direction = direction;
     current_direction = direction;
 }
Example #5
0
 /// <summary>
 /// Zmien kierunek poruszania/patrzenia
 /// </summary>
 /// <param name="game_map">mapa obiektów</param>
 public void changeDirectionToNext(Map.Map game_map)
 {
     current_direction = (Game.direction)(((int)current_direction + 1) % 3 + 1);
     view_direction = current_direction;
     LoadCurrentTexture(game_map);
 }
Example #6
0
 /// <summary>
 /// Zmien kierunek poruszania/patrzenia
 /// </summary>
 /// <param name="game_map">mapa obiektów</param>
 public void changeDirectionToNext(Map.Map game_map)
 {
     current_direction = (Game.direction)(((int)current_direction + 1) % 3 + 1);
     view_direction    = current_direction;
     LoadCurrentTexture(game_map);
 }
Example #7
0
 /// <summary>
 /// Poruszanie bohaterem w określoną stronę
 /// </summary>
 /// <param name="dir">kierunek chodzenia</param>
 public void MoveVandal(Game.direction dir)
 {
     vandal.Move(dir);
 }