From 8eba8f14e947ef5f779798c8c7ff7b781d442a6a Mon Sep 17 00:00:00 2001 From: stevenhowes <38082088+stevenhowes@users.noreply.github.com> Date: Sun, 28 Mar 2021 22:48:32 +0100 Subject: [PATCH] Some prep for mission 2 and mission re-attempts/success --- !TheEsc/!RunImage,ff8 | Bin 15900 -> 17260 bytes !TheEsc/Makefile,fe1 | 9 +++- !TheEsc/c/CTheEscape | 37 ++++++++++--- !TheEsc/c/Mission1 | 11 +++- !TheEsc/c/Mission2 | 117 ++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 6 files changed, 164 insertions(+), 12 deletions(-) create mode 100644 !TheEsc/c/Mission2 diff --git a/!TheEsc/!RunImage,ff8 b/!TheEsc/!RunImage,ff8 index 20332cac13208e600d368ee576df8b557d902bef..ad5df22a7e3b14bb4ed8e7cb4508b5d5ece91bbb 100644 GIT binary patch delta 4154 zcmZWs4^)&@7Ju{RFY}MV0aU=5X%@*wz+o2IG9|FGlbH~1Y3QOTWEd&|x$3GQjdYg$ zLwm_~`{#GcV{Yquj^cV+DUXBVnr-H`)f#Ip%(q`B7%SQg|D?|T-Y`=W%{lkHd++b} z-o4*_@4oMw7dKpJRi!c}^$RgG7V5LIP!eNbH5WgVda~)!MAl{JER@J3`DvgxR4g<$ zaYt|h^t;q7^bzbU5S^KYE@2!p0=KXbV_x}MIBZm5yoAw)RlfpWi!mO%EHJi9DP`@- z)1K%6vFG{3gRRRBxm2!EO z@k1*cL=J3kfGT(yKO3Nf7(TF)PVG*W@E|&bWJOyPv5ZLk1uGS*9h|IGp-$slt+Zb4 zaQLH7T(@^&f*P>`5nGb$9!(#(V5P(A+5A~6agB#BMp%u5&$rTCjhnBtQoY8by%TgT zNKw^qFQSH(6t^%UEM(QY z`P&xq=?nRG3)Sm$d5eW!(R=tS7CNKP;wvpQtatEg3#A%zx!*#wFx+pUH3rYLnb<}< zo+|Q`%&&;z>R^k+Z?~|)K9t4`du^%{1>LM{$P%L@=Ub@PFw5u$C0adCLT*|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?TJ7_d!D-_6x?0APZ>Yi>Mf=33M2A40Hl?7IYbO19TT;B*t8z QOwd?RE@8^sG;gNo|0ad!xBvhE diff --git a/!TheEsc/Makefile,fe1 b/!TheEsc/Makefile,fe1 index bd5a299..72b35e4 100644 --- a/!TheEsc/Makefile,fe1 +++ b/!TheEsc/Makefile,fe1 @@ -7,8 +7,8 @@ Linkflags = -aif -o $@ # Final targets: -@.!RunImage: @.o.CTheEscape @.o.Graphics @.o.Sound @.o.Input @.o.Intro @.o.Mission1 C:o.stubs - Link $(Linkflags) @.o.CTheEscape @.o.Graphics @.o.Sound @.o.Input @.o.Intro @.o.Mission1 C:o.stubs +@.!RunImage: @.o.CTheEscape @.o.Graphics @.o.Sound @.o.Input @.o.Intro @.o.Mission1 @.o.Mission2 C:o.stubs + Link $(Linkflags) @.o.CTheEscape @.o.Graphics @.o.Sound @.o.Input @.o.Intro @.o.Mission1 @.o.Mission2 C:o.stubs # User-editable dependencies: @@ -27,6 +27,9 @@ Linkflags = -aif -o $@ cc $(ccflags) -o @.o.Intro @.c.Intro @.o.Mission1: @.c.Mission1 cc $(ccflags) -o @.o.Mission1 @.c.Mission1 +@.o.Mission2: @.c.Mission2 + cc $(ccflags) -o @.o.Mission2 @.c.Mission2 + # Dynamic dependencies: @@ -59,3 +62,5 @@ o.Intro: c.Intro o.Intro: h.Graphics o.Mission1: c.Mission1 o.Mission1: h.Graphics +o.Mission2: c.Mission2 +o.Mission2: h.Graphics diff --git a/!TheEsc/c/CTheEscape b/!TheEsc/c/CTheEscape index 5056be2..995a552 100644 --- a/!TheEsc/c/CTheEscape +++ b/!TheEsc/c/CTheEscape @@ -36,7 +36,8 @@ 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; + int lastoutcome = 1; + int outcome = 0; sound_on(); // Set initial display mode @@ -49,18 +50,40 @@ int main(int argc, char *argv[]) // Intro titles + music intro(); + screen_flipbuffer(); screen_clear(); // Mission 1 - game1_briefing(); - screen_clear(); - - game1_setup(); - while(!lastoutcome) + while(lastoutcome == 1) { - lastoutcome = game1_tick(); + outcome = 0; + game1_briefing(); + screen_clear(); + game1_setup(); + while(!outcome) + { + outcome = game1_tick(); + } + lastoutcome = outcome; } + lastoutcome = 1; + + // Mission 2 + while(lastoutcome == 1) + { + outcome = 0; + game2_briefing(); + screen_clear(); + //game2_setup(); + while(!outcome) + { + outcome = game2_tick(); + } + lastoutcome = outcome; + } + + free(buffer); return 0; diff --git a/!TheEsc/c/Mission1 b/!TheEsc/c/Mission1 index 00ac72e..cbde188 100644 --- a/!TheEsc/c/Mission1 +++ b/!TheEsc/c/Mission1 @@ -724,7 +724,8 @@ void game_tick_input() // Q if(input_readkey(16)) - debugs[dbbase] = 1; + Player.integrity = 1000; +// debugs[dbbase] = 1; if(tick > Player.nextidlesprite) Player.sprite = Player.idlesprite; @@ -893,6 +894,8 @@ void game1_briefing() draw_sprite("spacebar",(DISPLAY_X/2)-106,50); + screen_flipbuffer(); + tick = clock(); while(1) { @@ -912,7 +915,11 @@ int game1_tick() screen_flipbuffer(); screen_clear(); - if(Player.integrity > 0) + if(Player.integrity > 200) + { + return 2; + } + else if(Player.integrity > 0) { PROFILE(game_tick_stars()); PROFILE(game_tick_input()); diff --git a/!TheEsc/c/Mission2 b/!TheEsc/c/Mission2 new file mode 100644 index 0000000..db2342f --- /dev/null +++ b/!TheEsc/c/Mission2 @@ -0,0 +1,117 @@ +#include "Graphics.h" + +//#defene PROFILE(X) lastprofile = clock(); X; printf("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t%s %i\n", #X, (clock() - lastprofile)) +#define PROFILE(X) X + +extern int tick; +extern int lasttick; + +void game2_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 + 100)) + { + if(input_readkey(98)) + sound_composition_stop(); + } + } +} + +void game2_briefing() +{ + screen_clear(); + + draw_spritetext( +"~~~~~~~~{chief engineers log - uss archimedes - stardate 1234567890 ~~==========~~===============}\n\n\nYour mission is to be dead until I make mission 2. \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n~~~~~~~~{==========================================~~~~~~~~=======}" +, 50, 950); + + draw_sprite("spacebar",(DISPLAY_X/2)-106,50); + + screen_flipbuffer(); + + tick = clock(); + while(1) + { + if(clock() > (tick + 100)) + { + if(input_readkey(98)) + return; + } + } +} + +int game2_tick() +{ + lasttick = tick; + tick = clock(); + + screen_flipbuffer(); + screen_clear(); + + if(0) + { + return 0; + }else{ + screen_flipbuffer(); + screen_clear(); + game2_death(); + return 1; + } + + +} diff --git a/README.md b/README.md index ad82ab8..76300a2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Left Arrow: Left Right Arrow: Right -Q: Display debug info (then numbers to select debug action) - Currently non-functioning +Q: Skip level (will be removed) Space Bar: Fire phasers