};
}
+game_object powerup_init(game_object powerup, game_object object){
+ //Call immediately before an object_out
+ powerup.active = 1;
+ powerup.x = object.x;
+ powerup.y = object.y;
+ if(rand()%1000>=500){
+ powerup.direction = 4;
+ } else {
+ powerup.direction = 6;
+ };
+ powerup.speed = 1;
+
+ strcpy (powerup.line0, "(T)");
+
+ return powerup;
+};
+
game_object player_init(game_object player){
player.x = 18;
player.y = rand()%600+20;
strcpy (shields[10].line0, ")");
strcpy (shields[11].line0, "(");
+ struct game_object powerups[4] = {
+ { 120, 0, 0, 0, 6, 0, 1, 0, 0 },
+ { 121, 0, 0, 0, 4, 0, 1, 0, 0 },
+ { 122, 0, 0, 0, 6, 0, 1, 0, 0 },
+ { 123, 0, 0, 0, 4, 0, 1, 0, 0 }
+ };
+
initscr();
//Check screen size 80x24 and exit if not big enough
shields[shieldloop] = process_motion(shields[shieldloop], player);
};
+ for(int poweruploop = 0; poweruploop<4; poweruploop++){
+ powerups[poweruploop] = process_motion(powerups[poweruploop], player);
+ };
+
for(int podloop = 0; podloop<podmax; podloop++){
pods[podloop] = process_motion(pods[podloop], player);
//If lander dies, release pod
};
};
+ for(int poweruploop = 0; poweruploop<4; poweruploop++){
+ drawlocation = draw_object(powerups[poweruploop], drawlocation);
+ };
+
// Draw pods objects 2-9
for(int podloop = 0; podloop<podmax; podloop++){ drawlocation = draw_object(pods[podloop], drawlocation); };