tangstad/helds
tangstad
/
helds
Archived
1
0
Fork 0

Changed shading of s-piece.

Added small animation of brick moving into place.
This commit is contained in:
Truls Alexander Tangstad 2005-11-09 21:30:34 +00:00
parent 4716d0f60a
commit 229972274f
3 changed files with 18 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -36,6 +36,15 @@ void VblankInterrupt()
ScanKeys(); ScanKeys();
} }
void move_show_and_wait(u16 x, u16 y, u16 wait_ticks) {
// assume we are in vblank
sprite.attr1 = OBJ_X(x);
sprite.attr0 = OBJ_256_COLOR | OBJ_Y(y);
CpuFastSet(&sprite, OAM, COPY32 | sizeof(sprite)/4);
u16 i;
for (i=0; i<wait_ticks; i++) VBlankIntrWait();
}
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// Program entry point // Program entry point
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
@ -64,15 +73,20 @@ int main(void)
CpuFastSet(PaletteBuffer, OBJ_COLORS, COPY32 | sizeof(PaletteBuffer)/4); CpuFastSet(PaletteBuffer, OBJ_COLORS, COPY32 | sizeof(PaletteBuffer)/4);
memset(&sprite, 0, sizeof(sprite)); memset(&sprite, 0, sizeof(sprite));
sprite.attr0 = OBJ_256_COLOR | OBJ_Y(74);
sprite.attr1 = OBJ_X(147);
sprite.attr2 = OBJ_CHAR(512); sprite.attr2 = OBJ_CHAR(512);
while (1) while (1)
{ {
VBlankIntrWait(); VBlankIntrWait();
sprite.attr0 = OBJ_256_COLOR | OBJ_Y(frame); move_show_and_wait(147, 74, 60);
CpuFastSet(&sprite, OAM, COPY32 | sizeof(sprite)/4); move_show_and_wait(147, 76, 60);
move_show_and_wait(147, 78, 30);
move_show_and_wait(145, 78, 30);
move_show_and_wait(145, 80, 60);
move_show_and_wait(145, 82, 60);
move_show_and_wait(145, 84, 60);
move_show_and_wait(145, 86, 60);
move_show_and_wait(145, 88, 180);
} }
} }