Skip to content

Commit dc34230

Browse files
committed
Version 0.3
1 parent 05fbb2f commit dc34230

File tree

3 files changed

+63
-23
lines changed

3 files changed

+63
-23
lines changed

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
An Amstrad CPC Remake of the classic Arcade and Home Game
44
by Dave Moore (c) 2023-2024
55

6-
**Currently in development with full release in 2024.**
6+
**Currently in development with full release in 2024!**
77
Coded in C using the fantastic [CPCTelera library](https://lronaldo.github.io/cpctelera/).
88

99
![](/promo/loading.png)
1010

11-
**One level Demo version fully playable**. The full version will also have:
11+
**One level Demo version (v0.3) fully playable**. The full version will also have:
1212

1313
* 10+ Fiendish Levels
1414
* Sound Effects and Music
1515
* Optional Arcade Mode Gameplay
1616
* Enhanced Graphics and Animations
1717

18-
**Works on both actual CPCs and in all standard CPC Emulators.**
18+
**Tested and Working on both actual CPCs and Emulators!**
1919

2020
Released with full source code (CPCTelera 1.5/SDCC required to compile) under the GPLv2 license.
2121

@@ -26,3 +26,23 @@ The basis for this remake is the original port by Mosaik Software available [her
2626

2727
![](/promo/demo.png)
2828
![](/promo/game.png)
29+
30+
**Version History**
31+
32+
*Version 0.3 (07/12/2023)*
33+
34+
* Decreased Slowdown in later stages of a Level
35+
* Added in-game Pause (P to pause/unpause)
36+
* In-game Quit (Q) now aborts the current game completely
37+
* Decreased size of compiled binary significantly
38+
39+
*Version 0.2 (06/12/2023)*
40+
41+
* Increased responsiveness of in-game controls.
42+
* When entering initials on the Hi-Score Table:
43+
* Joystick input no longer produces nonsense characters.
44+
* The DEL key removes the last character entered.
45+
46+
*Version 0.1 (05/12/2023)*
47+
48+
* Initial Release

nibdx.dsk

0 Bytes
Binary file not shown.

src/game.c

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static bool g_play_level(const u8 level, const u8 gems) {
180180

181181
volatile bool finished = false, success = false;
182182
volatile u16 count = 0;
183-
bool moved, eaten, move_l = false, move_r = false;
183+
bool paused, moved, eaten, move_l = false, move_r = false;
184184
u16 key_l, key_r;
185185
u8 c_offset = g_options[1] ? 0 : 2;
186186
u8 gems_left = gems;
@@ -195,26 +195,43 @@ static bool g_play_level(const u8 level, const u8 gems) {
195195
cpct_waitVSYNC();
196196

197197
/* Keep going until we've lost a life or cleared the level */
198+
paused = false;
198199
while (!finished) {
199200

200201
/* Work out Controls */
201-
key_l = controls[sn.direction][c_offset];
202-
key_r = controls[sn.direction][c_offset + 1];
203-
204-
cpct_scanKeyboard();
205-
move_l = cpct_isKeyPressed(key_l);
206-
move_r = cpct_isKeyPressed(key_r);
202+
if (frame_c % 3 == 0) {
203+
key_l = controls[sn.direction][c_offset];
204+
key_r = controls[sn.direction][c_offset + 1];
205+
206+
//cpct_scanKeyboard();
207+
cpct_scanKeyboard();
208+
move_l = cpct_isKeyPressed(key_l);
209+
move_r = cpct_isKeyPressed(key_r);
210+
211+
/* Quit Key */
212+
if (cpct_isKeyPressed(Key_Q)) {
213+
finished = true;
214+
success = false;
215+
lives = 0;
216+
}
207217

208-
/* Check for Quit */
209-
if (cpct_isKeyPressed(Key_Q))
210-
finished = true;
218+
/* Cheat Key */
219+
if (cpct_isKeyPressed(Key_C)) {
220+
finished = true;
221+
success = true;
222+
}
211223

212-
/* Cheat Key */
213-
if (cpct_isKeyPressed(Key_C)) {
214-
finished = true;
215-
success = true;
224+
/* Pause Key */
225+
if (cpct_isKeyPressed(Key_P)) {
226+
paused = !paused;
227+
if (paused)
228+
u_wait(1000);
229+
}
216230
}
217231

232+
if (paused)
233+
continue;
234+
218235
/* Main Loop */
219236
if (frame_c % 2 == 0) {
220237

@@ -235,12 +252,6 @@ static bool g_play_level(const u8 level, const u8 gems) {
235252
g_redraw_score(score);
236253
}
237254

238-
/* Check for Collision */
239-
if (s_check_collide(&sn)) {
240-
success = false;
241-
break;
242-
}
243-
244255
/* If we have eaten all the Gems! */
245256
if (gems_left == 0) {
246257

@@ -290,6 +301,15 @@ static bool g_play_level(const u8 level, const u8 gems) {
290301

291302
cpct_waitVSYNC();
292303
}
304+
305+
if (frame_c % 5 == 0) {
306+
307+
/* Check for Collision */
308+
if (s_check_collide(&sn)) {
309+
success = false;
310+
break;
311+
}
312+
}
293313
}
294314

295315
if (!success)

0 commit comments

Comments
 (0)