Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
SpaceFighter.cpp
Go to the documentation of this file.
1
2#include "KatanaEngine.h"
3#include "SpaceFighter.h"
4#include "MainMenuScreen.h"
5#include "Projectile.h"
6#include "Explosion.h"
7
8using namespace KatanaEngine;
9
10
12{
13 SetScreenResolution(1600, 900);
14 SetFullScreen(false);
15
17
18 SetResourceDirectory("..\\SpaceFighter\\Content\\");
19
20 // Font for displaying the frame rate
21 Font::SetLoadSize(18, true);
22 Font *pFont = GetResourceManager()->Load<Font>("Fonts\\Arialbd.ttf", false);
24}
25
26
28{
29 // Load static resources
30 // Note: Every level will have these resources, so let's just load them once.
31 Projectile::SetTexture(resourceManager.Load<Texture>("Textures\\Bullet.png"));
32
34
36}
37
38
40{
41 Game::Draw(spriteBatch);
42
44}
Represents a font or true-type font.
Definition Font.h:21
static void SetLoadSize(const int size, const bool restore=false)
Specifies the size of the font when loaded.
Definition Font.cpp:26
virtual void SetResourceDirectory(const std::string &path)
Sets the location of the directory where the game's resources are stored.
Definition Game.h:97
virtual void ResetGameTime()
Resets the game's timing values.
Definition Game.h:120
virtual void DisplayFrameRate()
Displays the game's current frame rate.
Definition Game.cpp:195
virtual void SetFrameCounterFont(Font *pFont)
Sets the font for the frame counter.
Definition Game.h:105
virtual ScreenManager * GetScreenManager() const
Gets a pointer to the ScreenManager, for managing game screens.
Definition Game.h:56
static void SetScreenResolution(int width, int height)
Sets the screen resolution.
Definition Game.h:88
virtual void InitializeScreenManager()
Initializes the game's ScreenManager.
Definition Game.h:108
virtual void Draw(SpriteBatch &spriteBatch)
Called when the game determines it is time to draw a frame.
Definition Game.cpp:78
virtual ResourceManager * GetResourceManager() const
Gets a pointer to the ResourceManager, for loading and managing resources.
Definition Game.h:52
virtual void SetFullScreen(bool isFullScreen)
Sets the game to display in fullscreen mode.
Definition Game.h:114
Loads and manages the lifespan of objects from external files.
T * Load(const std::string &path, const bool cache=true, const bool appendContentPath=true)
Load and manage a resource.
virtual void AddScreen(Screen *pScreen)
Add a screen to be managed.
Enables a group of sprites to be drawn using the same settings.
Definition SpriteBatch.h:48
Represents a 2D grid of texels.
Definition Texture.h:21
The main menu screen for the game.
static void SetTexture(Texture *pTexture)
Set the texture that will be used to render the projectile.
Definition Projectile.h:19
virtual void Draw(SpriteBatch &spriteBatch)
Called when the game determines it is time to draw a frame.
SpaceFighter()
Initializes a new instance of the SpaceFighter game.
virtual void LoadContent(ResourceManager &resourceManager)
Called when resources need to be loaded.
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition Animation.cpp:18