View Single Post
Old 30 August 2018, 23:48   #3
Puttymoon inhabitant
Predseda's Avatar
Join Date: Mar 2007
Location: The City of Townsville
Age: 42
Posts: 5,650
Send a message via ICQ to Predseda
No, I can't get it. There is an example for Amreg in AMOS Help, but it uses that for maintenance the speed of the game. I just want to read mouse coords to a variable and use it as a target point for a bob to move to. A routine where bob follows the clicked point on the screen. Seems AmReg is somehow able to gather the coords and store them in RA-RZ (R0-R25) register (variable)?


A partial success. I adjusted my procedure to look as this:

Procedure MOVEMENT
Amreg(RB)=Y Mouse-42-B
Amreg(RA)=X Mouse-128-A
Bob 3,A,B,3
A$="S: Move RA,RB,100; Pause;"
Amal 3, A$
Amal On 3
End Proc
Bob now goes to coords of the mouse click and stops there, but only horizontally. Vertically it keeps its position. When I list RA and RB, both have the same values: RA, which is horizontal difference between Bob starting point and the pixel clicked (which is correct for X-movement, but what should I do to get RB, that would move Bob vertically?)

Last edited by Predseda; 31 August 2018 at 10:42.
Predseda is offline  
Page generated in 0.04188 seconds with 11 queries