Alternate ammo display

Version:

1.0

Added on:

03 Mar 2015 23:16

Tags:

Description:
Instead of displaying your ammo count as a number, displays it as a horizontal line of (mostly translucent) pickup animations
const array<uint8> gunProfilePics =    {0, 83+20+33, 25, 29, 34, 49, 57, 59, 62, 68};
const array<uint8> gunPoweredProfilePics =  {0, 18, 24, 28, 33, 48, 56, 59, 61, 67};
bool onDrawAmmo(jjPLAYER@ play, jjCANVAS@ screen) {
  uint8 an;
  if (play.powerup[WEAPON::CURRENT]) an = gunPoweredProfilePics[play.currWeapon];
  else an = gunProfilePics[play.currWeapon];
  if (play.currWeapon == WEAPON::BLASTER && play.charCurr == CHAR::SPAZ) ++an;

  for (int8 i = 0; i < play.ammo[WEAPON::CURRENT]; ++i )
    screen.drawSprite(jjSubscreenWidth - 20 - i*(jjSubscreenWidth/128), jjSubscreenHeight - 20, 0, an, (jjRenderFrame+i)/5, 0, (i+1 == play.ammo[WEAPON::CURRENT]) ? SPRITE::NORMAL : SPRITE::TRANSLUCENT);
  return true;
}