Exemplo n.º 1
0
void MainMenuState::Init(Engine* game){

    text1 = LTexture();
    text1.setFontSize(40);
    
    text2 = LTexture();
    text2.setFontSize(20);
    text1.loadFromRenderedText("Teenage Astronaut", {255,255,255}, game->renderer);
    text2.loadFromRenderedText("SPACE to start", {255,255,255}, game->renderer);
}
Exemplo n.º 2
0
void Player::Init(Engine* game, Tilemap* t, double x, double y){
    this->x = x;
    this->y = y;

    
    width = 32;
    height = 32;
    
    this->tm = t;
    
    dir = DOWN;
    
    if (game!= NULL){
        spritesheet = LTexture();
        spritesheet.loadFromFile("assets/sprites/astronaut_sprite.png", game->renderer);
    }
    
    vx = 0;
    vy = 0;
    vmax = 300;
}
Exemplo n.º 3
0
SDL_Controller::SDL_Controller() : window(NULL), renderer(NULL), quitGame(false), bg(LTexture()), minion(LTexture()),
snake(new Snake()), minionAlive(false), minionX(0), minionY(0), score(0), stateStack(std::stack<State*>()),
stateArray(new State*[1]{ new MenuState()})
{
}