I'm using a mouse to set the new direction for a sprite, then I'm using new values to move the sprite a certain amount in the new direction. My problem is that the sprite always ends up where the sprite x y position is. Is it my code, or something else?
'loading generic sprite for testing
dim g= LoadTex("gfx/Ball.png")
dim c1= NewSprite(g)
dim mx,my,r as double,sx as double,sy as double,cx,cy,radA as double,dx as double,dy as double
Sorry, I meant to say the the sprite always moves to where the Mouse x y location is. This is not what I want to happen. I don't think it's my code.
I think the problem is that Mouse_Button(MOUSE_LBUTTON) will keep returning true for as long as the button is being held down. Whereas you only want to move your center point when the button is first pressed. I've added a couple of variables to detect this case. Basically it tracks whether the mouse button was pressed the last time around the loop. If it wasn't pressed last time but is pressed now, then you have a button click, and can move your point.