Dragging actor around a scene
Okysho
Member Posts: 158
I'm trying to create a game where the player drags the main actor around the scene. This works for the most part with the "Move to" behavior, however when I add the move camera action to expand the level, the mouse position doesn't update as the camera moves. Additionally, the mouse position doesn't update properly after the camera has finished moving. How can I fix this?
Comments
If touch is pressed
constrain self.position.x to mouse.position.x
constrain self.position.y to mouse.position.y
Control camera
also add a min/max to the camera so it wont go outside your scene
Also, that's the exact behaviour I already have.
Can you make a screenshot of your rules - Cause the rules listed above has nothing to do with move to behavior
I've put this behaviour into the main actor:
http://i46.photobucket.com/albums/f101/Okysho/Gamesalad errors/ScreenShot2013-03-25at22913PM_zps2aed3d1c.png
and this in the background (with a dummy image):
http://i46.photobucket.com/albums/f101/Okysho/Gamesalad errors/ScreenShot2013-03-25at22955PM_zps20a2bd31.png
What happens currently, the actor will go to the initially clicked area on the screen, but when the camera moves, the move will move on the scene, but the values for the x and y positions will not change.
Here's the project file, just so you understand my full meaning.
http://www.mediafire.com/?ytbw22rz3313d8e
What should happen:
When the player clicks in the top right corner, the actor should move continually to the top right corner of the scene until the cursor is moved and clicked in a different place.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
so here is a dropbox link instead - hope it helps
https://www.dropbox.com/sh/9jehl8bg2efpdsp/gfs7QfJJB8/Phooma 0.1.gsproj