shit lmao
This commit is contained in:
parent
06e8e735fb
commit
6adbe1882d
40 changed files with 608 additions and 361 deletions
38
src/main.c
38
src/main.c
|
|
@ -5,7 +5,7 @@
|
|||
#include "background.h"
|
||||
#include "bullets.h"
|
||||
#include "enemies.h"
|
||||
#include "humans.h"
|
||||
#include "treasure.h"
|
||||
#include "player.h"
|
||||
#include "stage.h"
|
||||
#include "chrome.h"
|
||||
|
|
@ -28,10 +28,12 @@ void clearLevel(){
|
|||
if(bullets[i].active) killBullet(i, FALSE);
|
||||
for(s16 i = 0; i < ENEMY_COUNT; i++)
|
||||
if(enemies[i].active){ enemies[i].hp = 0; killEnemy(i); }
|
||||
for(s16 i = 0; i < HUMAN_COUNT; i++)
|
||||
if(humans[i].active) killHuman(i);
|
||||
humanBeingCarried = FALSE;
|
||||
for(s16 i = 0; i < TREASURE_COUNT; i++)
|
||||
if(treasures[i].active) killTreasure(i);
|
||||
treasureBeingCarried = FALSE;
|
||||
collectedCount = 0;
|
||||
allTreasureCollected = FALSE;
|
||||
treasureCollectedClock = 0;
|
||||
// black out everything
|
||||
SPR_setVisibility(player.image, HIDDEN);
|
||||
VDP_clearTileMapRect(BG_A, 0, 0, 128, 32);
|
||||
|
|
@ -46,7 +48,7 @@ void loadGame(){
|
|||
XGM2_play(stageMusic);
|
||||
XGM2_setFMVolume(MUSIC_VOLUME);
|
||||
XGM2_setPSGVolume(MUSIC_VOLUME);
|
||||
player.recoveringClock = 120;
|
||||
player.recoveringClock = 240;
|
||||
killBullets = TRUE;
|
||||
started = TRUE;
|
||||
}
|
||||
|
|
@ -61,32 +63,41 @@ static void updateGame(){
|
|||
}
|
||||
if(levelClearClock >= 120){
|
||||
levelClearing = FALSE;
|
||||
player.pos.y = FIX32(112);
|
||||
player.camera = player.pos.x - FIX32(160);
|
||||
playerVelX = 0;
|
||||
loadBackground();
|
||||
loadChrome();
|
||||
loadLevel(level + 1);
|
||||
XGM2_play(stageMusic);
|
||||
SPR_setVisibility(player.image, VISIBLE);
|
||||
player.recoveringClock = 120;
|
||||
player.recoveringClock = 240;
|
||||
killBullets = TRUE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(levelWaitClock > 0){
|
||||
levelWaitClock--;
|
||||
if(levelWaitClock == 0){
|
||||
levelClearing = TRUE;
|
||||
levelClearClock = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(!paused){
|
||||
updatePlayer();
|
||||
updateBackground();
|
||||
if(clock % 2 == 0){
|
||||
updateEnemies();
|
||||
if(!gameOver && enemyCount == 0){
|
||||
if(!gameOver && enemyCount == 0 && levelWaitClock == 0){
|
||||
if(level >= LEVEL_COUNT - 1){
|
||||
gameOver = TRUE;
|
||||
XGM2_stop();
|
||||
} else {
|
||||
levelClearing = TRUE;
|
||||
levelClearClock = 0;
|
||||
XGM2_stop();
|
||||
levelWaitClock = 240;
|
||||
killBullets = TRUE;
|
||||
}
|
||||
}
|
||||
updateHumans();
|
||||
updateTreasures();
|
||||
} else {
|
||||
updateBullets();
|
||||
}
|
||||
|
|
@ -95,7 +106,8 @@ static void updateGame(){
|
|||
|
||||
int main(bool hardReset){
|
||||
loadInternals();
|
||||
loadStart();
|
||||
if(SKIP_START) loadGame();
|
||||
else loadStart();
|
||||
while(1){
|
||||
if(started) updateGame();
|
||||
else updateStart();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue