@ -478,7 +478,7 @@ void SeasonI::SetupAnimations() {
}
}
void SeasonI : : SetupObjectInfo ( ) {
void SeasonI : : SetupObjectInfo ( ) {
CreateObjectInfo ( new NPC_Obj ( PLAYER , " player " , { 0 , 0 } , nullptr , { 2 , 2 } , WHITE , 16 ) , " player.png " , { 32 , 32 } ) ;
CreateObjectInfo ( new NPC_Obj ( PLAYER , " player " , { 0 , 0 } , nullptr , { 1 , 1 } , WHITE , 16 ) , " player.png " , { 32 , 32 } ) ;
CreateObjectInfo ( new NPC_Obj ( NESS , " Ness " , { 0 , 0 } , nullptr , { 1 , 1 } , YELLOW , 14 ) , " player.png " , { 32 , 32 } ) ;
CreateObjectInfo ( new NPC_Obj ( NESS , " Ness " , { 0 , 0 } , nullptr , { 1 , 1 } , YELLOW , 14 ) , " player.png " , { 32 , 32 } ) ;
CreateObjectInfo ( new NPC_Obj ( PAULA , " Paula " , { 0 , 0 } , nullptr , { 1 , 1 } , MAGENTA , 13 ) , " player.png " , { 32 , 32 } ) ;
CreateObjectInfo ( new NPC_Obj ( PAULA , " Paula " , { 0 , 0 } , nullptr , { 1 , 1 } , MAGENTA , 13 ) , " player.png " , { 32 , 32 } ) ;
CreateObjectInfo ( new NPC_Obj ( JEFF , " Jeff " , { 0 , 0 } , nullptr , { 1 , 1 } , DARK_GREEN , 15 ) , " player.png " , { 32 , 32 } ) ;
CreateObjectInfo ( new NPC_Obj ( JEFF , " Jeff " , { 0 , 0 } , nullptr , { 1 , 1 } , DARK_GREEN , 15 ) , " player.png " , { 32 , 32 } ) ;
@ -1378,8 +1378,7 @@ void SeasonI::updateGame(){
}
}
}
}
if ( moved ) {
if ( moved ) {
const vi2d cameraOffset = { WIDTH / 2 , HEIGHT / 2 } ;
CenterCameraOnPlayer ( ) ;
cameraPos = PARTY_MEMBER_OBJ [ 0 ] - > GetPos ( ) + PARTY_MEMBER_OBJ [ 0 ] - > originPoint / 2 - cameraOffset ;
}
}
if ( moved & & BATTLE_ENCOUNTER = = nullptr ) {
if ( moved & & BATTLE_ENCOUNTER = = nullptr ) {
for ( int i = 0 ; i < CURRENT_MAP - > encounters . size ( ) ; i + + ) {
for ( int i = 0 ; i < CURRENT_MAP - > encounters . size ( ) ; i + + ) {
@ -3929,14 +3928,12 @@ void SeasonI::HandleCutscenes() {
for ( int i = 0 ; i < PARTY_MEMBER_COUNT ; i + + ) {
for ( int i = 0 ; i < PARTY_MEMBER_COUNT ; i + + ) {
PARTY_MEMBER_OBJ [ i ] - > SetPos ( pos ) ;
PARTY_MEMBER_OBJ [ i ] - > SetPos ( pos ) ;
}
}
const vi2d cameraOffset = { WIDTH / 2 , HEIGHT / 2 } ;
CenterCameraOnPlayer ( ) ;
cameraPos = PARTY_MEMBER_OBJ [ 0 ] - > GetPos ( ) - cameraOffset ;
CurrentCutscene - > AdvanceAction ( ) ;
CurrentCutscene - > AdvanceAction ( ) ;
} break ;
} break ;
case ActionType : : LOAD_FILE : {
case ActionType : : LOAD_FILE : {
LoadGameSaveData ( SAVE_FILE_CURSOR ) ;
LoadGameSaveData ( SAVE_FILE_CURSOR ) ;
const vi2d cameraOffset = { WIDTH / 2 , HEIGHT / 2 } ;
CenterCameraOnPlayer ( ) ;
cameraPos = PARTY_MEMBER_OBJ [ 0 ] - > GetPos ( ) + PARTY_MEMBER_OBJ [ 0 ] - > originPoint / 2 - cameraOffset ;
GAME_STATE = GameState : : GAME_WORLD ;
GAME_STATE = GameState : : GAME_WORLD ;
CurrentCutscene - > AdvanceAction ( ) ;
CurrentCutscene - > AdvanceAction ( ) ;
} break ;
} break ;
@ -5387,6 +5384,11 @@ void SeasonI::LoadGameSaveData(int saveSlot) {
CHAPTER_NUMBER = ReadIntFromStream ( file ) ;
CHAPTER_NUMBER = ReadIntFromStream ( file ) ;
}
}
void SeasonI : : CenterCameraOnPlayer ( ) {
const vi2d cameraOffset = { WIDTH / 2 , HEIGHT / 2 } ;
cameraPos = PARTY_MEMBER_OBJ [ 0 ] - > GetPos ( ) + PARTY_MEMBER_OBJ [ 0 ] - > originPoint / 2 - cameraOffset ;
}
# ifndef TEST_SUITE
# ifndef TEST_SUITE
int main ( )
int main ( )
{
{