Skip to content
This repository was archived by the owner on Apr 19, 2022. It is now read-only.

Commit af81615

Browse files
authored
Merge pull request #331 from ModusCreateOrg/330
330
2 parents cb507f8 + 5a0c16b commit af81615

12 files changed

+1878
-86
lines changed

Diff for: Evade2/Attract.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ static const char scout_text[] PROGMEM = "SCOUT";
99
static const char bomber_text[] PROGMEM = "BOMBER";
1010
static const char assault_text[] PROGMEM = "ASSAULT";
1111

12-
static const char credits1[] PROGMEM = "CRAFTED BY:\nMODUS CREATE\nDECEMBER 2017\n\n\nhttp://modus.co";
13-
static const char credits2[] PROGMEM = "MUSIC and SFX:\nJAY GARCIA";
14-
static const char credits3[] PROGMEM = "ART:\nMICHAEL TINTIUC\nJON VAN DALEN\nJD JONES\nJAY GARCIA";
15-
static const char credits4[] PROGMEM = "PROGRAMMING:\nMIKE SCHWARTZ\nJAY GARCIA\nMICHAEL TINTIUC\n";
16-
static const char credits5[] PROGMEM = "PROGRAMMING:\nDELIO BRIGNOLI\nSETH LEMMONS\nANDY DENNIS";
17-
static const char credits6[] PROGMEM = "PROGRAMMING:\nVADIM POPA\nLUCAS STILL\nGRGUR GRISOGONO";
12+
static const char credits1[] PROGMEM = "CRAFTED BY:\nMODUS CREATE\nDECEMBER 2017";
13+
static const char credits2[] PROGMEM = "MUSIC and SFX:\nJ. GARCIA";
14+
static const char credits3[] PROGMEM = "ART:\nM. TINTIUC\nJV DALEN\nJD JONES\nJ. GARCIA";
15+
static const char credits4[] PROGMEM = "PROGRAMMING:\nM. SCHWARTZ\nJ. GARCIA\nM. TINTIUC\n";
16+
static const char credits5[] PROGMEM = "PROGRAMMING:\nD. BRIGNOLI\nS. LEMMONS\nA. DENNIS";
17+
static const char credits6[] PROGMEM = "PROGRAMMING:\nV. POPA\nL. STILL\nG. GRISOGONO";
1818

1919
const BYTE MAX_SCREEN = 2;
2020
const BYTE MAX_CREDITS = 5;
@@ -138,7 +138,7 @@ void Attract::typewriter(Process *me, Object *o) {
138138
Graphics::drawVectorGraphic(Enemy::enemy_graphic(ad->enemy), 64.0, 24.0, 0.0, 2.0);
139139
}
140140
if (game_mode == MODE_CREDITS) {
141-
Font::scale = .85 * 256;
141+
Font::scale = .9 * 256;
142142
}
143143
PGM_P p = ad->text;
144144
BYTE x = ad->x, y = ad->y;

Diff for: Evade2/Boss.cpp

+30-36
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ static void engage_player_random_xy(Object *o) {
7070
// Font::printf(5, 15, "%f", o->y - Camera::y);
7171

7272
if (o->state == 1) {
73-
o->theta += 5 * Game::wave;
73+
o->theta += 5 + Game::difficulty;
7474
}
7575
else {
76-
o->theta -= 5 * Game::wave;
76+
o->theta -= 5 + Game::difficulty;
7777
}
7878
// Debug
7979
// o->x = Camera::x;
@@ -83,7 +83,7 @@ static void engage_player_random_xy(Object *o) {
8383
return;
8484
}
8585
EBullet::fire(o, EBULLET_BOMB);
86-
o->timer = Game::wave > 10 ? 0 : (20 - Game::difficulty);
86+
o->timer = Game::wave > 20 ? 10 : (40 - Game::difficulty);
8787
// Keep within bounds of the screen
8888
if (o->x - Camera::x < -300) {
8989
o->vx = random(3, 10 + Game::difficulty);
@@ -141,7 +141,7 @@ static void engage_player_flee(Object *o) {
141141
}
142142
EBullet::fire(o, EBULLET_BOMB);
143143

144-
o->timer = Game::wave > 10 ? 0 : (20 - Game::wave);
144+
o->timer = Game::wave > 20 ? 20 : (50 - Game::difficulty);
145145
// o->x = Camera::x;
146146
// o->y = Camera::y;
147147
o->vx += random(-7, 7);
@@ -155,7 +155,7 @@ static void init_orbit(Object *o, BOOL left) {
155155
o->x = cos(angle) * 256;
156156
o->z = Camera::z + sin(angle) * 256;
157157
o->y = Camera::y + random(30, 90);
158-
o->vy = random(-5, 5) + (Game::difficulty * 2);
158+
o->vy = random(-6 + (Game::difficulty * -1), 6 + (Game::difficulty));
159159
o->vx = 0;
160160
o->vz = -50 - (Game::difficulty * 2);
161161
o->state = left ? 0 : 180;
@@ -193,9 +193,10 @@ static void engage_player_orbit(Object *o) {
193193
o->z = Camera::z + sin(rad) * 512;
194194

195195
if (--o->timer <= 0) {
196-
o->timer = Game::wave > 10 ? 0 : (20 - Game::wave);
196+
o->timer = Game::wave > 20 ? 20 : (50 - Game::difficulty);
197197
EBullet::fire(o, EBULLET_BOMB);
198198
}
199+
199200
}
200201

201202
/**
@@ -236,12 +237,12 @@ void Boss::action(Process *me, Object *o) {
236237
o->lines = NULL;
237238

238239
if (Boss::boss_type == 1) {
239-
o->y = random(-5, 5);
240+
// o->y = random(-5, 5);
240241
o->state = (o->state == 1) ? 0 : 1;
241242
}
242-
else if (Boss::boss_type == 2) {
243-
init_orbit(o, random() & 1);
244-
}
243+
// else if (Boss::boss_type == 2) {
244+
// init_orbit(o, random() & 1);
245+
// }
245246
// else {
246247
// randomize_flee(o);
247248
// }
@@ -304,48 +305,41 @@ void Boss::start_action(Process *me, Object *o) {
304305

305306
void Boss::entry(Process *me, Object *o) {
306307
// production
307-
Boss::boss_type = random(1, 3);
308-
309-
// Debugging
310-
// Boss::boss_type = 1;
311-
312308
game_mode = MODE_NEXT_WAVE;
313309
Game::kills = 0;
314310
Camera::vz = -20;
315311

316312
o->set_type(OTYPE_ENEMY);
317-
o->lines = getBossLines();
318313
o->z = Camera::z + z_dist;
319314

320315
o->state = 0;
321316
o->vz = Camera::vz;
322317

323318

324-
325-
// PRODUCTION
326-
Boss::hit_points = 10 + (Game::difficulty * Boss::boss_type);
327-
328-
//DEBUG
329-
// Boss::hit_points = 1;
330-
331-
332-
333-
if (Boss::boss_type == 1) {
334-
o->x = Camera::x + 512;
335-
o->vx = -10;
336-
o->y = Camera::y;
337-
Sound::play_score(STAGE_1_BOSS_SONG);
319+
if (Game::wave % 3 == 0) {
320+
Boss::boss_type = 3;
321+
o->x = Camera::x - 512;
322+
o->vx = +10;
323+
o->vy = random(-3, 3);
324+
Sound::play_score(STAGE_3_BOSS_SONG);
338325
}
339-
else if (Boss::boss_type == 2) {
326+
else if (Game::wave % 2 == 0) {
327+
Boss::boss_type = 2;
340328
init_orbit(o, random() & 1);
341329
Sound::play_score(STAGE_2_BOSS_SONG);
342330
}
343-
else {
344-
o->x = Camera::x - 512;
345-
o->vx = +10;
346-
o->vy = random(-3, 3);
347-
Sound::play_score(STAGE_3_BOSS_SONG);
331+
else {
332+
Boss::boss_type = 1;
333+
o->x = Camera::x + 512;
334+
o->vx = -10;
335+
o->y = Camera::y;
336+
Sound::play_score(STAGE_1_BOSS_SONG);
348337
}
349338

339+
o->lines = getBossLines();
340+
341+
// PRODUCTION
342+
Boss::hit_points = 20 + (Game::difficulty * Boss::boss_type);
343+
// Boss::hit_points = 1;
350344
me->sleep(1, Boss::start_action);
351345
}

Diff for: Evade2/Camera.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void Camera::move() {
1717
// return TRUE if o collides with player
1818
BOOL Camera::collides_with(Object *o) {
1919
// If enemy bullet collides with player
20-
if (abs(o->z - Camera::z) < abs(o->vz) && abs(o->x - Camera::x) < 128 && abs(o->y - Camera::y) < 64) {
20+
if (abs(o->z - Camera::z) < abs(o->vz) && abs(o->x - Camera::x) < 64 && abs(o->y - Camera::y) < 64) {
2121
return TRUE;
2222
}
2323
return FALSE;

Diff for: Evade2/EBullet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void EBullet::run() {
4040
}
4141

4242
BOOL EBullet::fire(Object *oo, BYTE type) {
43-
const FLOAT frames = 64 / Game::difficulty; // time to hit player (how many ticks)
43+
const FLOAT frames = 90 / Game::difficulty; // time to hit player (how many ticks)
4444

4545
if (game_mode != MODE_GAME) {
4646
return FALSE;

Diff for: Evade2/Enemy.cpp

+14-10
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ static void init_scout(Object *o) {
113113
static void init_bomber(Object *o) {
114114
o->x = Camera::x + 128 - random(0, 127);
115115
o->y = Camera::y + 128 - random(0, 127);
116-
o->z = Camera::z - 10;
117-
o->vz = CAMERA_VZ + 2;
116+
o->z = Camera::z - 30;
117+
o->vz = CAMERA_VZ + 1 + Game::wave;
118118
o->vx = o->vy = 0;
119119
}
120120

@@ -132,21 +132,23 @@ void Enemy::init(Process *me, Object *o) {
132132
o->timer = FIRE_TIME;
133133
o->theta = 0;
134134

135-
switch (random(0, 3)) {
135+
136+
// One enemy type enters per wave
137+
switch (random(0, (Game::wave > 3) ? 3 : Game::wave)) {
136138
case 0:
137-
o->lines = (const BYTE *)&enemy_assault_1_img;
138-
init_assault(o, random() & 1);
139-
me->sleep(1, orbit);
139+
o->lines = (const BYTE *)&enemy_scout_1_img;
140+
init_scout(o);
141+
me->sleep(1, seek);
140142
break;
141143
case 1:
142144
o->lines = (const BYTE *)&enemy_heavy_bomber_1_img;
143145
init_bomber(o);
144146
me->sleep(1, evade);
145147
break;
146148
case 2:
147-
o->lines = (const BYTE *)&enemy_scout_1_img;
148-
init_scout(o);
149-
me->sleep(1, seek);
149+
o->lines = (const BYTE *)&enemy_assault_1_img;
150+
init_assault(o, random() & 1);
151+
me->sleep(1, orbit);
150152
break;
151153
}
152154
}
@@ -172,7 +174,9 @@ void Enemy::wait_init(Process *me, Object *o) {
172174
* number and then puts the Process into wait_init state.
173175
*/
174176
void Enemy::respawn(Process *me, Object *o) {
175-
o->timer = random(0, 40) + 20;
177+
// o->timer = random(30, 40) + 20;
178+
o->timer = random(Game::wave > 6 ? 30 : 30, 60) + 30;
179+
176180
me->sleep(1, Enemy::wait_init);
177181
}
178182

Diff for: Evade2/Game.cpp

+21-10
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ UBYTE Game::kills;
77
const BYTE alert_top = 5;
88

99
const BYTE getStageSong() {
10-
if (Game::wave % 3 == 0) {
10+
if (Game::wave % 4 == 0) {
11+
return INTRO_SONG;
12+
}
13+
else if (Game::wave % 3 == 0) {
1114
return STAGE_3_SONG;
1215
}
13-
if (Game::wave % 2 == 0) {
16+
else if (Game::wave % 2 == 0) {
1417
return STAGE_2_SONG;
1518
}
1619
return STAGE_1_SONG;
@@ -24,20 +27,25 @@ void Game::birth() {
2427
ProcessManager::birth(Enemy::entry);
2528
ProcessManager::birth(Enemy::entry);
2629
ProcessManager::birth(Enemy::entry);
27-
const BYTE num_asteroids = min(max(Game::wave, 3), 1) + 1;
28-
for (BYTE i = 0; i < num_asteroids; i++) {
29-
ProcessManager::birth(Asteroid::entry);
30-
}
30+
31+
if (Game::wave > 3) {
32+
const BYTE num_asteroids = min(max(Game::wave, 3), 1) + 1;
33+
for (BYTE i = 0; i < num_asteroids; i++) {
34+
ProcessManager::birth(Asteroid::entry);
35+
}
36+
}
3137
}
3238

33-
//TODO: Increase difficulty every 4 waves
3439
void Game::next_wave(Process *me, Object *o) {
3540
if (--Game::kills <= 0) {
3641
game_mode = MODE_GAME;
37-
Game::difficulty++;
3842
Game::kills = 0;
3943
Camera::vz = CAMERA_VZ;
4044
Game::wave++; // <-- Use this with Kills
45+
46+
if (Game::wave % 4 == 0) {
47+
Game::difficulty++;
48+
}
4149
Sound::play_score(getStageSong());
4250

4351
EBullet::genocide();
@@ -53,6 +61,7 @@ void Game::next_wave(Process *me, Object *o) {
5361
Font::printf(26, alert_top, "START WAVE %d", Game::wave + 1);
5462
Font::scale = 256;
5563
Player::recharge_shield();
64+
Player::recharge_power();
5665
me->sleep(1);
5766
}
5867
}
@@ -68,7 +77,9 @@ void Game::spawn_boss(Process *me, Object *o) {
6877
}
6978
else {
7079
Font::scale = 190;
71-
Font::printf(23, alert_top, "ACE APPROACHING!");
80+
Font::printf(35, alert_top, "WARP TO ACE!");
81+
Player::recharge_shield();
82+
Player::recharge_power();
7283
Font::scale = 256;
7384
me->sleep(1);
7485
}
@@ -82,7 +93,7 @@ void Game::run() {
8293
// if (Game::kills > (4 * Game::wave) * Game::difficulty) {
8394

8495
// Slower increase
85-
if (Game::kills > (5 * Game::difficulty) + Game::wave) {
96+
if (Game::kills > ((10 + Game::wave) * Game::difficulty)) {
8697

8798
game_mode = MODE_NEXT_WAVE;
8899
// next wave

Diff for: Evade2/Player.cpp

+32-19
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ void Player::recharge_shield() {
5353
}
5454
}
5555

56+
void Player::recharge_power() {
57+
if (power < MAX_POWER) {
58+
power++;
59+
}
60+
}
61+
5662
void Player::before_render() {
5763
if (game_mode != MODE_GAME) {
5864
Camera::vx = Camera::vy = 0;
@@ -214,26 +220,33 @@ void Player::after_render() {
214220
deltaXCrossHairs = 0,
215221
deltaYCrossHairs = 0;
216222

217-
if (Controls::pressed(JOYSTICK_RIGHT)) {
218-
consoleX = 38;
219-
deltaXMeter = -1;
220-
deltaXCrossHairs = 4;
221-
}
222-
else if (Controls::pressed(JOYSTICK_LEFT)) {
223-
consoleX = 42;
224-
deltaXMeter = 1;
225-
deltaXCrossHairs = -4;
226-
}
223+
// Font::scale = .6 * 256;
224+
// Font::printf(5,5,"D %d", Game::difficulty);
225+
// Font::printf(5,12,"W %d", Game::wave);
226+
// Font::scale = 256;
227+
if (game_mode != MODE_GAME) {
227228

228-
if (Controls::pressed(JOYSTICK_UP)) {
229-
consoleY = 56;
230-
deltaYMeter = -1;
231-
deltaYCrossHairs = 4;
232-
}
233-
else if (Controls::pressed(JOYSTICK_DOWN)) {
234-
consoleY = 60;
235-
deltaYMeter = 1;
236-
deltaYCrossHairs = -4;
229+
if (Controls::pressed(JOYSTICK_RIGHT)) {
230+
consoleX = 38;
231+
deltaXMeter = -1;
232+
deltaXCrossHairs = 4;
233+
}
234+
else if (Controls::pressed(JOYSTICK_LEFT)) {
235+
consoleX = 42;
236+
deltaXMeter = 1;
237+
deltaXCrossHairs = -4;
238+
}
239+
240+
if (Controls::pressed(JOYSTICK_UP)) {
241+
consoleY = 56;
242+
deltaYMeter = -1;
243+
deltaYCrossHairs = 4;
244+
}
245+
else if (Controls::pressed(JOYSTICK_DOWN)) {
246+
consoleY = 60;
247+
deltaYMeter = 1;
248+
deltaYCrossHairs = -4;
249+
}
237250
}
238251

239252
Graphics::drawBitmap(consoleX, consoleY, hud_console_img, 0x30, 0x08);

Diff for: Evade2/Player.h

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Player {
1818
public:
1919
static void init();
2020
static void recharge_shield();
21+
static void recharge_power();
2122

2223
static void hit(BYTE amount);
2324
// this is called before rendering everything

Diff for: Evade2/sound/SFX.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const PROGMEM struct SFX_next_attract_char_data {
7979
.fmt = ATM_SCORE_FMT_MINIMAL_MONO,
8080
.pattern0 = {
8181
ATM_CMD_M_SET_TEMPO(1),
82-
ATM_CMD_M_SET_VOLUME(60),
82+
ATM_CMD_M_SET_VOLUME(80),
8383
ATM_CMD_I_NOTE_D5,
8484
ATM_CMD_M_DELAY_TICKS(1),
8585
ATM_CMD_I_STOP,

0 commit comments

Comments
 (0)