FirstCaveBat::FirstCaveBat(Graphics& graphics, units::Game x, units::Game y) : flight_center_y_(y), x_(x), y_(y), flight_angle_(0.0f), facing_(RIGHT) { initializeSprites(graphics); }
void SpriteBatch::initialize() { initializeShader(); initializeBuffers(); //initializeProjectionTransform(); initializeSprites(); }
Player::Player(Graphics& graphics, Vector<units::Game> pos) : pos_(std::move(pos)), velocity_{0.0, 0.0}, acceleration_x_direction_{0}, horizontal_facing_{HorizontalFacing::LEFT}, intended_vertical_facing_{VerticalFacing::HORIZONTAL}, is_on_ground_{false}, is_jump_active_{false}, is_interacting_{false}, health_(graphics), invincible_timer_{kInvincibleTime}, damage_text_(new DamageText()), walking_animation_(), polar_star_(graphics), sprites_() { initializeSprites(graphics); }
//Begins Text Input void getText(char *buffer) { int FINISHED = 0; clearScreen(); setupInterrupts(); initializeSprites(); drawKeyboard(); playBG = TRUE; while(!FINISHED) { if(playBG && !BGplaying) { // play the bg music DMA[2].cnt |= DMA_ON; REG_TM1CNT |= TM_ON; startBG = vblankcount; BGplaying = TRUE; DMA[2].src = flute; } checkMovement(); //Check Input and End Function if finished if(!endInput) { checkSelection(buffer); copyShadow(); waitForVblank(); moveSpriteToMem(); } else { DMA[2].cnt &= ~DMA_ON; REG_TM1CNT &= ~TM_ON; playBG = FALSE; waitForVblank(); FINISHED = 1; resetVariables(); endInput = 0; resetCursor(); } } clearScreen(); }
//Begins Text Input void getText(char *buffer) { setRegister(); setupInterrupts(); initializeTiles(); initializeSprites(); drawKeyboard(); playBG = TRUE; while(1) { if(playBG && !BGplaying) { // play the bg music DMA[2].cnt |= DMA_ON; REG_TM1CNT |= TM_ON; startBG = vblankcount; BGplaying = TRUE; DMA[2].src = flute; } checkMovement(); if(!endInput) { checkSelection(buffer); } else { DMA[2].cnt &= ~DMA_ON; REG_TM1CNT &= ~TM_ON; playBG = FALSE; waitForVblank(); } copyShadow(); waitForVblank(); moveSpriteToMem(); } }