Alternate ammo display

Version:

1.0

Added on:

04 Mar 2015 00:16

Tags:

Description:
Instead of displaying your ammo count as a number, displays it as a horizontal line of (mostly translucent) pickup animations
  1. const array<uint8> gunProfilePics =    {0, 83+20+33, 25, 29, 34, 49, 57, 59, 62, 68};
  2. const array<uint8> gunPoweredProfilePics =  {0, 18, 24, 28, 33, 48, 56, 59, 61, 67};
  3. bool onDrawAmmo(jjPLAYER@ play, jjCANVAS@ screen) {
  4.   uint8 an;
  5.   if (play.powerup[WEAPON::CURRENT]) an = gunPoweredProfilePics[play.currWeapon];
  6.   else an = gunProfilePics[play.currWeapon];
  7.   if (play.currWeapon == WEAPON::BLASTER && play.charCurr == CHAR::SPAZ) ++an;
  8.  
  9.   for (int8 i = 0; i < play.ammo[WEAPON::CURRENT]; ++i )
  10.     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);
  11.   return true;
  12. }