Arcade Shooter
Level.h
1 
2 /* .oooooo..o .o. ooo ooooo ooooooooo. ooooo oooooooooooo
3  d8P' `Y8 .888. `88. .888' `888 `Y88. `888' `888' `8
4  Y88bo. .8"888. 888b d'888 888 .d88' 888 888
5  `"Y8888o. .8' `888. 8 Y88. .P 888 888ooo88P' 888 888oooo8
6  `"Y88b .88ooo8888. 8 `888' 888 888 888 888 "
7  oo .d8P .8' `888. 8 Y 888 888 888 o 888 o
8  8""88888P' o88o o8888o o8o o888o o888o o888ooooood8 o888ooooood8
9 
10  Sample © 2017 - Shuriken Studios LLC */
11 
12 #pragma once
13 
17 
18 namespace Sample
19 {
20  class GameplayScreen;
21  class PlayerShip;
22  class PowerUp;
23 
24 
27  {
28 
29  public:
30 
33  Level(GameplayScreen *pGameplayScreen);
34  virtual ~Level() { }
35 
39  virtual void LoadContent(ResourceManager *pResourceManager);
40 
44  virtual void HandleInput(const InputState *pInput);
45 
49  virtual void Update(const GameTime *pGameTime);
50 
53  virtual void Draw(SpriteBatch *pSpriteBatch);
54 
57  virtual void SpawnPowerUp(const Vector2 position);
58 
62  virtual void SpawnExplosion(const Vector2 position, const float scale = 1);
63 
66  virtual void BeginCompletionCountdown() { m_finalCountdownBegan = true; }
67 
69  virtual void Complete();
70 
73  virtual ParticleManager *GetParticleManager() const;
74 
77  virtual ScreenManager *GetScreenManager() const;
78 
84  virtual void AddPlayerShip(PlayerShip *pPlayerShip);
85 
88  virtual uint8_t GetPlayerCount() { return m_playerShips.size(); }
89 
90 
91  private:
92 
93  GameplayScreen *m_pGameplayScreen = nullptr;
94 
95  bool m_isOver;
96 
97  double m_finalCountdownSeconds;
98  bool m_finalCountdownBegan;
99 
100  std::vector<PlayerShip *> m_playerShips;
101  std::vector<PlayerShip *>::iterator m_playerShipIt;
102 
103  std::vector<PowerUp *> m_powerUps;
104  std::vector<PowerUp *>::iterator m_powerUpIt;
105 
106  std::vector<Explosion *> m_explosions;
107  std::vector<Explosion *>::iterator m_explosionIt;
108 
109  std::vector<ProjectilePool *> m_pDrawPools;
110  std::vector<ProjectilePool *>::iterator m_pDrawPoolIt;
111 
112  };
113 }
Used to recycle projectiles.
Definition: ProjectilePool.h:20
Sample is a sample game to use as a template for using Katana Engine and Shooter Library.
Definition: Background.cpp:14
virtual ScreenManager * GetScreenManager() const
Gets a pointer to the ScreenManager, for managing game screens.
Definition: Level.cpp:287
The gameplay screen for the sample game.
Definition: GameplayScreen.h:18
Base class for all shooter levels.
Definition: Level.h:21
virtual ParticleManager * GetParticleManager() const
Gets a pointer to the ParticleManager, for managing particle effects.
Definition: Level.cpp:281
virtual void SpawnPowerUp(const Vector2 position)
Adds a power up to the level.
Definition: Level.cpp:248
virtual void Update(const GameTime *pGameTime)
Called when the game has determined that game logic needs to be processed.
Base class for all objects that will be updated and rendered on a GameplayScreen. ...
Definition: GameObject.h:29
virtual uint8_t GetPlayerCount()
Gets the current number of player ships playing the level.
Definition: Level.h:88
virtual void Draw(SpriteBatch *pSpriteBatch)
Called when the game determines it is time to draw a frame.
Base class for shooter levels.
Definition: Level.h:26
virtual void HandleInput(const InputState *pInput)
Called when the game has determined that player input needs to be processed.
Definition: Level.cpp:157
virtual void BeginCompletionCountdown()
Begins the count down to the end of the mission.
Definition: Level.h:66
virtual void LoadContent(ResourceManager *pResourceManager)
Called when resources need to be loaded.
virtual void Complete()
Should be called when the victory conditions are met for the level.
Definition: Level.cpp:271
virtual void SpawnExplosion(const Vector2 position, const float scale=1)
Adds an explosion to the level.
Definition: Level.cpp:256
Base class for all projectile types.
Definition: Projectile.h:20
Class for player ships.
Definition: PlayerShip.h:19
virtual void AddPlayerShip(PlayerShip *pPlayerShip)
Adds a player ship to the level&#39;s game objects.
Definition: Level.cpp:241