begin
set_mode(m320x200);
set_fps(30, 2);
file_enemies = load_fpg("enemies.fpg");
file_effects = load_fpg("effects.fpg");
file_extras = load_fpg("extras.fpg");
file_font8x8w = load_fnt("smb8x8w.fnt");
file_font8x16w = load_fnt("smb8x16w.fnt");
file_player = load_fpg("player.fpg");
file_screen = load_fpg("screens.fpg");
animcounter();
loop
/*
Code: Title
*/
game = false;
player_dead = false; player_win = false; program_continue = false; setup_level(0); while (not program_continue); frame; end
x = 160; y = 100; file = file_screen; graph = 2; fade_on();
loop
if (key(_esc)) exit("Jumpman quits here!", 1); end
if (key(_space)) player_dead = true; program_continue = false; break; end
frame;
end
while (not program_continue); frame; end
fade_off(); frame(3000); //stop_scroll(0);
/*
Code: Initial the game
*/
player_coins = 0; player_level = 1; player_lives = 4; player_score = 0; player_world = 1;
font_score = write_int(file_font8x8w, 76, 15, 2, &player_score); font_lives = write_int(file_font8x8w, 96, 7, 1, &player_lives);
font_coins = write_int(file_font8x8w, 144, 15, 2, &player_coins); font_world = write_int(file_font8x8w, 196, 15, 0, &player_world);
font_level = write_int(file_font8x8w, 212, 15, 0, &player_level); font_time = write_int(file_font8x8w, 276, 15, 1, &player_time);
/*
Code: Game
*/
loop
//file_screen = load_fpg("screens.fpg");
player_dead = false; player_win = false; program_continue = false; setup_level(player_level); while (not program_continue); frame; end
file = file_extras; graph = 1; x = 0; y = 0; time_count = 0; fade_on();
while (game)
time_count ++; if (time_count > 25) time_count = 0; player_time --; if (player_time < 1) player_dead = true; program_continue = false; break; end; end
if (key(_esc)) player_dead = true; program_continue = false; break; end
frame;
end
while (not program_continue); frame; end
if (player_dead)
player_lives --;
if (player_lives < 0)
font_gamestatus = write(file_font8x16w, 160, 100, 1, "game over"); frame(10000); fade_off(); frame(2000); delete_text(font_gamestatus);
break;
end
end
fade_off(); frame(2000); //stop_scroll(0);
end
/*
Code: Uninitial the game
*/
delete_text(font_coins); delete_text(font_level); delete_text(font_lives); delete_text(font_score); delete_text(font_time); delete_text(font_world);
graph = 0; frame;
end
end
|