Skip to content

Commit

Permalink
AVALANCHE: Move initializations from ShootEmUp::setup() to the constr…
Browse files Browse the repository at this point in the history
…uctor.
  • Loading branch information
uruk committed Feb 25, 2014
1 parent e15dafb commit bb6b3e8
Showing 1 changed file with 10 additions and 32 deletions.
42 changes: 10 additions & 32 deletions engines/avalanche/shootemup.cpp
Expand Up @@ -46,13 +46,13 @@ const byte ShootEmUp::kFlashTime = 20; // If flash_time is <= this, the word "ti
ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_vm = vm;

_time = 0;
_time = 120;
for (int i = 0; i < 7; i++)
_stockStatus[i] = 0;
for (int i = 0; i < 99; i++) {
_sprites[i]._ix = 0;
_sprites[i]._iy = 0;
_sprites[i]._x = 0;
_sprites[i]._x = kFlag;
_sprites[i]._y = 0;
_sprites[i]._p = 0;
_sprites[i]._timeout = 0;
Expand All @@ -62,15 +62,15 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_sprites[i]._wipe = false;
}
_rectNum = 0;
_avvyWas = 0;
_avvyPos = 0;
_avvyAnim = 0;
_avvyFacing = 0;
_avvyWas = 320;
_avvyPos = 320;
_avvyAnim = 1;
_avvyFacing = kFacingLeft;
_altWasPressedBefore = false;
_throwNext = 0;
_throwNext = 74;
_firing = false;
for (int i = 0; i < 4; i++) {
_running[i]._x = 0;
_running[i]._x = kFlag;
_running[i]._y = 0;
_running[i]._frame = 0;
_running[i]._tooHigh = 0;
Expand All @@ -81,7 +81,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
}
for (int i = 0; i < 7; i++)
_hasEscaped[i] = false;
_count321 = 0;
_count321 = 255; // Counting down.
_howManyHaveEscaped = 0;
_escapeCount = 0;
_escaping = false;
Expand Down Expand Up @@ -344,32 +344,10 @@ void ShootEmUp::instructions() {
}

void ShootEmUp::setup() {
_score = 0;
_time = 120;

_cp = true;

_avvyWas = 320;
_avvyPos = 320;
_avvyAnim = 1;
_avvyFacing = kFacingLeft;

_altWasPressedBefore = false;
_throwNext = 74;
_firing = false;

for (int i = 0; i < 4; i++)
_running[i]._x = kFlag;

for (int i = 0; i < 99; i++)
_sprites[i]._x = kFlag;
_vm->_graphics->blackOutScreen();

newEscape();

_count321 = 255; // Counting down.

_vm->_graphics->blackOutScreen();

for (int i = 0; i < 7; i++) {
_stockStatus[i] = _vm->_rnd->getRandomNumber(1);
showStock(i);
Expand Down

0 comments on commit bb6b3e8

Please sign in to comment.