a,d keys implemented and screen for 1080p
This commit is contained in:
@ -31,6 +31,7 @@ UINineSlice* scoreboard9Slice;
|
||||
UINineSlice* debugBox;
|
||||
UIText* debugStaticText;
|
||||
UIText* debugdynamicText;
|
||||
UIText* debugJumpText;
|
||||
|
||||
GameStateManager* Game::gsm = new GameStateManager();
|
||||
|
||||
@ -64,6 +65,16 @@ int last_time;
|
||||
int current_time;
|
||||
int diff_time;
|
||||
|
||||
std::string Game::BoolToString(bool b) {
|
||||
std::string myString;
|
||||
if (b) {
|
||||
myString = "true";
|
||||
} else {
|
||||
myString = "false";
|
||||
}
|
||||
return myString;
|
||||
}
|
||||
|
||||
|
||||
Game::Game() {
|
||||
// TODO Auto-generated constructor stub
|
||||
@ -146,7 +157,9 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
|
||||
UIText* debugStaticText4;
|
||||
UIText* debugStaticText5;
|
||||
UIText* debugStaticText6;
|
||||
UIText* debugStaticText7;
|
||||
UIText* debugStaticText7;
|
||||
|
||||
|
||||
std::string debugStaticString = "Collision";
|
||||
debugStaticText = new UIText(debugStaticString, "font", 0,0,8,12,1);
|
||||
debugStaticText->ParseString(debugStaticString,220*globalScale,14*gScale,1,"debug",Game::groupUI_Layer3);
|
||||
@ -169,6 +182,9 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
|
||||
debugStaticText7 = new UIText(debugStaticString7, "font", 0,0,8,12,1);
|
||||
debugStaticText7->ParseString(debugStaticString7,220*globalScale,74*gScale,1,"debug",Game::groupUI_Layer3);
|
||||
|
||||
debugJumpText = new UIText(Game::BoolToString(playerIsJumping), "font", 0,0,8,12,1);
|
||||
debugJumpText->ParseString(Game::BoolToString(playerIsJumping),260*globalScale,44*gScale,1,"debugJumpText",Game::groupUI_Layer3);
|
||||
|
||||
// debug UI box
|
||||
SDL_Rect debugBoxRect = SDL_Rect();
|
||||
debugBoxRect.x = 220*globalScale;
|
||||
@ -259,6 +275,15 @@ void Game::update()
|
||||
// Mix_PlayChannel(-1, Game::assets->GetSoundClip("bark1"),0);
|
||||
// }
|
||||
|
||||
|
||||
// for (auto& letter : debugText)
|
||||
// {
|
||||
// if(letter->tag=="debugJumpText"){
|
||||
// std::cout<<letter->tag<<std::endl;
|
||||
// }
|
||||
// }
|
||||
// debugJumpText->ParseString(Game::BoolToString(playerIsJumping),260*gScale,44*gScale,1,"debugJumpText",Game::groupUI_Layer3);
|
||||
|
||||
manager.refresh();
|
||||
manager.update();
|
||||
|
||||
@ -407,3 +432,4 @@ void Game::drawLine(Vector2D srcpt, Vector2D destpt, int red, int green, int blu
|
||||
SDL_SetRenderDrawColor(renderer, red, green, blue, 255);
|
||||
SDL_RenderDrawLine(renderer, srcpt.x, srcpt.y, destpt.x, destpt.y);
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
static SDL_Rect camera;
|
||||
static AssetManager* assets;
|
||||
static GameStateManager* gsm;
|
||||
std::string BoolToString(bool b);
|
||||
enum groupLabels : std::size_t
|
||||
{
|
||||
groupMap,
|
||||
|
Reference in New Issue
Block a user