//------------------------------------------------------------------------------ // File: player.c // Author: George Bain // Date: May 15, 1997 // Description: Initialize the player // Copyright (C) 1997 George Bain, All Rights Reserved //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // I N C L U D E S //------------------------------------------------------------------------------ #include // standard Sony library #include "player.h" #include "gfx.h" //------------------------------------------------------------------------------ // Function: DrawPlayer() // Description: Register player sprite into the OT // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void DrawPlayer( void ) { if( player.state == PLAYER_ALIVE ) GsSortFastSprite( &player.sprite, &world_ordering_table[output_buffer_index], 0 ); }// end DrawPlayer //------------------------------------------------------------------------------ // Function: CheckPlayerLocation() // Description: Check to see if player is going out of bounds, // if so don't let it! // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void CheckPlayerLocation( void ) { if( player.state == PLAYER_ALIVE ) { if( player.sprite.x >= SCREEN_WIDTH - PLAYER_WIDTH ) player.sprite.x = SCREEN_WIDTH - PLAYER_WIDTH; else if( player.sprite.x <= 0 ) player.sprite.x = 2; else if( player.sprite.y >= (SCREEN_HEIGHT-30) - PLAYER_HEIGHT ) player.sprite.y = (SCREEN_HEIGHT-30) - PLAYER_HEIGHT; else if( player.sprite.y <= 0 ) player.sprite.y = 2; }// end if }// end CheckPlayerLocation //-----------------------------------EOF----------------------------------------