#pragma name "Blaster Charging" int puCount = 0; void blasterPU(jjOBJ@ bullet) { bullet.behave(BEHAVIOR::BULLET, false); jjDrawResizedSpriteFromCurFrame(bullet.xPos, bullet.yPos, bullet.curFrame, bullet.direction * 2, 2, SPRITE::TRANSLUCENT, 0, 4, 4, -1); } void onLevelLoad() { jjObjectPresets[OBJECT::BLASTERBULLETPU].behavior = blasterPU; } void onLevelBegin() { jjWeapons[1].allowedPowerup = true; } void onPlayerInput(jjPLAYER@ p) { if (p.currWeapon == 1 && !p.keyFire && puCount > 0) p.fireBullet(WEAPON::CURRENT, true, true, DIRECTION::CURRENT); if (p.currWeapon == 1 && p.keyFire) { p.noFire = true; puCount++; } else { p.noFire = false; puCount = 0; } if (puCount > 50) { if (puCount < 100) { jjWeapons[1].spread = SPREAD::NORMAL; } else { jjWeapons[1].spread = SPREAD::RFPU; puCount = 101; } p.powerup[1] = true; } else { p.powerup[1] = false; jjWeapons[1].spread = SPREAD::NORMAL; } } bool onDrawHealth(jjPLAYER@ play, jjCANVAS@ screen) { if (puCount < 100) { if (puCount < 50) { screen.drawRectangle(530, 450, puCount, 20, 22 - (puCount / 10), SPRITE::NORMAL, 123); } else { screen.drawRectangle(530, 450, puCount, 20, 86 - ((puCount - 50) / 10), SPRITE::NORMAL, 123); } } else { screen.drawRectangle(530, 450, puCount, 20, jjRandom()%50 + 10, SPRITE::NORMAL, 123); } return false; }