Pretty self-explanatory
Ok, so I made this program that's supposed to move a spaceship sideways. However, it acts really weird when I compile it and run it.
Code:
The solution will probably be so obvious, but I can't see anything wrong...
Ok, so I made this program that's supposed to move a spaceship sideways. However, it acts really weird when I compile it and run it.
Code:
// Main Function
void _main(void)
{
int key;
int pos = 10;
ClrScr();
unsigned char player[] = {0x42,0xC3,0xDB,0xDB,0xFF,0xFF,0x7E,0x24};
while((key = kbhit()) != KEY_ESC)
{
Sprite8(pos, 30, SPRITE_HEIGHT, player, LCD_MEM, SPRT_XOR);
if (key == KEY_LEFT)
{
pos-=2;
}
if (key == KEY_RIGHT)
{
pos+=2;
}
}
Sprite8(pos, 30, SPRITE_HEIGHT, player, LCD_MEM, SPRT_XOR);
}
The solution will probably be so obvious, but I can't see anything wrong...