When I have an object collide with another, I have it set so that it is hidden, so it should no longer render. I checked my debug console output in no$gba and it set to hidden, but it still gets rendered. For example, with bullets when it hits a monster it should disappear, however it is set to hidden but it doesn't disappear. Further more to my confusion is if I fire enough bullets to loop through the array again, the bullet disappears from its static position and gets fired again!
The same thing happens to the monsters. Here is an image of what is happening. I'm setting the hidden attribute to true, and I'm sure the OAM is getting updated through oamUpdate.
Any ideas?
Objects not hiding
Re: Objects not hiding
Dumb coding mistake on my end. I was setting its member variable "alive" to false and "hidden" to true. Then when the oamSet was only being called for the object if it was alive, so it wouldn't update.
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Objects not hiding
It sounds like you're making the common mistake of allocating specific OAM entries to specific game objects which can lead to problems later if you have more game objects than available OAM entries.
Rather than having an object that's inactive set a corresponding entry in the OAM as hidden it's better to allocate the next available OAM slot to an object which is active. Once you've done this for all the active objects (or run out of OAM entries to allocate) then you simply set the remaining OAM entries as hidden.
Rather than having an object that's inactive set a corresponding entry in the OAM as hidden it's better to allocate the next available OAM slot to an object which is active. Once you've done this for all the active objects (or run out of OAM entries to allocate) then you simply set the remaining OAM entries as hidden.
Who is online
Users browsing this forum: No registered users and 4 guests