Move objects on larger than screen scene
I have a game where a character throws a grenade.
I have a scene that is about 1000x1000 (this allows the player to explore the game/scene more.
I'd like for the player to walk around and when he wants to throw a grenade he can click on the screen and throw it to that position. I have it set up to do that and I don't have any problem if the player doesn't move.
BUT, if the player moves around and explores and tries to throw a grenade, it seems that the player clicks on the screen and he'll throw to that coordinate (which is something between 0-480 and 0-320). My scene is 1000x1000, how can I get the player to throw to a point like 780x560 (or whereever he wants).
Does this question make sense?
I have a scene that is about 1000x1000 (this allows the player to explore the game/scene more.
I'd like for the player to walk around and when he wants to throw a grenade he can click on the screen and throw it to that position. I have it set up to do that and I don't have any problem if the player doesn't move.
BUT, if the player moves around and explores and tries to throw a grenade, it seems that the player clicks on the screen and he'll throw to that coordinate (which is something between 0-480 and 0-320). My scene is 1000x1000, how can I get the player to throw to a point like 780x560 (or whereever he wants).
Does this question make sense?
Comments
Make 3 attributes. Targetx and targety (those should be real) and throw that can be interger
in the screen actor have when touch is pressed change throw to 1 and change targetx to mouse positionx and targety to mouse position y.
Then in the grenade have a rule when throw=1, move or interpolate self positionx to tragetx and self positiony to targety
then anothrt rule in the grenade when self positionx= targetx and when self position y=target y, change attribute throw to 0.
But it seems like you know what I'm asking JP. Any other idears?
then constrain game.player.x to self.position.x
and constrain game.player.y to self.position.y and then in your thrown rule add
game.player.x to game.target.x and game.player.y to game.target.y
Hmm. This is frustrating...
http://www.youtube.com/user/GameSaladCookbook#p/u/42/bfKYqsuNgXY
I'll watch it and let you know.