Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track explosion chains #7

Open
pinobatch opened this issue Apr 29, 2020 · 0 comments
Open

Track explosion chains #7

pinobatch opened this issue Apr 29, 2020 · 0 comments

Comments

@pinobatch
Copy link
Owner

Add a counter for how many enemy missiles were destroyed by a single player missile. Each concurrent chain is tracked separately. This is not quite the same behavior as the FantaVision chain counter, which just counts how many explosions have been in the air since the last time there were none.

As for data structures to track this: We currently have well over 700 free RAM bytes, 142 in zero page and 644 in BSS. It's impossible to have more active chains than explosions.

  • Maximum active enemy missiles: 16
  • Maximum active explosions: 8

Also want to discourage waiting for the MIRV or balloon to blow up for it to count as a 2 or 3 chain.

These variables will be needed:

  • A new object "chain" has chainCount, chainLastExplode, and chainLastMissile
  • To each explosion, add chainID
  • To each missile add missileSerial

Interactions with these:

  • When an enemy missile is fired, set its missileSerial to enemyMissilesLeft.
  • When a player missile explodes (near playerMissileNotSplodeTime), allocate a new chain and zero its count and last missile.
  • When an enemy missile explodes (near found_explosion), copy the old explosion's chain ID to the new, increment the chain's count if the last missile changed, and set the new explosion as the latest in its chain.
  • When an explosion ends, whether by hitting negative explodeTimeToFrame or by having the largest time in findFreeSlot, if it is the last on its chain, end the chain by setting the chain's last explosion to negative.
  • For each active chain, display its count above its last explosion, or below if the explosion's center is below y=40 so that it stays in the safe area.

There is no current plan to score chains. We encourage larger chains indirectly as a way to conserve ammo. But to encourage larger chains among 100%ers, we could keep a second score just for 100%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant