Accelerate towards mouse (please help)

StorerDevStorerDev Member Posts: 10
edited November -1 in Working with GS (Mac)
I am having trouble with accelerating towards my mouse event. I have it set so when i press down on the mouse it accelrates towards it on a scrolling background, but for some reason it only JUST BARELY goes towards my mouse touch. i got everything right i think its at - game.mouse.position.x - game.mouse.position y, - for where it needs to accelrate towards....PLEASE HELP !!! this has been driving me crazy.

Comments

  • StorerDevStorerDev Member Posts: 10
    well im making iphone 4 graphics, so i have it set to a 960x640 screen so no i havent even tried it smaller yet
  • StorerDevStorerDev Member Posts: 10
    okay so i tried it with smaller graphics, but now everytime i get past the first set of 480 it just reverts back and doesnt let me go through my scrolling backround
  • PhoticsPhotics Member Posts: 4,172
    StorerDev said:
    okay so i tried it with smaller graphics, but now everytime i get past the first set of 480 it just reverts back and doesnt let me go through my scrolling backround

    As mentioned in The Unofficial GameSalad Textbook, you use scene attributes — by creating an instance of a prototype actor — to read the camera origin. That gets added to the mouse position. Save that data to an attribute... one for X and one for Y. It should work. I'm using this technique (and many others... ha ha!) for BOT and it works great.
  • StorerDevStorerDev Member Posts: 10
    Bot seems awesome man, but could you explain that a little more detailed? i want the camera to move with my actor and it does. its just once it starts scrolling it reverts back the original. it is also still having problems with just barely accelerating towards my x,y mouse coordinate.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    In the accelerating actor you need to drag it in to the scene, double click on it, click on the big pad-lock, and then change your code to:

    mouse.x+scene.camera.origin.X
    and
    mouse.y+scene.camera.origin.Y
  • StorerDevStorerDev Member Posts: 10
    Yeah i changed that and now my guy isn't moving at all....huh
  • StorerDevStorerDev Member Posts: 10
    http://www.flickr.com/photos/60781485@N05/5540973920/

    that is what you're talking about right?
    thanks for the help btw.
  • patm1982patm1982 Member Posts: 50
    Thanks you so much for bringing this up. This had been plaguing me for some time on a side project. I just figured scrolling & non-scrolling coordinates couldn't talk to each other. Makes me want to finally buy the 'Unoffical GameSalad Textbook" app too see what else I'm missing.
Sign In or Register to comment.