diff --git a/!TheEsc/!RunImage,ff8 b/!TheEsc/!RunImage,ff8 index fd332ac..d24757c 100644 Binary files a/!TheEsc/!RunImage,ff8 and b/!TheEsc/!RunImage,ff8 differ diff --git a/!TheEsc/Spr,ff9 b/!TheEsc/Spr,ff9 index e527e54..3a7db24 100644 Binary files a/!TheEsc/Spr,ff9 and b/!TheEsc/Spr,ff9 differ diff --git a/!TheEsc/c/CTheEscape b/!TheEsc/c/CTheEscape index 28bbce7..c9e7166 100644 --- a/!TheEsc/c/CTheEscape +++ b/!TheEsc/c/CTheEscape @@ -21,6 +21,7 @@ int lasttick = 0; extern int screen; extern int game1_tick(); +extern void game1_setup(); int game_hitbox_collide(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) { @@ -35,26 +36,27 @@ int game_hitbox_collide(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int main(int argc, char *argv[]) { + int lastoutcome = 0; sound_on(); + // Set initial display mode display_mode(DISPLAY_MODE); - screen_clear(); - + + // Load sprite library load_sprites("Spr"); + // Intro titles + music intro(); - display_mode(DISPLAY_MODE); screen_clear(); - - game_setup(); - - while(game1_tick()); - screen_clear(); - printf("you ded\n"); - screen_flipbuffer(); + // Mission 1 + game1_setup(); + while(!lastoutcome) + { + lastoutcome = game1_tick(); + } free(buffer); diff --git a/!TheEsc/c/Mission1 b/!TheEsc/c/Mission1 index b523505..e2e834b 100644 --- a/!TheEsc/c/Mission1 +++ b/!TheEsc/c/Mission1 @@ -782,7 +782,7 @@ void game_draw_hud() draw_sprite("pointer",141+(Player.remainingdistance/7500),DISPLAY_Y - 164 + 4); } -void game_setup() +void game1_setup() { game_setup_input(); game_setup_audio(); @@ -816,6 +816,73 @@ void game_tick_player() } } +void game1_death() +{ + int currentstart = 0; + int introframe = 0; + sound_voices(4); + + sound_set_voice(1,"WaveSynth-Beep"); + sound_set_voice(2,"WaveSynth-Beep"); + sound_set_voice(3,"WaveSynth-Beep"); + sound_set_voice(4,"WaveSynth-Beep"); + sound_composition_init(); + + currentstart += 100; + sound_composition_element_add(currentstart,1,sound_note("D2"),150); + currentstart += 100; + sound_composition_element_add(currentstart,2,sound_note("G2"),200); + currentstart += 200; + sound_composition_element_add(currentstart,3,sound_note("B3"),75); + currentstart += 40; + sound_composition_element_add(currentstart,4,sound_note("G2"),75); + currentstart += 50; + sound_composition_element_add(currentstart,2,sound_note("B3"),200); + currentstart += 200; + sound_composition_element_add(currentstart,1,sound_note("A3"),100); + currentstart += 100; + sound_composition_element_add(currentstart,3,sound_note("G2"),150); + currentstart += 150; + sound_composition_element_add(currentstart,2,sound_note("E2"),100); + currentstart += 100; + sound_composition_element_add(currentstart,1,sound_note("D2"),150); + currentstart += 150; + sound_composition_element_add(currentstart,3,sound_note("D2"),150); + currentstart += 100; + sound_composition_element_add(currentstart,4,sound_note("G2"),150); + currentstart += 150; + sound_composition_element_add(currentstart,1,sound_note("B3"),75); + currentstart += 40; + sound_composition_element_add(currentstart,2,sound_note("G2"),75); + currentstart += 40; + sound_composition_element_add(currentstart,3,sound_note("B3"),150); + currentstart += 150; + sound_composition_element_add(currentstart,4,sound_note("A3"),130); + currentstart += 100; + sound_composition_element_add(currentstart,1,sound_note("G2"),200); + currentstart += 300; + tick = clock(); + + sound_composition_start(clock()); + + draw_sprite("spacebar",(DISPLAY_X/2)-106,50); + draw_sprite("kia",(DISPLAY_X/2)-300,500); + + screen_flipbuffer(); + + while(sound_composition_incomplete()) + { + sound_composition_tick(clock()); + + if(clock() > (tick + 200)) + { + if(input_readkey(98)) + sound_composition_stop(); + } + } +} + + int game1_tick() { lasttick = tick; @@ -824,24 +891,30 @@ int game1_tick() screen_flipbuffer(); screen_clear(); - PROFILE(game_tick_stars()); - PROFILE(game_tick_input()); - PROFILE(game_tick_player()); - PROFILE(game_tick_npcs()); - PROFILE(game_tick_collider()); - PROFILE(game_tick_player_targets()); - PROFILE(game_tick_npcs()); - PROFILE(game_tick_projectiles()); - PROFILE(game_draw_stars()); - PROFILE(game_draw_player()); - PROFILE(game_draw_npcs()); - PROFILE(game_draw_projectiles()); - - PROFILE(game_draw_hud()); - PROFILE(game_draw_debugmenu()); - if(Player.integrity > 0) - return 1; - else + { + PROFILE(game_tick_stars()); + PROFILE(game_tick_input()); + PROFILE(game_tick_player()); + PROFILE(game_tick_npcs()); + PROFILE(game_tick_collider()); + PROFILE(game_tick_player_targets()); + PROFILE(game_tick_npcs()); + PROFILE(game_tick_projectiles()); + PROFILE(game_draw_stars()); + PROFILE(game_draw_player()); + PROFILE(game_draw_npcs()); + PROFILE(game_draw_projectiles()); + + PROFILE(game_draw_hud()); + PROFILE(game_draw_debugmenu()); return 0; + }else{ + screen_flipbuffer(); + screen_clear(); + game1_death(); + return 1; + } + + } diff --git a/!TheEsc/c/Sound b/!TheEsc/c/Sound index 98c921d..84dacc6 100644 --- a/!TheEsc/c/Sound +++ b/!TheEsc/c/Sound @@ -61,6 +61,7 @@ void sound_composition_init() { composition[i].Start = -1; } + current_element = 0; } void sound_composition_element_add(int start, int channel, int note, int length) @@ -101,6 +102,7 @@ void sound_composition_debug() void sound_composition_start(int cent) { composition_startcent = cent; + current_playback_element = 0; } void sound_composition_stop()