1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00

Use case-switch for para-check in entclass::setenemy()

It's less verbose this way, and less typing.
This commit is contained in:
Misa 2020-04-28 16:20:59 -07:00 committed by Ethan Lee
parent c6659ef656
commit 57b643d22a

View File

@ -88,8 +88,9 @@ void entclass::setenemy( int t )
{ {
case 0: case 0:
//lies emitter //lies emitter
if( (para)==0) switch ((int) para)
{ {
case 0:
tile = 60; tile = 60;
animate = 2; animate = 2;
colour = 6; colour = 6;
@ -97,9 +98,8 @@ void entclass::setenemy( int t )
w = 32; w = 32;
h = 32; h = 32;
x1 = -200; x1 = -200;
} break;
else if ( (para) == 1) case 1:
{
yp += 10; yp += 10;
oldyp += 10; oldyp += 10;
tile = 63; tile = 63;
@ -113,21 +113,22 @@ void entclass::setenemy( int t )
h = 10; h = 10;
cx = 1; cx = 1;
cy = 1; cy = 1;
} break;
else if ( (para) == 2) case 2:
{
tile = 62; tile = 62;
animate = 100; animate = 100;
colour = 6; colour = 6;
behave = -1; behave = -1;
w = 32; w = 32;
h = 32; h = 32;
break;
} }
break; break;
case 1: case 1:
//FACTORY emitter //FACTORY emitter
if( (para)==0) switch ((int) para)
{ {
case 0:
tile = 72; tile = 72;
animate = 3; animate = 3;
size = 9; size = 9;
@ -137,9 +138,8 @@ void entclass::setenemy( int t )
h = 40; h = 40;
cx = 0; cx = 0;
cy = 24; cy = 24;
} break;
else if ( (para) == 1) case 1:
{
xp += 4; xp += 4;
oldxp += 4; oldxp += 4;
yp -= 4; yp -= 4;
@ -154,15 +154,15 @@ void entclass::setenemy( int t )
h = 12; h = 12;
cx = 0; cx = 0;
cy = 6; cy = 6;
} break;
else if ( (para) == 2) case 2:
{
tile = 77; tile = 77;
animate = 100; animate = 100;
colour = 6; colour = 6;
behave = -1; behave = -1;
w = 32; w = 32;
h = 16; h = 16;
break;
} }
break; break;
default: default: