# Releasing power up pills

**URL:** <https://forum.kirupa.com/t/releasing-power-up-pills/203641>\
**Category:** Uncategorized\
**Created:** [October 12, 2006, 6:23pm UTC](https://forum.kirupa.com/t/releasing-power-up-pills/203641 "2006-10-12T18:23:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![graylensman](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@graylensman](https://forum.kirupa.com/u/graylensman)\
**Post date:** [October 12, 2006, 6:23pm UTC](https://forum.kirupa.com/t/releasing-power-up-pills/203641/1 "2006-10-12T18:23:33Z")

</div>

Hi all! I’m working on a simple space shooter game (a great way to learn actionscript, I’m finding). Here’s a bit of weirdness I’m struggling with:

Every so often, power-up pills go floating by. There are three varieties, two weapons and deflector screens. To make the appropriate pill show up, I’m using this sort code:

```
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#808080]*//npi is a counter for incrementing*[/COLOR]

```

npi = [COLOR=#000080]1[/COLOR];  
[COLOR=#000000] **function** [/COLOR] negaPillReleaseCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR]score == [COLOR=#000080]8000[/COLOR]_npi[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
npi++;  
[COLOR=#808080]_//all the code that puts the pill in motion goes here\*[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

This generally works.  
Now, what I’ve noticed is that if the score takes an extreme jump, pills stop showing up. One weapon - the NEGASPHERE - can wipe out multiple enemies almost simultaneously, so the score can hop up quickly.

Is it possible that the score piles up too quickly for the counter npi to keep up, and since it’s not incrementing, the pills can’t be released?

thanks for the help!
