NPC acts strangely when going offscreen
Posted: Mon Aug 18, 2025 9:57 am
Hi! I'm currently porting an NPC from a game called Garbanzo Quest, with some code copied from the Terissa NPC. In the original game, they continue moving when offscreen. However, in my SMBX2 implementation, they return to spawn once they go offscreen. To make things even more confusing, if they go offscreen while their spawnpoint is ONscreen, they render but DON'T have a hitbox.
https://file.garden/ZqehsES-MSMCnVGd/do ... Sphere.zip
Let me know if this ^ zip is missing anything. I thiiiink it's got everything it needs?
PS: This is a bit of a spaghetti code. If you want to make other changes to it, besides fixing the problem I have, I'd be okay with that. I'd also like the gray one (the one that shoots projectiles) to stop making noise if it's offscreen, but I'll cross that bridge when I come to it.
Good luck!
https://file.garden/ZqehsES-MSMCnVGd/do ... Sphere.zip
Let me know if this ^ zip is missing anything. I thiiiink it's got everything it needs?
PS: This is a bit of a spaghetti code. If you want to make other changes to it, besides fixing the problem I have, I'd be okay with that. I'd also like the gray one (the one that shoots projectiles) to stop making noise if it's offscreen, but I'll cross that bridge when I come to it.
Good luck!