SUPER Space invader : Turbo edition DX - VS GOD 1.0.0
A simple space invader ripoff
PixelManager Class Reference

main display function, clear the window and calls sub display functions More...

#include <pixelManager.h>

Inheritance diagram for PixelManager:
Collaboration diagram for PixelManager:

Public Member Functions

virtual void loadSprites (vector< Task > &tasks)
 loads sprites in parallel using multiple threads More...
 
 PixelManager (MinGL &window)
 constructor the pixel manager class More...
 
void drawInvaderA (const Position &baseVector, unsigned size, const RGBAcolor &color) const
 display a type A invader on screen More...
 
void drawInvaderB (const Position &baseVector, unsigned size, const RGBAcolor &color) const
 display a type B invader on screen More...
 
void drawInvaderC (const Position &baseVector, unsigned size, const RGBAcolor &color) const
 display a type C invader on screen More...
 
void drawPlayer (unsigned x, unsigned width, const nsGraphics::RGBAcolor &color) const
 display a player on screen More...
 
void drawMissile (const Position &baseVector, unsigned width, const nsGraphics::RGBAcolor &color) const
 display a missile on screen More...
 
void drawTorpedo (const Position &baseVector, unsigned width, const nsGraphics::RGBAcolor &color) const
 display a torpedo on screen More...
 
void drawHeart (const Position &baseVector) const
 display a singular heart on screen More...
 
void drawSprite (const MySprite &msp, const Position &pos) const
 display a sprite on screen More...
 
void displayButton (const Position &baseVector, const string &text, nsGraphics::RGBAcolor &color)
 display a menu button on screen More...
 
void displayMenu (const Position &pos, Menu &currentMenu)
 display a menu on screen More...
 
void displayMenu (const Position &pos, Menu &currentMenu, const vector< ScoreLink > &rankings, const WinValue &winner)
 
void drawText (const Position &pos, const string &text, const RGBAcolor &color=nsGraphics::KWhite, Font font=Font::BITMAP_TIMES_ROMAN_24) const
 display text on screen More...
 
PlayMode showInitialMenu ()
 show the title screen of the game More...
 
bool showDeathMenu (const vector< ScoreLink > &rankings, const WinValue &winner)
 show the menu after a player lose, or all invader has been defeated More...
 
unsigned getScreenHeight () const
 give the height of the screen More...
 
unsigned getScreenWidth () const
 give the width of the screen More...
 
void startFrame () const
 clear the screen for a new frame More...
 
void endFrame () const
 finish a frame render More...
 
void askPlayerNameMenu (playerID pID, unsigned score, string &name)
 
void drawGodBench (int y) const
 display god's bar More...
 
void drawGodFace (int y, bool angry=false) const
 display god's face More...
 

Public Attributes

MinGL & window
 
vector< TaskdrawTasks
 
MySprite logo
 sprite of the logo of the game More...
 
MySprite menuBackground
 sprite of the background during menu More...
 
MySprite gameBackground
 sprite of the background during gameplay More...
 
MySprite rightHand
 sprite of the right hand of god More...
 
MySprite leftHand
 sprite of the left hand of god More...
 

Detailed Description

main display function, clear the window and calls sub display functions

Definition at line 50 of file pixelManager.h.

Constructor & Destructor Documentation

◆ PixelManager()

PixelManager::PixelManager ( MinGL &  window)
explicit

constructor the pixel manager class

Parameters
[in]window: window of the pixel manager

Definition at line 22 of file drawEntities.cpp.

Member Function Documentation

◆ askPlayerNameMenu()

void PixelManager::askPlayerNameMenu ( playerID  pID,
unsigned  score,
string &  name 
)

Definition at line 108 of file drawMenus.cpp.

Here is the call graph for this function:

◆ displayButton()

void PixelManager::displayButton ( const Position baseVector,
const string &  text,
nsGraphics::RGBAcolor &  color 
)

display a menu button on screen

Parameters
[in]baseVector: pixel coordinates of the button
[in]text: text inside the button
[in]color: color of the text inside the button

Definition at line 22 of file drawMenus.cpp.

Here is the caller graph for this function:

◆ displayMenu() [1/2]

void PixelManager::displayMenu ( const Position pos,
Menu currentMenu 
)

display a menu on screen

Parameters
[in]pos: pixel coordinates of the menu
[in,out]currentMenu: menu struct conteining the menu option
[in]pos: pixel coordinates of the menu
[in,out]currentMenu: menu struct conteining the menu option
[in]rankings: the current top 10 players
[in]winner: the winner of the game

Definition at line 28 of file drawMenus.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayMenu() [2/2]

void PixelManager::displayMenu ( const Position pos,
Menu currentMenu,
const vector< ScoreLink > &  rankings,
const WinValue winner 
)

Definition at line 47 of file drawMenus.cpp.

Here is the call graph for this function:

◆ drawGodBench()

void PixelManager::drawGodBench ( int  y) const

display god's bar

Parameters
[in]y: god y pixel position

Definition at line 86 of file drawEntities.cpp.

Here is the call graph for this function:

◆ drawGodFace()

void PixelManager::drawGodFace ( int  y,
bool  angry = false 
) const

display god's face

Parameters
[in]y: god's face y pixel position
[in]angry: flag if god is angry or not

Definition at line 90 of file drawEntities.cpp.

Here is the call graph for this function:

◆ drawHeart()

void PixelManager::drawHeart ( const Position baseVector) const

display a singular heart on screen

Parameters
[in]baseVector: pixel coordinates of the heart

Definition at line 27 of file drawEntities.cpp.

◆ drawInvaderA()

void PixelManager::drawInvaderA ( const Position baseVector,
unsigned  size,
const RGBAcolor &  color 
) const

display a type A invader on screen

Parameters
[in]baseVector: pixel coordinate of the invader
[in]size: size multiplicator of the invader
[in]color: color multiplicaror of the invader

Definition at line 33 of file drawEntities.cpp.

◆ drawInvaderB()

void PixelManager::drawInvaderB ( const Position baseVector,
unsigned  size,
const RGBAcolor &  color 
) const

display a type B invader on screen

Parameters
[in]baseVector: pixel coordinate of the invader
[in]size: size multiplicator of the invader
[in]color: color multiplicaror of the invader

Definition at line 43 of file drawEntities.cpp.

◆ drawInvaderC()

void PixelManager::drawInvaderC ( const Position baseVector,
unsigned  size,
const RGBAcolor &  color 
) const

display a type C invader on screen

Parameters
[in]baseVector: pixel coordinate of the invader
[in]size: size multiplicator of the invader
[in]color: color multiplicaror of the invader

Definition at line 51 of file drawEntities.cpp.

◆ drawMissile()

void PixelManager::drawMissile ( const Position baseVector,
unsigned  width,
const nsGraphics::RGBAcolor &  color 
) const

display a missile on screen

Parameters
[in]baseVector: pixel coordinates of the missile
[in]width: width of the missle
[in]color: color of the missile

Definition at line 71 of file drawEntities.cpp.

◆ drawPlayer()

void PixelManager::drawPlayer ( unsigned  x,
unsigned  width,
const nsGraphics::RGBAcolor &  color 
) const

display a player on screen

Parameters
[in]x: horizontal position of the player
[in]witdh: width of the player
[in]color: color of the plater

Definition at line 59 of file drawEntities.cpp.

◆ drawSprite()

void PixelManager::drawSprite ( const MySprite msp,
const Position pos = Position(0, 0) 
) const

display a sprite on screen

Parameters
[in]msp: sprite to draw
[in]pos: pixel coordinates to draw the sprite

Definition at line 80 of file drawEntities.cpp.

Here is the caller graph for this function:

◆ drawText()

void PixelManager::drawText ( const Position pos,
const string &  text,
const RGBAcolor &  color = nsGraphics::KWhite,
Font  font = Font::BITMAP_TIMES_ROMAN_24 
) const

display text on screen

Parameters
[in]pos: pixel coordinates of the text
[in]text: text to show on screen
[in]color: color of the text to show

Definition at line 105 of file drawEntities.cpp.

Here is the caller graph for this function:

◆ drawTorpedo()

void PixelManager::drawTorpedo ( const Position baseVector,
unsigned  width,
const nsGraphics::RGBAcolor &  color 
) const

display a torpedo on screen

Parameters
[in]baseVector: pixel coordinates of the torpedo
[in]width: width of the torpedo
[in]color: color of the torpedo

Definition at line 76 of file drawEntities.cpp.

◆ endFrame()

void PixelManager::endFrame ( ) const

finish a frame render

Definition at line 15 of file pixelManager.cpp.

Here is the caller graph for this function:

◆ getScreenHeight()

unsigned PixelManager::getScreenHeight ( ) const

give the height of the screen

Returns
the height of the screen in pixel

Definition at line 20 of file pixelManager.cpp.

Here is the caller graph for this function:

◆ getScreenWidth()

unsigned PixelManager::getScreenWidth ( ) const

give the width of the screen

Returns
the width of the screen in pixel

Definition at line 24 of file pixelManager.cpp.

Here is the caller graph for this function:

◆ loadSprites()

void PixelManager::loadSprites ( vector< Task > &  tasks)
virtual

loads sprites in parallel using multiple threads

Parameters
[in]vec: We take his ownership, so

Definition at line 4 of file pixelManager.cpp.

◆ showDeathMenu()

bool PixelManager::showDeathMenu ( const vector< ScoreLink > &  rankings,
const WinValue winner 
)

show the menu after a player lose, or all invader has been defeated

Returns
true if the player plays again, else false
Parameters
[in]rankings: the current top 5 score
[in]winner: the winner of the game

Definition at line 156 of file drawMenus.cpp.

Here is the call graph for this function:

◆ showInitialMenu()

PlayMode PixelManager::showInitialMenu ( )

show the title screen of the game

Returns
the playmode chosen inside the menu

Definition at line 72 of file drawMenus.cpp.

Here is the call graph for this function:

◆ startFrame()

void PixelManager::startFrame ( ) const

clear the screen for a new frame

Definition at line 11 of file pixelManager.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ drawTasks

vector<Task> PixelManager::drawTasks
mutable

Definition at line 53 of file pixelManager.h.

◆ gameBackground

MySprite PixelManager::gameBackground

sprite of the background during gameplay

Definition at line 77 of file pixelManager.h.

◆ leftHand

MySprite PixelManager::leftHand

sprite of the left hand of god

Definition at line 87 of file pixelManager.h.

◆ logo

MySprite PixelManager::logo

sprite of the logo of the game

Definition at line 67 of file pixelManager.h.

◆ menuBackground

MySprite PixelManager::menuBackground

sprite of the background during menu

Definition at line 72 of file pixelManager.h.

◆ rightHand

MySprite PixelManager::rightHand

sprite of the right hand of god

Definition at line 82 of file pixelManager.h.

◆ window

MinGL& PixelManager::window

Definition at line 52 of file pixelManager.h.


The documentation for this class was generated from the following files: