Hello all,
Hope someone can help me with a techie question:
I'm working on making a Streets of Rage - style beat 'em up, and I'm trying to give every enemy a "shadow" - i.e. a little black oval by their feet. When they get knocked over or thrown by the player (so they're in mid-air), the "shadow" becomes visible - and then it disappears when they hit the ground again. (It's a nice way to help players tell what Y-coordinate each enemy is on, even if they're in mid-air at the time.)
I've managed to code it so that as soon as an enemy spawns,
- the system randomly generates a unique ID number for them, and stores it in alterable value I
- the system creates a "shadow" active object (a little black oval) at the exact same X and Y coordinate as the enemy
- the "shadow"'s alterable value I gets set to the same thing as the value I of the enemy at that particular X and Y coordinate.
So, that seems a good start; for every enemy there's a shadow with a matching "primary key" in alt value I, which I'd hoped I could use to pair them together. But, I can't get it to work. I tried to do an event like:
IF "shadow" alt value I = "enemy" alt value I, THEN set "shadow" X and Y = "enemy" X and Y
...and it didn't work. When I tried this with multiple enemies on screen, all the shadows got attached to just one single enemy (so it looked like there was one guy with one really thick shadow, and several other guys without a shadow at all).
I also tried this kind of thing:
IF "shadow" alt value I = "enemy" alt value I
AND "shadow" is overlapping "enemy"
THEN set "shadow" X and Y = "enemy" X and Y
...but this didn't work either.
I'm 100% certain that all the "assigning unique value I" stuff works. (I was able to confirm that by creating a couple of counters, then adding events to say "if mouse hovers over enemy, set counter 1 to enemy's alt val I ; if mouse hovers over shadow, set counter 2 to shadow's alt val I".) It's just this last step of getting the shadow's position to be set to that of the enemy with the same I value where I'm getting stuck.
There's gotta be someone else out there who's ran into this problem before; can you point me in the right direction?
Thanks in advance