//------------------------------------------------------------------------------ // File: rocket.c // Author: George Bain // Date: May 24, 1997 // Description: Enemy rocket related routines // Copyright (C) 1997 George Bain, All Rights Reserved //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // I N C L U D E S //------------------------------------------------------------------------------ #include // standard Sony library #include "rocket.h" #include "gfx.h" //------------------------------------------------------------------------------ // Function: DrawRockets() // Description: Register rocket sprites into the OT // Parameters: none // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void DrawRockets( void ) { int count; for( count=0; count= rockets[count].sprite.y ) rocket_y = rockets[count].sprite.y+=(ROCKET_SPEED); // test if rocket hit edge of screen if( (rocket_x >= SCREEN_WIDTH) || (rocket_x <=3) || (rocket_y > SCREEN_HEIGHT) || (rocket_y <=3) ) rockets[count].state = ROCKET_DEAD; // kill it }// end if rocket ALIVE }// end count }// end MoveRockets //------------------------------------------------------------------------------ // Function: StartRockets() // Description: StartRockets // Parameters: x: x location to launch rocket // y: y location to launch rocket // Returns: void // Notes: N/A //------------------------------------------------------------------------------ void StartRockets( int x, int y ) { int count; for( count=0; countstate = ROCKET_DEAD; // start an explosion StartExplosions( player.sprite.x+10, player.sprite.y+10, EXPLOSION_SPEED ); // decrease players health game_info.player_energy-=5; }// end collision }// end if ROCKET_ALIVE }// end for NUM_ROCKETS }// end PlayerRocketCollision //---------------------------------------EOF------------------------------------