Factory for constructing different types of game objects.
More...
#include <gameobjectfactory.h>
|
static GameObject * | createPlayerTest () |
| Creates a test player object. More...
|
|
static GameObject * | createBow () |
| Creates a bow object. More...
|
|
static GameObject * | createArrow (int dx, int dy) |
| Creates an arrow object with specified dynamics. More...
|
|
static GameObject * | createEnemyWarrior () |
| Creates an enemy warrior object. More...
|
|
static GameObject * | createEnemyWarriorCustom (std::string path, int row, int col, float animationTime, int pos_x, int pos_y, int size_x, int size_y) |
| Creates a customized enemy warrior object with specific texture and animations. More...
|
|
static GameObject * | createTile1 () |
| Creates a basic tile object. More...
|
|
static GameObject * | createTileCustom (std::string path, Vec2 pos, Vec2 size, Vec2 sprite_size, Vec2 sprite_pos, Vec2 rc) |
| Creates a customized tile object with specific texture. More...
|
|
static GameObject * | createWallCustom (std::string path, Vec2 pos, Vec2 size, Vec2 sprite_size, Vec2 sprite_pos) |
| Creates a customized wall object with specific texture. More...
|
|
static GameObject * | createTableCustom (std::string path, Vec2 pos, Vec2 size, Vec2 sprite_size, Vec2 sprite_pos) |
| Creates a customized table object with specific texture. More...
|
|
static GameObject * | createKey () |
| Creates a key object. More...
|
|
static GameObject * | createCrosshair () |
| Creates a crosshair object. More...
|
|
Factory for constructing different types of game objects.
GameObjectFactory provides a set of static methods that initialize game objects, setting them up with initial configurations and returning them for use in the game.
Definition at line 21 of file gameobjectfactory.h.
◆ createArrow()
GameObject * GameObjectFactory::createArrow |
( |
int |
dx, |
|
|
int |
dy |
|
) |
| |
|
static |
Creates an arrow object with specified dynamics.
- Parameters
-
dx | The change in the arrow's x-position per update. |
dy | The change in the arrow's y-position per update. |
- Returns
- GameObject* Pointer to the newly created arrow object.
Definition at line 97 of file gameobjectfactory.cpp.
◆ createBow()
Creates a bow object.
- Returns
- GameObject* Pointer to the newly created bow object.
Definition at line 66 of file gameobjectfactory.cpp.
◆ createCrosshair()
GameObject * GameObjectFactory::createCrosshair |
( |
| ) |
|
|
static |
Creates a crosshair object.
- Returns
- GameObject* Pointer to the newly created crosshair object.
Definition at line 296 of file gameobjectfactory.cpp.
◆ createEnemyWarrior()
GameObject * GameObjectFactory::createEnemyWarrior |
( |
| ) |
|
|
static |
Creates an enemy warrior object.
- Returns
- GameObject* Pointer to the newly created enemy warrior object.
Definition at line 128 of file gameobjectfactory.cpp.
◆ createEnemyWarriorCustom()
GameObject * GameObjectFactory::createEnemyWarriorCustom |
( |
std::string |
path, |
|
|
int |
row, |
|
|
int |
col, |
|
|
float |
animationTime, |
|
|
int |
pos_x, |
|
|
int |
pos_y, |
|
|
int |
size_x, |
|
|
int |
size_y |
|
) |
| |
|
static |
Creates a customized enemy warrior object with specific texture and animations.
- Parameters
-
path | Texture file path. |
row | Number of rows in the sprite sheet. |
col | Number of columns in the sprite sheet. |
animationTime | Duration of each animation frame. |
pos_x | Initial x-position of the enemy. |
pos_y | Initial y-position of the enemy. |
size_x | Width of the enemy in the game world. |
size_y | Height of the enemy in the game world. |
- Returns
- GameObject* Pointer to the newly created customized enemy warrior.
Definition at line 160 of file gameobjectfactory.cpp.
◆ createKey()
Creates a key object.
- Returns
- GameObject* Pointer to the newly created key object.
Definition at line 275 of file gameobjectfactory.cpp.
◆ createPlayerTest()
GameObject * GameObjectFactory::createPlayerTest |
( |
| ) |
|
|
static |
Creates a test player object.
- Returns
- GameObject* Pointer to the newly created player object.
Definition at line 20 of file gameobjectfactory.cpp.
◆ createTableCustom()
Creates a customized table object with specific texture.
- Parameters
-
path | Texture file path. |
pos | Position of the table in the game world. |
size | Size of the table. |
sprite_size | Size of the table on the sprite sheet. |
sprite_pos | Position of the table on the sprite sheet. |
- Returns
- GameObject* Pointer to the newly created customized table.
Definition at line 251 of file gameobjectfactory.cpp.
◆ createTile1()
Creates a basic tile object.
- Returns
- GameObject* Pointer to the newly created tile object.
Definition at line 193 of file gameobjectfactory.cpp.
◆ createTileCustom()
Creates a customized tile object with specific texture.
- Parameters
-
path | Texture file path. |
pos | Position of the tile in the game world. |
size | Size of the tile. |
sprite_size | Size of the tile on the sprite sheet. |
sprite_pos | Position of the tile on the sprite sheet. |
- Returns
- GameObject* Pointer to the newly created customized tile.
Definition at line 209 of file gameobjectfactory.cpp.
◆ createWallCustom()
Creates a customized wall object with specific texture.
- Parameters
-
path | Texture file path. |
pos | Position of the wall in the game world. |
size | Size of the wall. |
sprite_size | Size of the wall on the sprite sheet. |
sprite_pos | Position of the wall on the sprite sheet. |
- Returns
- GameObject* Pointer to the newly created customized wall.
Definition at line 228 of file gameobjectfactory.cpp.
The documentation for this class was generated from the following files: