Saving Locations of Actors
doug_smuppet
Member Posts: 99
Hi...
como o título deste post, eu criei esta função, seguindo um tutorial de GShelper.
link here
But, I just needed create 1 actor (my player) and the movements from him are not Drag and Drop, they are pressing arrow left and right, and save the position every time that I press this arrows, I created some actors for the locations, and put them on a Tag (locations), and then my player Colide with the Tag (location), save the position on table.
all right so far!!!
my problem is:
it is saving when my player touch the actor location, but, I need save only when my player arrive on the center of the actor location. I mean, when touched "center from center"
I explained clearly?
como o título deste post, eu criei esta função, seguindo um tutorial de GShelper.
link here
But, I just needed create 1 actor (my player) and the movements from him are not Drag and Drop, they are pressing arrow left and right, and save the position every time that I press this arrows, I created some actors for the locations, and put them on a Tag (locations), and then my player Colide with the Tag (location), save the position on table.
all right so far!!!
my problem is:
it is saving when my player touch the actor location, but, I need save only when my player arrive on the center of the actor location. I mean, when touched "center from center"
I explained clearly?
Comments
1. Create a attribute x and attribute y make them both real attributes.
2. Go into your player and constrain them to its x and y.
3. Now create another two attributes call them whatever you want but here ill call them attribute x2 and attribute y2.
4. Now for your location actors you want to create a rule saying when I collides with player change attribute x2 and y2 to self x and self y.
5. Then in your player you make a rule saying when x and y = x2 and y2 do whatever you need it to do.
Let me know if this works for you,
Cheers.
in my file, it's happening for me, the first example
I have a doubt in your explanation. (I don't know so much about GS)
1 - create a Game Attributes, all rigth?
2 - go into my player e create a Constrain Attribute and
___Constrain: game.x to: self.position.x
___Constrain: game.y to: self.position.y
3 - create another two attributes as Real?
4 - Create a Rule when collide with the player:
___Change Attribute set: game.x2 to: self.positon.x
___Change Attribute set: game.y2 to: self.positon.y
thanks
Can you explain in more details?