mirror of
https://github.com/jeremysrand/apple2048.git
synced 2024-09-27 13:54:30 +00:00
Some small improvements
This commit is contained in:
parent
3b271d3c97
commit
5ea3682f70
14
apple2048.c
14
apple2048.c
@ -52,9 +52,11 @@ void shortDelay(uint16_t howMuch)
|
|||||||
|
|
||||||
void playSound(int8_t freq, int16_t duration)
|
void playSound(int8_t freq, int16_t duration)
|
||||||
{
|
{
|
||||||
|
if (!gPlaySounds)
|
||||||
|
return;
|
||||||
|
|
||||||
while (duration > 0) {
|
while (duration > 0) {
|
||||||
if (gPlaySounds)
|
asm ("STA %w", 0xc030);
|
||||||
asm ("STA %w", 0xc030);
|
|
||||||
while (freq > 0) {
|
while (freq > 0) {
|
||||||
freq--;
|
freq--;
|
||||||
}
|
}
|
||||||
@ -215,7 +217,7 @@ void performAnimationsLeft(void)
|
|||||||
animInProgress = true;
|
animInProgress = true;
|
||||||
printValueAt(x, y, tileAnim->tileString);
|
printValueAt(x, y, tileAnim->tileString);
|
||||||
}
|
}
|
||||||
playSound(200, 2);
|
playSound(200, 1);
|
||||||
}
|
}
|
||||||
firstFrame = false;
|
firstFrame = false;
|
||||||
} while (animInProgress);
|
} while (animInProgress);
|
||||||
@ -270,7 +272,7 @@ void performAnimationsRight(void)
|
|||||||
animInProgress = true;
|
animInProgress = true;
|
||||||
printValueAt(x, y, tileAnim->tileString);
|
printValueAt(x, y, tileAnim->tileString);
|
||||||
}
|
}
|
||||||
playSound(200, 2);
|
playSound(200, 1);
|
||||||
}
|
}
|
||||||
firstFrame = false;
|
firstFrame = false;
|
||||||
} while (animInProgress);
|
} while (animInProgress);
|
||||||
@ -321,7 +323,7 @@ void performAnimationsUp(void)
|
|||||||
animInProgress = true;
|
animInProgress = true;
|
||||||
printValueAt(x, y, tileAnim->tileString);
|
printValueAt(x, y, tileAnim->tileString);
|
||||||
}
|
}
|
||||||
playSound(200, 2);
|
playSound(200, 1);
|
||||||
}
|
}
|
||||||
firstFrame = false;
|
firstFrame = false;
|
||||||
} while (animInProgress);
|
} while (animInProgress);
|
||||||
@ -372,7 +374,7 @@ void performAnimationsDown(void)
|
|||||||
animInProgress = true;
|
animInProgress = true;
|
||||||
printValueAt(x, y, tileAnim->tileString);
|
printValueAt(x, y, tileAnim->tileString);
|
||||||
}
|
}
|
||||||
playSound(200, 2);
|
playSound(200, 1);
|
||||||
}
|
}
|
||||||
firstFrame = false;
|
firstFrame = false;
|
||||||
} while (animInProgress);
|
} while (animInProgress);
|
||||||
|
Loading…
Reference in New Issue
Block a user