smitelli / cosmore

A reconstruction of the source code of Cosmo's Cosmic Adventure.
https://www.scottsmitelli.com/projects/cosmore
Other
113 stars 6 forks source link

CanBeExploded() does not seem to have an entry for the Tulip Launcher #1

Closed T-SquaredProductions closed 3 years ago

T-SquaredProductions commented 3 years ago

I need to be able to make this actor unaffected by explosions, but the source code doesn't seem to have an entry in the CanBeExploded() list for the Tulip Launcher. Also, I don't see a case argument to make Cosmo go in front of an actor, or change the layering for an actor.

Other than that, because of how the commands are organized, making some of the custom elements is going pretty well!

smitelli commented 3 years ago

Tulip launchers behave specially around explosions. (They need to be hit twice, they flash white while in pain, and they spawn blue parachute ball shards upon destruction.) Because of the different behavior, all this happens inside the tick function, ActTulipLauncher(), and not in CanBeExploded().

Sprite draw order is constrained by the order of function calls in GameLoop(). DrawPlayerHelper() is called first, then MoveAndDrawActors() happens, which means all actors overdraw the player. Within the actors themselves, they are drawn in actors[] array order, later ones overdrawing earlier ones.

I haven't really explored how the game behaves with player/actor function calls rearranged, but those would be the places to look. Giving actors any sense of z-layering or priority would involve adding a new member to the Actor struct and sorting them during MoveAndDrawActors(). Not impossible, but the original authors included no provisions for that.

T-SquaredProductions commented 3 years ago

Thanks for the help. I actually seem to have found out how to comment out the code that makes the tulip game object vulnerable to bombs.