How to add a new Guard sprite

Coordinator
Dec 3, 2014 at 7:24 AM
Edited Dec 3, 2014 at 7:50 AM
This is a simple tutorial for adding a new sprite Guard, is valid and teste ONLY for PoP.net file level structure,
for setting it look into Application.config and set it to false.

<add key="LEVEL_APOPLEXY" value="false"/>

STEPS


1) Clone the "guard_sequence.xml" in Content\Sequence\dos and rename it "guard2_sequence.xml" set the property of the "build action" file to "None" and copy if newer.

2) In the file "guard2_sequence.xml" replace all tag "config_type" with the new "CONFIG_sprite_guard2". See point 3.

3) Open the Application.config files and add :
<!-- GUARD_SPRITE 2 --> <add key="CONFIG_sprite_guard2" value="sprites/guard/guard_flash/"/>
This tell to load the texture from this path.

4) Add to Content Solution the news texture Add "sprite\guard\guard_flash"

5) Add a new enum value into the SpriteType found in Enumeration.cs, add "guard2"

6) Add the above lines into Room.cs routing LoadTilesPoPnet()
                    case Enumeration.SpriteType.guard2:
                        xGuard = (x - 1) * Tile.WIDTH + Player.SPRITE_SIZE_X;
                        //int yGuard = (y + 1) * (Tile.HEIGHT - Sprite.PLAYER_STAND_FLOOR_PEN - RoomNew.BOTTOM_BORDER + RoomNew.TOP_BORDER);
                        yGuard = ((y + 1) * (Tile.HEIGHT)) - Sprite.SPRITE_SIZE_Y + Room.TOP_BORDER;
                        g = new Guard(this, new Vector2(xGuard, yGuard), maze.graphicsDevice, r.columns[ix].spriteEffect, "guard2_sequence.xml");
                        level.sprites.Add(g);
                        break;
7) to be complete...