mirror of
https://github.com/echojc/osu-ds.git
synced 2025-06-20 01:45:39 -04:00

Removed the arm7 section Changed the makefile to only use the arm9 stuff Epicpkmn: Fix source/Graphics/GraphicsManager.cpp Co-Authored-By: Pk11 <epicpkmn11@outlook.com> Co-Authored-By: Kaisaan <34224128+Kaisaan@users.noreply.github.com>
75 lines
1.1 KiB
C++
75 lines
1.1 KiB
C++
#include "Player.h"
|
|
|
|
Player::Player()
|
|
{
|
|
//initialisation
|
|
mRuleset.Initialize();
|
|
|
|
//load audio
|
|
ChangeToSongDir();
|
|
AudioManager::Engine().MusicPlay(BeatmapManager::Current().AudioFilename());
|
|
|
|
//set player to process gameplay
|
|
mPlayState = PLAYSTATE_PLAY;
|
|
}
|
|
|
|
Player::~Player()
|
|
{
|
|
//delete mBaseDir;
|
|
AudioManager::Engine().MusicStop();
|
|
}
|
|
|
|
void Player::Update()
|
|
{
|
|
switch (mPlayState)
|
|
{
|
|
case PLAYSTATE_PLAY:
|
|
{
|
|
mRuleset.Update();
|
|
|
|
if (BeatmapManager::Current().GameOver())
|
|
{
|
|
mPlayState = PLAYSTATE_GAMEOVER;
|
|
mRuleset.OnGameOver();
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
case PLAYSTATE_GAMEOVER:
|
|
{
|
|
iprintf("\x1b[0;0HGame over");
|
|
break;
|
|
}
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
AudioManager::Engine().MusicUpdate();
|
|
}
|
|
|
|
void Player::HandleInput()
|
|
{
|
|
mRuleset.HandleInput();
|
|
|
|
//handle play mode input
|
|
if (InputHelper::KeyDown(KEY_A))
|
|
{
|
|
mRuleset.Skip();
|
|
}
|
|
|
|
if (InputHelper::KeyDown(KEY_SELECT))
|
|
{
|
|
ChangeMode(MODE_SONGSELECT);
|
|
return;
|
|
}
|
|
}
|
|
|
|
void Player::ChangeToSongDir()
|
|
{
|
|
ChangeToOsuDir();
|
|
chdir(BeatmapManager::Current().BaseDir().c_str());
|
|
}
|
|
|