A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.

Dependencies:   mbed MotionSensor

Embed: (wiki syntax)

« Back to documentation index

RoomEngine Class Reference

RoomEngine Class Reference

RoomEngine Class. More...

#include <RoomEngine.h>

Public Member Functions

 RoomEngine (float global_contrast)
 Constructor.
 ~RoomEngine ()
 Destructor.
void load (Player *current_player, Room *current_room)
 loads the current player and room into the engine
void entrance_scene (N5110 &lcd, Gamepad &gamepad)
 plays an entrance_scene of the player into the room
void update_current_room ()
 increments the room coordinate based on which side the player exits the screen from
int check_player_room_position ()
 returns 0-4 based on the player's position in the screen
void read_input (Gamepad &gamepad)
 reads the input from the gamepad and converts it into member variables
void update (int &number_of_enemies_killed)
 updates the interaction between entities in room (enemies hp, damage, etc)
void render (N5110 &lcd, Gamepad &gamepad)
 to draw all the map, entities, doorway onto the screen
void exit_scene (N5110 &lcd, Gamepad &gamepad)
 Plays an exit scene of the player leaving the room.
int get_room_x ()
 reads the member variable _room_x
int get_room_y ()
 reads the member variable _room_y

Detailed Description

RoomEngine Class.

Author:
Steven Mahasin Handles all Inter-Class Interactions in the room
Date:
May 2019

Definition at line 19 of file RoomEngine.h.


Constructor & Destructor Documentation

RoomEngine ( float  global_contrast )

Constructor.

Parameters:
global_contrastthe contrast that the game runs on, set by title screen

Definition at line 3 of file RoomEngine.cpp.

~RoomEngine (  )

Destructor.

Definition at line 11 of file RoomEngine.cpp.


Member Function Documentation

int check_player_room_position (  )

returns 0-4 based on the player's position in the screen

Returns:
which side of the screen the player is currently at (4 = inside)

Definition at line 69 of file RoomEngine.cpp.

void entrance_scene ( N5110 lcd,
Gamepad gamepad 
)

plays an entrance_scene of the player into the room

Parameters:
lcdthe screen that is being drawn on
gamepadthe gamepad whose controls are being read

Definition at line 47 of file RoomEngine.cpp.

void exit_scene ( N5110 lcd,
Gamepad gamepad 
)

Plays an exit scene of the player leaving the room.

Parameters:
lcdthe screen that the exit scene is drawn on
gamepadthe gamepad whose controls are being read

Definition at line 235 of file RoomEngine.cpp.

int get_room_x (  )

reads the member variable _room_x

Returns:
the current room's x-coordinate

Definition at line 279 of file RoomEngine.cpp.

int get_room_y (  )

reads the member variable _room_y

Returns:
the current room's y-coordinate

Definition at line 283 of file RoomEngine.cpp.

void load ( Player current_player,
Room current_room 
)

loads the current player and room into the engine

Parameters:
current_playerthe player we control
current_roomthe room the player is currently in

Definition at line 17 of file RoomEngine.cpp.

void read_input ( Gamepad gamepad )

reads the input from the gamepad and converts it into member variables

Parameters:
gamepadthe gamepad whose controls are being read

Definition at line 88 of file RoomEngine.cpp.

void render ( N5110 lcd,
Gamepad gamepad 
)

to draw all the map, entities, doorway onto the screen

Parameters:
lcdthe screen that the roomengine draws on

Definition at line 165 of file RoomEngine.cpp.

void update ( int &  number_of_enemies_killed )

updates the interaction between entities in room (enemies hp, damage, etc)

Parameters:
number_of_enemies_killedfor the final score, gets incremented everytime an enemy is killed

Definition at line 99 of file RoomEngine.cpp.

void update_current_room (  )

increments the room coordinate based on which side the player exits the screen from

Definition at line 257 of file RoomEngine.cpp.