Hi, I have a couple of problems I need help with.
1) I'm making a game where I have multiple (let's say 3) instances of an object and have those objects be affected by individual hitboxes for each. All objects need to be able to be affected separately by Player hitting the hitboxes, but I also need an event that activates only when all three objects are at their correct values (defined by different instance variable value set for each object). Basically, when player hits the hitbox for an object it's value will increase by one and only when ALL 3 of the objects are set at their respective correct values, an event will activate.
I've defined instance variables to the hitboxes and objects so that when they match, the hitbox affects the object with same number, and that works just as planned. But how do I make the game check that all three instance variables (with different values each) are right before activating the next event? Right now, my events activate if only one of the objects is at the correct value. What is the simplest and best solution to fix this?
2) I have enemies you can jump on (original, I know) and they will get estroyed. At start of layout I spawn hitboxes for each enemy and when player collides with it (and platform is falling), the enemy and hitbox will get destroyed. All well and good and working right, until I have two enemies next to each other and player hits both enemies on landing. In that case I'd want both of them to get destroyed, but what happens is the player dies instead (like they are touching the enemy and not the hitbox). If I disable the "platform is falling" event then when colliding both enemy hitboxes get destroyed but it only destroys one of the enemies. I suspect others have had similar problems before and there is an elegant solution to solve this situation, any advice?
3) I have multiple doors in the layout. When player enters door 1 he spawns to door 2 coordinates in the layout. When he goes through door 2 he gets back to door 1 coordinates. But what if there are more doors in the layout, let's say also doors 3 and 4 which lead to one another. Doors have individual instance numbers each but I'm having trouble comparing and picking automatically the coordinates of the target door to go to. What's the most effictive way to make this kind of system without unneeded clutter in events, tedious setting of coordinates by hand for each level or cloning objects?
Thanks a lot for any help, it is much appreciated!!