Wow, it worked now!! After you explained it I actually remembered reading something about this in the readme but didn't think of using it here like this. Anyways this is my working code now:
Code:
//Sugar rush counter
bool onDrawLives(jjPLAYER@ player, jjCANVAS@ screen) {
screen.drawSprite(590, 45, ANIM::PICKUPS, 1, jjGameTicks>>2, -1, SPRITE::NORMAL);
screen.drawSprite(580, 30, ANIM::PICKUPS, 13, jjGameTicks>>2, -1, SPRITE::NORMAL);
screen.drawString(570, 15, "SUGAR RUSH", STRING::SMALL, STRING::PALSHIFT, 16);
screen.drawString(600, 35, formatInt(player.food%100, "1") + " / 100", STRING::MEDIUM, STRING::PALSHIFT, 16);
return false;
}
//Sound effect for getting key
void onFunction100(jjPLAYER@ player) {
if (!jjTriggers[21]) {
jjTriggers[21] = true;
jjSample(player.xPos, player.yPos, SOUND::COMMON_ITEMTRE);
}
}
I think I'm gonna choose another sound though, now that I heard it come together. And is there a way to make it louder? Probably not necessary but just wondering, might be nice as a final touch.
|