Browse Source

decrement white score when shooting

Thomas B 1 month ago
parent
commit
cb8d910353
3 changed files with 14 additions and 3 deletions
  1. 8
    1
      README.md
  2. 1
    1
      docs/index.html
  3. 5
    1
      src/game.c

+ 8
- 1
README.md View File

@@ -12,16 +12,23 @@ A port of the GTA San Andreas Arcade Game Duality.
12 12
 
13 13
 ## Getting Started
14 14
 
15
-You need the [GBDK-2020](https://gbdk.org/docs/api/docs_getting_started.html) to build the ROM and [Gearboy](https://github.com/drhelius/Gearboy) to emulate it comfortably.
15
+You need the [GBDK-2020](https://gbdk.org/docs/api/docs_getting_started.html) to build the ROM and [Gearboy](https://github.com/drhelius/Gearboy), [SameBoy](https://sameboy.github.io/), [Emulicious](https://emulicious.net/) or [BGB](https://bgb.bircd.org/) to emulate it comfortably.
16 16
 Then just build a debug version and run it in the emulator, with debug symbols already loaded.
17 17
 
18 18
     make run
19
+    make sgb_run
20
+    make bgb_run
21
+
22
+Use SameBoy to test out the SGB border feature.
23
+Also see below for symbolic debugging with Emulicious.
19 24
 
20 25
 For the release build, simply add `GBDK_RELEASE=1` to your make invocation after running `make clean`.
21 26
 
22 27
     make clean
23 28
     make GBDK_RELEASE=1 run
24 29
 
30
+You can also directly write to a flashcart using `flashgbx` with `make flash`.
31
+
25 32
 ## IDE Integration
26 33
 
27 34
 I'm using [https://kate-editor.org/] which supports VSCode-style LSP and debugging with integrated plugins.

+ 1
- 1
docs/index.html View File

@@ -67,7 +67,7 @@
67 67
                 <tr><td>Select (V)</td><td>About</td></tr>
68 68
             </table>
69 69
             <p>Press Left or Right on the title screen to show either the black or white highscores. Press Select to show the about screen and build info. In-game press Start to pause and resume. While paused press Select to return to the menu.</p>
70
-            <p>Collect small white spheres to get +5 white score. Collect small black spheres to get +5 black score. The opposite color will reduce your score when collected. Large black holes will attract you and damage your ship when touched. Large white spheres will repel you and replenish your health when touched. Accelerating will reduce your fuel, which will recharge when not accelerating. You can shoot large spheres for +10 points.<p>
70
+            <p>Collect small white spheres to get +5 white score. Collect small black spheres to get +5 black score. The opposite color will reduce your score when collected. Shooting while you have a white score will reduce it by one. Large black holes will attract you and damage your ship when touched. Large white spheres will repel you and replenish your health when touched. Accelerating will reduce your fuel, which will recharge when not accelerating. You can shoot large spheres for +10 points.<p>
71 71
             <p>For a more detailed description of the original game check out the <a href="https://gta.fandom.com/wiki/Duality">Duality article on GTA Wiki</a>.</p>
72 72
         </div>
73 73
         <div class="text">

+ 5
- 1
src/game.c View File

@@ -172,6 +172,7 @@ int32_t game(void) NONBANKED {
172 172
         key_read();
173 173
 
174 174
         enum ACCELERATION acc = 0;
175
+        int32_t prev_score = score;
175 176
 
176 177
         if (key_pressed(J_LEFT)) {
177 178
             rot = (rot - 1) & (ROT_INVALID - 1);
@@ -315,6 +316,10 @@ int32_t game(void) NONBANKED {
315 316
 
316 317
             if (ret == OBJ_ADDED) {
317 318
                 snd_shot();
319
+
320
+                if (score > 0) {
321
+                    score--;
322
+                }
318 323
             }
319 324
         }
320 325
 
@@ -348,7 +353,6 @@ int32_t game(void) NONBANKED {
348 353
             hiwater = ship_hiwater;
349 354
         }
350 355
 
351
-        int32_t prev_score = score;
352 356
         int16_t damage = obj_do(&spd_x, &spd_y, &score, &hiwater, 0);
353 357
         if (damage > 0) {
354 358
             if (debug_flags & DBG_GOD_MODE) {

Loading…
Cancel
Save