mirror of
https://github.com/stevenhowes/CTheEscape.git
synced 2026-05-26 15:53:29 +01:00
Some prep for mission 2 and mission re-attempts/success
This commit is contained in:
Binary file not shown.
@@ -7,8 +7,8 @@ Linkflags = -aif -o $@
|
|||||||
|
|
||||||
|
|
||||||
# Final targets:
|
# Final targets:
|
||||||
@.!RunImage: @.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 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:
|
# User-editable dependencies:
|
||||||
@@ -27,6 +27,9 @@ Linkflags = -aif -o $@
|
|||||||
cc $(ccflags) -o @.o.Intro @.c.Intro
|
cc $(ccflags) -o @.o.Intro @.c.Intro
|
||||||
@.o.Mission1: @.c.Mission1
|
@.o.Mission1: @.c.Mission1
|
||||||
cc $(ccflags) -o @.o.Mission1 @.c.Mission1
|
cc $(ccflags) -o @.o.Mission1 @.c.Mission1
|
||||||
|
@.o.Mission2: @.c.Mission2
|
||||||
|
cc $(ccflags) -o @.o.Mission2 @.c.Mission2
|
||||||
|
|
||||||
|
|
||||||
# Dynamic dependencies:
|
# Dynamic dependencies:
|
||||||
|
|
||||||
@@ -59,3 +62,5 @@ o.Intro: c.Intro
|
|||||||
o.Intro: h.Graphics
|
o.Intro: h.Graphics
|
||||||
o.Mission1: c.Mission1
|
o.Mission1: c.Mission1
|
||||||
o.Mission1: h.Graphics
|
o.Mission1: h.Graphics
|
||||||
|
o.Mission2: c.Mission2
|
||||||
|
o.Mission2: h.Graphics
|
||||||
|
|||||||
+30
-7
@@ -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 main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int lastoutcome = 0;
|
int lastoutcome = 1;
|
||||||
|
int outcome = 0;
|
||||||
sound_on();
|
sound_on();
|
||||||
|
|
||||||
// Set initial display mode
|
// Set initial display mode
|
||||||
@@ -49,18 +50,40 @@ int main(int argc, char *argv[])
|
|||||||
// Intro titles + music
|
// Intro titles + music
|
||||||
intro();
|
intro();
|
||||||
|
|
||||||
|
screen_flipbuffer();
|
||||||
screen_clear();
|
screen_clear();
|
||||||
|
|
||||||
// Mission 1
|
// Mission 1
|
||||||
game1_briefing();
|
while(lastoutcome == 1)
|
||||||
screen_clear();
|
|
||||||
|
|
||||||
game1_setup();
|
|
||||||
while(!lastoutcome)
|
|
||||||
{
|
{
|
||||||
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);
|
free(buffer);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+9
-2
@@ -724,7 +724,8 @@ void game_tick_input()
|
|||||||
|
|
||||||
// Q
|
// Q
|
||||||
if(input_readkey(16))
|
if(input_readkey(16))
|
||||||
debugs[dbbase] = 1;
|
Player.integrity = 1000;
|
||||||
|
// debugs[dbbase] = 1;
|
||||||
|
|
||||||
if(tick > Player.nextidlesprite)
|
if(tick > Player.nextidlesprite)
|
||||||
Player.sprite = Player.idlesprite;
|
Player.sprite = Player.idlesprite;
|
||||||
@@ -893,6 +894,8 @@ void game1_briefing()
|
|||||||
|
|
||||||
draw_sprite("spacebar",(DISPLAY_X/2)-106,50);
|
draw_sprite("spacebar",(DISPLAY_X/2)-106,50);
|
||||||
|
|
||||||
|
screen_flipbuffer();
|
||||||
|
|
||||||
tick = clock();
|
tick = clock();
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
@@ -912,7 +915,11 @@ int game1_tick()
|
|||||||
screen_flipbuffer();
|
screen_flipbuffer();
|
||||||
screen_clear();
|
screen_clear();
|
||||||
|
|
||||||
if(Player.integrity > 0)
|
if(Player.integrity > 200)
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
else if(Player.integrity > 0)
|
||||||
{
|
{
|
||||||
PROFILE(game_tick_stars());
|
PROFILE(game_tick_stars());
|
||||||
PROFILE(game_tick_input());
|
PROFILE(game_tick_input());
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user