diff --git a/!TheEsc/!RunImage,ff8 b/!TheEsc/!RunImage,ff8 index ef852ef..ec9d1b9 100644 Binary files a/!TheEsc/!RunImage,ff8 and b/!TheEsc/!RunImage,ff8 differ diff --git a/!TheEsc/Makefile,fe1 b/!TheEsc/Makefile,fe1 index 349038d..f826cb4 100644 --- a/!TheEsc/Makefile,fe1 +++ b/!TheEsc/Makefile,fe1 @@ -40,18 +40,14 @@ Squeezeflags = -o $@ # Dynamic dependencies: +o.Graphics: c.Graphics +o.Graphics: C:h.swis +o.Graphics: C:h.kernel +o.Graphics: C:h.kernel o.Input: c.Input o.Input: C:h.swis o.Input: C:h.kernel o.Input: C:h.kernel -o.Graphics: c.Graphics -o.Graphics: C:h.swis -o.Graphics: C:h.kernel -o.Graphics: C:h.kernel -o.Graphics: c.Graphics -o.Graphics: C:h.swis -o.Graphics: C:h.kernel -o.Graphics: C:h.kernel o.CTheEscape: c.CTheEscape o.CTheEscape: C:h.swis o.CTheEscape: C:h.kernel @@ -82,3 +78,4 @@ o.Mission2: h.Graphics o.Mission2: C:h.swis o.Mission2: C:h.kernel o.Mission2: C:h.kernel +o.Mission2: h.Sound diff --git a/!TheEsc/c/Mission2 b/!TheEsc/c/Mission2 index 1830057..befbeb6 100644 --- a/!TheEsc/c/Mission2 +++ b/!TheEsc/c/Mission2 @@ -1,6 +1,7 @@ #include "Graphics.h" #include "swis.h" #include +#include "Sound.h" extern int tick; extern int lasttick; @@ -53,6 +54,8 @@ struct TilePlayer_s { struct EntityLocation_s lastmapoffset; struct EntityLocation_s localtile; int rawtile; + int lastrawtile; + unsigned char direction; unsigned char facedirection; unsigned char sprite[13]; @@ -231,6 +234,12 @@ void game2_fillmap(int xoffset, int yoffset) memcpy(map[0][9],fullmap+yoffset+(xoffset*100)+900,10); } +void game2_setup_audio() +{ + sound_pcm_loadsample(PCMSAMPLE_HAIL,"sounds.commbdg"); + sound_pcm_loadsample(PCMSAMPLE_DOOR,"sounds.door"); +} + void game2_setup() { screen_flipbuffer(); @@ -256,7 +265,7 @@ void game2_setup() TilePlayer.animframe = 0; TilePlayer.nextanimframe = 0; TilePlayer.nextanimidle = 0; - + TilePlayer.lastrawtile = -1; memset(map[0],0xFF,100); memset(map[1],0xFF,100); memset(map[2],0xFF,100); @@ -264,6 +273,7 @@ void game2_setup() game2_loadmap("m2_map"); game2_loadsmarttiles("m2_smart"); game2_loadareanames("m2_areas"); + game2_setup_audio(); game2_fillmap(TilePlayer.mapoffset.X,TilePlayer.mapoffset.Y); } @@ -509,18 +519,21 @@ int game2_tick() } } + TilePlayer.lastrawtile = TilePlayer.rawtile; TilePlayer.rawtile = (TilePlayer.mapoffset.Y) + TilePlayer.localtile.Y + (TilePlayer.mapoffset.X * 100) + (TilePlayer.localtile.X * 100); - // Trigger any smart tiles for our centre of mass - for(i = 0; i < SMARTTILES; i++) + if(TilePlayer.rawtile != TilePlayer.lastrawtile) { - if(SmartTiles[i].Tile == TilePlayer.rawtile) + // Trigger any smart tiles for our centre of mass + for(i = 0; i < SMARTTILES; i++) { - // Change tile sprite - if(SmartTiles[i].Action == 0) - fullmap[SmartTiles[i].ActionTarget] = SmartTiles[i].ActionValue; - else if(SmartTiles[i].Action == 1) - sprintf(areaname,"%s",Areas[SmartTiles[i].ActionValue].name); + if(SmartTiles[i].Tile == TilePlayer.rawtile) + { + if(SmartTiles[i].Action == 0) // Change tile sprite + fullmap[SmartTiles[i].ActionTarget] = SmartTiles[i].ActionValue; + else if(SmartTiles[i].Action == 1) // Change area name + sprintf(areaname,"%s",Areas[SmartTiles[i].ActionValue].name); + } } } diff --git a/!TheEsc/h/Sound b/!TheEsc/h/Sound index ad3832f..2b8567b 100644 --- a/!TheEsc/h/Sound +++ b/!TheEsc/h/Sound @@ -44,7 +44,7 @@ enum pcmchannel_e{ PCMCHANNEL_NPC2 = 7, PCMCHANNEL_AMBIENT = 8 }; -enum pcmsample_e{PCMSAMPLE_DURNOTORPEDO, PCMSAMPLE_PHASER, PCMSAMPLE_SHIPEXPLODE, PCMSAMPLE_TRACTOR, PCMSAMPLE_HAIL, PCMSAMPLE_MAX}; +enum pcmsample_e{PCMSAMPLE_DURNOTORPEDO, PCMSAMPLE_PHASER, PCMSAMPLE_SHIPEXPLODE, PCMSAMPLE_TRACTOR, PCMSAMPLE_HAIL, PCMSAMPLE_DOOR, PCMSAMPLE_MAX}; struct CompositionElement { signed short int Start; diff --git a/!TheEsc/sounds/door b/!TheEsc/sounds/door new file mode 100644 index 0000000..53bdff8 --- /dev/null +++ b/!TheEsc/sounds/door @@ -0,0 +1 @@ +€€€€€€~€~€~€~€€€€~}€€„~€€}€€€~€€‚}|€ƒ~~€‚{}€‚‚€}€€‚‚€‚}}€~~~€€€}€~€€€€€~}ƒ€€‚~}{€}~‚~~€}~€€€~|€~‚…‚„~}~€‚„ƒ€{{{€‚~~€~~~{~~}‚„„€|~~€ƒ…ƒ€~}~~€ƒ„z{|„|~}€~‚ƒ~‚~z|€€‚~‚~€}}‚€„€ƒ~~‚ƒ{~{~}‚€ƒ~{~y~‚€€ƒ}~ƒ|€€‚€~~|~€~€~€‚ƒƒz{~ƒ„ƒ€~|~~~~€~}€‚€~}~~…‚~}}}€€~~}~„€|€€}ƒ€~|€‚ƒ~~}}~‚‚~~€~‚~~€€‚~‚}€|‚€€€~~}~~}{€€€|~€€‚‚~€€€~€~~|}~€‚ƒ‚|€‚‚€~~€€€€~~€€|€~€}~€€|€‚~~€€€~€~‚€€~€~€|€‚‚}‚}~€€€€~}€‚€€€€}‚~€‚~€€~~€€€}€}~€‚€~}€€€€€~~~€€}~~€€€€~€€€€~~€€€€~}~}~€€€~€~~}€€€€}€‚‚|ƒ~~€€€~€€€~~€}~~~‚€~€€€€€€~€~€~~€‚~€~‚~€~‚‚€€€~€~€€€€~€~€‚~€€€€€€~€€€€€‚€~€€}€€~€€€~€~‚€€~~€€~€€~€€€€~€€€~€€€€€€€}€€€€€~€€€€€€€€€€~€€~~€€~€~‚~€€€~€€~€}€€€~~€~€~‚}~~~~€€‚€~€~€€€€~€~€€€~‚€€€€€€~€}€€€~~€€€€€~~‚€€~€~}~€~€€€~~€€~€€€€~€~€~~€€€€€€~~ƒ~€€€€‚~~€€~€~€€€€€}€~€€€€€€€€}€€~€~~€€€}€€€~€€€€€€€~€€€€€€€€€€€€€~~€€~€}€€€€€€€€€€€€~‚€€€}‚~€~€~€€~€€~€€€€€€€~€€€€€€€~€€€€€~~€€~~€~€~€€€€~€‚€€~€€€€€€€€€€€€€~€~€~€~€€€‚~€~€~~€~‚~‚€~€~~‚€}‚€€€€~€~€€€~€~€€€~€€€€}~~€€~‚~€€€€€~€€€€‚€}€€€€€€~~€~€€€€~€€€€€}€€€~€‚}€€€€~€€~€€€€~€~€€€€€€€€€€€€€€€~€€~~€~€€~€‚~€~€€~€€}€€~€~€€~~€€~‚~€€€~€€~€€€€€}‚€~~€€€€€~€€€€|‚€‚~~~‚€~€~€‚€€€€€€~€€€~€}€€€ƒ}€€€€}€€€~€~€€€€€€~‚~€€€€€€€~€€€~€€€}€~~€€€€€€€€~€€€}€~~€~€€€€}‚~€~€€€~€€€€~€€~~€}€€‚~€~}€€~€€~€€€€€€€€~€~€}€€€€~~€€~€€€€€€€€€~€€€€~€~€~€€€~€~€€~€€~ƒ€€ƒ}€€€~~~€€€~€~€}‚€€~‚~€€€~‚€€€~€€€€€€€~€~€€~€€~€~€~€~€€~€€~~€€€€€€€}€€~‚€~€€€~~‚~}€€~~€€€~~€€~€€}‚€€~€~‚€€}€€€}€€~€€€€~€€€€€€}€€~€€~€€€‚~~€ƒ~}€~~€}€€€~~€~€~€€€€€~€~€€~€€~€~~ƒ€~€€~€€}€€€~€~€~€~€€~‚€‚€€€€‚~~€€€€‚€€‚~€€€~€€~€€~€€€~~€~€€€€€€}€‚€~~~~~‚€€~€€€€~~‚~~~€~€~€~€~€€€€~€€~€€€€€€}‚~~€~€€~€€€€€€€€€€€€€€~~‚€€~‚€}€€€‚~€€€€~€€€€€~€€€~€€‚}€~€€‚~‚~€~€€€€|}€€~€€}~ƒ}€‚~€€~€‚€~€€€€~€€~€€~€}€€€€~ƒ}‚}€~}€€~€~€€}€~‚~€~~€€€~€€‚~~€€€€€€€€€~€€€€~€€€€€~~€€~~€€~€€~€}~€~€€€}€}~€}‚€~€~€€€€€€€ƒ€~€€€€€€~€€€€~€€~€~€~€€€€~€€€€€€€}~€€~€€~€~~€€€~€€€~~€€€~€€€€€€€~€~€€€€€€€~€~€~~€~~€‚~€}€€€€~~~€~€€€~€~€€€€‚€~€€€€€~~~€~€~€€€~€€~€~‚€€€€~€€~€~€~€€~€€€€|‚€€€~€€€~€€~~‚€€~€~€}~€€€~€€€~€~€€€€€€€€€~€€€€€€€€€€~€~~€€€€€€~~~€~€~€€€€€€~€~€€€€€ƒ€€€€~€€~€~€€~~~€€€€€~€€}€€€€~€€€}€€€‚€€€€‚~~€~€€€~€~~€~~€€€€€€€€€€~€€€€~€€€~~€}‚€~€€€}‚€‚€€~€€€~~‚€~€}€~~€€€~~€~€€€€€~€€€€€~€€€~€€€€€€€~€€~€}€€€€€€€~€~€€€€€€€~€€€€€€~€€~€€€€€}~€€€€~€~€€€€€€€}€€€€~€€€€€€€~€~~€€€~€~€€‚~€€~€€€€€€~€€€€€€€€€€€€~€€~€€€€€~€€€€~~~€€~€€€€€€€€€€€€€€€€€€€€€€€€~€€€~€€€€€€€€€€~‚€€€€€€€€~€€€€~€€€€€€€€€€€€~€€~€€€~€€~€€€‚€€~~€€€€€€€€€€€€€€~€€€€€€€~€€€€€€€€€€€€€€€€€~€€€€€€€€€€€~€€€€€€€~€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€~€€€~€~€€€€€€€€€€€€€~€€€€€€~€€€~€€€€€€€€€€€€€€€€€€€€€€~€€€€€€~€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€~€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€€~€~€€€€€€€€€~€€€€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€~€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€ \ No newline at end of file