Mouseclick x/y reporting bug?

8x8n88x8n8 Member, PRO Posts: 81
edited November -1 in Working with GS (Mac)
So I'm experimenting with a movement control interface for a platform jumper where the character moves towards where you tap/click on the screen. In the final iPhone version it will be a tap, but I'm subbing click for testing at the moment.

Right now I have a 'dummy actor' that teleports to wherever you click. The character actor then accelerates towards the dummy actor. In testing the dummy actor will not go anywhere further right than about 200pix. This is insanely annoying and makes my game interface completely not work. I've triple checked the code and all I can figure is that GS mouseclick x/y reporting has a bug.

The code I have says:

Actor1
Rule
Actor recieves mouseclick
change globalattribute.x to mouseposition.x
change globalattribute.y to mouseposition.y

Actor2
Accelerate towards globalattribute.x, globalattribute.y

but mouseposition.x never goes above about 200.

Grr...

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    is your scene bigger then 480x320 (or 320x480)?

    If so you need to add a offset for the camera

  • 8x8n88x8n8 Member, PRO Posts: 81
    Thanks for the speedy reply... but...

    I have no audio because I just upgraded to Snow Leopard and I got the 'no sound' bug. So I have no sound. I've been trying to fix the damn thing for the past hour. The webernetz says to delete my audio.plist file in the prefs folder but there isn't one there so I'm SOL until the Mac store opens up and I can goad some answers out of a smarmy disinterested twenty-something. If only Win/PC weren't more evil than Mac :P
  • 8x8n88x8n8 Member, PRO Posts: 81
    Alright got it working and just watched the video. Thanks for the solution but... argh what a messy workaround :(

    I try to stay away from any "constrain" behavior in any of my games because they eat up so much CPU.

    Sigh.
Sign In or Register to comment.