Star.cpp cleanup
This commit is contained in:
parent
d641f508f2
commit
b1f698f863
1 changed files with 10 additions and 8 deletions
18
src/Star.cpp
18
src/Star.cpp
|
@ -27,12 +27,12 @@ static struct
|
||||||
RECT rect;
|
RECT rect;
|
||||||
} star[3];
|
} star[3];
|
||||||
|
|
||||||
void InitStar()
|
void InitStar(void)
|
||||||
{
|
{
|
||||||
//Clear stars
|
// Clear stars
|
||||||
memset(star, 0, sizeof(star));
|
memset(star, 0, sizeof(star));
|
||||||
|
|
||||||
//Position
|
// Position
|
||||||
star[0].x = gMC.x;
|
star[0].x = gMC.x;
|
||||||
star[0].y = gMC.y;
|
star[0].y = gMC.y;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ void InitStar()
|
||||||
star[2].x = gMC.x;
|
star[2].x = gMC.x;
|
||||||
star[2].y = gMC.y;
|
star[2].y = gMC.y;
|
||||||
|
|
||||||
//Speed
|
// Speed
|
||||||
star[0].xm = 0x400;
|
star[0].xm = 0x400;
|
||||||
star[0].ym = -0x200;
|
star[0].ym = -0x200;
|
||||||
|
|
||||||
|
@ -53,15 +53,17 @@ void InitStar()
|
||||||
star[2].ym = 0x200;
|
star[2].ym = 0x200;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActStar()
|
void ActStar(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
static int a;
|
static int a;
|
||||||
a++;
|
|
||||||
|
++a;
|
||||||
a %= 3;
|
a %= 3;
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (i = 0; i < 3; ++i)
|
||||||
{
|
{
|
||||||
if (i)
|
if (i != 0)
|
||||||
{
|
{
|
||||||
if (star[i - 1].x < star[i].x)
|
if (star[i - 1].x < star[i].x)
|
||||||
star[i].xm -= 0x80;
|
star[i].xm -= 0x80;
|
||||||
|
|
Loading…
Add table
Reference in a new issue