Question about properties in Game and self
edwin123_chen
Member Posts: 3
When read examples, i always can see such rule:
Change Attribute: set game.Player X to self.Position.x
I don't quite understand the game and self, can someone help to explain?
which actor will be game.Player X if several actors in Scenes?
Change Attribute: set game.Player X to self.Position.x
I don't quite understand the game and self, can someone help to explain?
which actor will be game.Player X if several actors in Scenes?
Comments
What is happening is that people create a game attribute to transfer store or display a property of an actor. Gamesalad does not allow one actor to look at the properties of another actor directly, but any actor can access game or scene properties so this is done as a workaround.
Game attributes can be very versatile and powerful tools and make game updates, changes, or reworks to be done very easily because you can make changes to multiple actors by only changing a single line or number.
A great example of this is that my current project has some "Snap-to-Grid" functionality for many of the actors. If later on I want to change the grid size from 32 pixels to 64 pixels, all i have to do is change the game attribute Grid.Size.X and Grid.Size.Y that I created. IF i had programmed the grid size into each actor and decided to change it later, I would have to edit 30-40 actors!
Grim
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS