I need to use the same function with a sprite object in it to loop and work on any sprite that is send to it.
As an example,
When layout is loaded, Function : Call "GenerateEnemy" ("RedEnemySprite", 100, 12)
Function : On "GenerateEnemy",
- Set RedEnemySprite instance variable Hitpoints to 100.
- Set RedEnemySprite instance variable Attack to 12.
- Create RedEnemySprite at SpawnLocationSprite position.
Like in this example, anything like RedEnemySprite, KnightEnemySprite, MonsterEnemySprite or GhostEnemySprite need to be send to the same function so that instead of RedEnemySprite, it will do that. Otherwise there is the need to create the same three events for each enemy like this.
So is it possible to send a sprite through a parameter or variable so that different ones can be passed through it and to act on it ?