Hello everyone,
I want to know if it's possible to make a function which can take an object in parameters.
Lest me explain, in my game I have sprite objects ('Player1', 'Player2', ...), with an array container ('Player1Array', 'Player2Array', ...). This array is an historic of player's positions (Player1.X, Player1.Y, Player1.Angle).
My game has several steps :
1 - You control Player1 and the game record his movement.
2 - You control Player2 (and the game record his movement). The game move Player1 by reading Player1Array.
3 - You control Player3 (and the game record his movement). The game move Player1 by reading Player1Array and Player2 by reading Player2Array .
4 - ...
The record method is the same for all player objects, but not use at the same moment.
I want to make a fonction to record player but I not be able to specify which player is concerned.
Do you have solution for me ?