-
-
Notifications
You must be signed in to change notification settings - Fork 831
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
Penguins Attack TD 2 - Enemies gets shot even if dead. #8026
Comments
(changed title, as it's an AS2 game. I imagine it's related to #1513 ) |
Hi, currently looking into this. Just wanted to log another minor bug:
This doesn't happen on the normal flash player. Weird. |
Okay, here's my theory: In the killEnemy function, how the game maker decided to delete the enemy is by calling "Array.splice(i,1)" to delete 1 element at the current index. Fair enough. The author, afaik, doesn't do any check to actually delete the enemy - all that ever happens is that it gets spliced out. However, the tower class has a "target" pointer. So it points back to the dead enemy. So whatever enemy its pointing to gets kept alive because theres a pointer to it, while the rest get freed by the gc. That's why you only get +5 money instead of the whole group (if you use missile towers for example), even though you killed multiple enemies. Wild theory is that Adobe meant to actually delete the target elements when calling splice instead of just removing the array references to them, but I doubt it. I've never programmed in flash, and the FlashMX thing I'm reading says this:
for Array.splice(). Looking more into it. edit: nvm, the author deletes the movieclip, i'm just blind lol. Still think it's something weird with the tower's target pointer not being reset at all. Maybe removeMC in rust doesn't delete the actor fully? |
Been a while. This game seems to work now. |
Describe the bug
Hey,
this game almost works but it has some flaws especially that the dead enemies still get shot. https://www.newgrounds.com/portal/view/534198?emulate=flash
Expected behavior
Die and don't be shot anymore.
Affected platform
Self-hosted version
Operating system
All
Browser
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: