//------------------------------------------------------------------------------ // File: status.c // Author: George Bain // Date: May 24, 1997 // Description: Status related routines // Copyright (C) 1997 George Bain, All Rights Reserved //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // I N C L U D E S //------------------------------------------------------------------------------ #include // standard Sony library #include "status.h" #include "gfx.h" //------------------------------------------------------------------------------ // G L O B A L S //------------------------------------------------------------------------------ GsBOXF life_bar; // the player life bar GsBOXF boss_life_bar; // the boss life bar GsBOXF border_bar; // grey border bar //------------------------------------------------------------------------------ // Function: InitBorderBar() // Description: Initialize fields for the grey border bar // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void InitBorderBar( void ) { border_bar.attribute = 0x00000000; border_bar.x = 0; border_bar.y = 212; border_bar.w = SCREEN_WIDTH; border_bar.h = 2; border_bar.r = 115; border_bar.g = 115; border_bar.b = 115; }// end InitBorderBar //------------------------------------------------------------------------------ // Function: InitLifeBar() // Description: Initialize fields for the players life bar // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void InitLifeBar( void ) { life_bar.attribute = 0x00000000; life_bar.x = LIFE_BAR_X; life_bar.y = LIFE_BAR_Y; life_bar.w = PLAYER_ENERGY/30; life_bar.h = LIFE_BAR_HEIGHT; life_bar.r = 128; life_bar.g = 0; life_bar.b = 0; }// end InitLifeBar //------------------------------------------------------------------------------ // Function: InitBossLifeBar() // Description: Initialize fields for the boss life bar // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void InitBossLifeBar( void ) { boss_life_bar.attribute = 0x00000000; boss_life_bar.x = LIFE_BAR_X; boss_life_bar.y = 10; boss_life_bar.w = BOSS_ENERGY/70; boss_life_bar.h = LIFE_BAR_HEIGHT; boss_life_bar.r = 128; boss_life_bar.g = 0; boss_life_bar.b = 0; }// end InitBossLifeBar //------------------------------------------------------------------------------ // Function: UpdateStatus() // Description: Update the status screen with new energy level, score and // money collected // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void UpdateStatus( void ) { life_bar.w = game_info.player_energy/30; boss_life_bar.w = game_info.boss_energy/70; if( game_info.player_energy <=0 ) { game_info.player_lives -= 1; game_info.player_energy = PLAYER_ENERGY; } FntLoad(896,256); FntOpen(34,STATUS_SCREEN_Y,SCREEN_WIDTH,SCREEN_HEIGHT,0,512); FntPrint("%d %d",game_info.player_lives,game_info.money); FntFlush(-1); }// end UpdateStatus //------------------------------------------------------------------------------ // Function: DrawStatusScreen() // Description: Register first status screen sprite into the OT // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void DrawStatusScreen( void ) { GsSortFastSprite( &status.sprite, &world_ordering_table[output_buffer_index], 0 ); }// end DrawStatusScreen //------------------------------------------------------------------------------ // Function: DrawLifeBar() // Description: Register players and boss life bar rect into the OT // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void DrawLifeBar( void ) { GsSortBoxFill( &life_bar,&world_ordering_table[output_buffer_index], 0 ); if( boss_one.state == BOSS_ALIVE ) GsSortBoxFill( &boss_life_bar,&world_ordering_table[output_buffer_index], 0 ); }// end DrawLifeBar //------------------------------------------------------------------------------ // Function: DrawBorderBar() // Description: Register gery border bar rect into the OT // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void DrawBorderBar( void ) { GsSortBoxFill( &border_bar,&world_ordering_table[output_buffer_index], 0 ); }// end DrawBorderBar //-----------------------------------EOF----------------------------------------