Moving a player with Interpolation
Hi, Let’s see. I have this great little setup for moving a character around using interpolate.
Other than 2 game attributes clickX and clickY.
The character is setup like this…
Rule
sets up the coordinates
when actor receives event_ mouse button_ is_ down
Change Attribute_game.clickX to game.mouse.positionX
Change Attribute_game.clickY to game.mouse.positionY
move player
Interpolate self.positionX _to_game.clickX_duration _3_ease in/out
Interpolate self.positionY _to_game.clickY_duration _3_ease in/out
This works kind of cool until I expand the scene. It started out iPad landscape 1024x768 and I made it 2048x 768. Thats when it all goes south. The camera moves with the player the player stops at the right side of the original size.
How can I set this up so the mouse clicks in the expanded area are registering.
Comments
Add camera orgin x and y to clickX and clickY.
Add Camera origin X / Y as a global attribute? I mean I see it in the game attributes, but I can't seem to find it in the expression editor to add it ....
If you unlock an actor in the scene that actor will then have access to the camera.
Yep there it is. So should I drop it in as a separate change attribute inside the rule "When actor receives event mouse button is down or add it to ....? I'm trying it every way I can think of....
I don't know what any of that means, I'd simply choose the way that best works for your particular needs.
Sorry man! I'll work on it for a while. I have a parallax scrolling templet from stormyStudio that deals with this problem. I will pull that one apart and see how he did it. Thanks