Hello. I'm working on a custom movement engine that will have multiplayer incorporated into it. I'm having an issue with choosing the right object when needed. Right now there are 2 of the same sprite called "player". Each has a private variable called "player". One has Player = 1, the other has Player = 2. The engine has many sensors which detect wall collisions, slopes, floor and ceiling. I got those to correctly attach to the right "player" object by checking if their "player" variable is = to the player object's variable. I'm having trouble with picking the correct player object to set X and Y speeds to. I have an input object that also wants to be linked through a "player" variable. I can correctly get the input object to link to the player object by checking the player variable but I can't seem to figure out how to single out the player object I want to move. If I move one player object, they both move because the engine is setting the X and Y speeds for both of them. How can I loop through the correct player object to get it to move correctly based on what is controlling it? I plan to have 4 player objects work under the same movement engine but I can't seem to figure out a way to make it choose the right one to move. Can any one of you help me? I would greatly appreciate it.
This is the event that I want to cycle through each character. I want them to all have separate X and Y speeds. Would I have to copy this 4 times or is there a way to loop through this to get it to only correspond to the individual characters?StreakThundrstrm2012-01-10 15:13:44