diff options
author | Alec Murphy <alec@checksum.fail> | 2020-04-04 09:49:53 -0400 |
---|---|---|
committer | Alec Murphy <alec@checksum.fail> | 2020-04-04 09:49:53 -0400 |
commit | ee9be47f3f5c7521d56156ff75958dcc98ca7a37 (patch) | |
tree | 2b86ab12ee42641d3140f451a0811f76efc90cb8 | |
parent | a1bb71b1be4a6f0726f415f7c411c2719a86f52d (diff) |
Fix game timing and health bug
-rw-r--r-- | Game.HC | 11 | ||||
-rw-r--r-- | Status.HC | 2 |
2 files changed, 9 insertions, 4 deletions
@@ -3,6 +3,8 @@ extern I64 palette_2E1EE; extern U0 update_palette_anim(); extern U0 fade_to_black(uint16 wait_time); +I64 last_wait = cnts.jiffies; + #define COSMO_INTERVAL 100 //Data @@ -66,6 +68,7 @@ U0 reset_game_state() word_32EAC = 0; energy_beam_enabled_flag = 1; byte_2E17C = 0; + health = num_health_bars + 1; sub_11062(); @@ -288,8 +291,6 @@ Bool executeTick() { map_display(); - //player_update_sprite(); - if (player_update_sprite() != 0) { return TRUE; } @@ -342,7 +343,11 @@ Bool executeTick() { U0 game_wait() { - Sleep(100); + while (last_wait + 100 > cnts.jiffies) + { + Sleep(1); + } + last_wait = cnts.jiffies; } U0 game_loop() @@ -3,7 +3,7 @@ extern uint32 score; extern U8 num_health_bars; -extern U8 health; +I64 health = 0; extern U32 num_stars_collected; extern U16 num_bombs; extern CDC *game_surface; |