FOUND A FIX... If you add a call to MouseXSpeed IMMEDIATELY after the call to MoveMouse, it works correctly (in all versions old and new both BlitzPlus and Blitz3D).
This code illustrates:
.MainLoop
;;
;; Whole bunch of other code for the game here
;;
mxs=MouseXSpeed()
If mxs<>0 Then
tank\angle=tank\angle+mxs
MoveMouse ScreenXSize/2,ScreenYSize/2
mxs=MouseXSpeed()
End If
;;
;; Code to draw Tank, Turrent, and FLIP here...
;;
Goto MainLoop
Now if anyone can tell me WHY this extra call to MouseXSpeed is required in the newer (1.36, 1.37) versions of BlitzPlus and NOT required in the older (1.11) versions of BlitzPlus and the current version (1.86) of Blitz3D that would be great!!
PS: I got the idea to try this from the Blitz3D documentation. There's a line that says "You really have to use these commands TWICE to get anything out of them. Each call you make returns the difference in location since the LAST time you called it."...
Now, whats funny is in the example code given (in Blitz3D Documentation) does NOT call MouseXSpeed and MouseYSpeed immediately after the call to MouseMove... This example code (just like my code) will run just fine in BlitzPlus 1.11 but will not run correctly (as is) BlitzPlus 1.37. It will run in both older and newer versions of Blitz3D.
In the Sample Code, if you add a call to MouseXSpeed and MouseYSpeed immediately after the call the MoveMouse, the Sample Code will work in BlitzPlus 1.37.
DEFINITELY, UNQUESTIONABLY A BUG HERE SOMEWHERE. Either BlitzPlus 1.37 isn't handling MouseXSpeed/MouseYSpeed correctly (most likely), OR all the other versions of BlitzPlus and Blitz3D are not handling it correctly (unlikely).
Here is the Sample Code from the Blitz3D Docs, for reference
(this is the code without the extra calls after MoveMouse, it will work fine in Blitz3D and older versions of BlitzPlus, but not in newer versions of BlitzPlus):
Graphics 640,480
SetBuffer BackBuffer()
x=320
y=240
; infinite mouse movement
Repeat
Cls
xs=MouseXSpeed() ; see how far the mouse has been moved
ys=MouseYSpeed()
MoveMouse 320,240 ;put the mouse back in the middle of the screen
x=x+xs ;adjust mouse co-ords
y=y+ys
If x>GraphicsWidth()-1 Then x=x-GraphicsWidth() ;wrap screen
If x<0 Then x=x+GraphicsWidth()
If y<0 Then y=y+GraphicsHeight()
If y>GraphicsHeight()-1 Then y=y-GraphicsHeight()
Text x,y,"X",True,True
Flip
Until KeyHit(1)
End
Here is that same sample code with the extra call to MouseXSpeed and MouseYSpeed after the call to MoveMouse (this will work correctly in all versions of BlitzPlus and Blitz3D):
Graphics 640,480
SetBuffer BackBuffer()
x=320
y=240
; infinite mouse movement
Repeat
Cls
xs=MouseXSpeed() ; see how far the mouse has been moved
ys=MouseYSpeed()
MoveMouse 320,240 ;put the mouse back in the middle of the screen
;;
;; Extra call to MouseXSpeed/MouseYSpeed to overcome BUG in BlitzPlus 1.36 and 1.37:
;;
tmp=MouseXSpeed()
tmp=MouseYSpeed()
x=x+xs ;adjust mouse co-ords
y=y+ys
If x>GraphicsWidth()-1 Then x=x-GraphicsWidth() ;wrap screen
If x<0 Then x=x+GraphicsWidth()
If y<0 Then y=y+GraphicsHeight()
If y>GraphicsHeight()-1 Then y=y-GraphicsHeight()
Text x,y,"X",True,True
Flip
Until KeyHit(1)
End
Hopefully this will help others who want to use the Mouse to move game characters in BlitzPlus!
This code illustrates:
.MainLoop
;;
;; Whole bunch of other code for the game here
;;
mxs=MouseXSpeed()
If mxs<>0 Then
tank\angle=tank\angle+mxs
MoveMouse ScreenXSize/2,ScreenYSize/2
mxs=MouseXSpeed()
End If
;;
;; Code to draw Tank, Turrent, and FLIP here...
;;
Goto MainLoop
Now if anyone can tell me WHY this extra call to MouseXSpeed is required in the newer (1.36, 1.37) versions of BlitzPlus and NOT required in the older (1.11) versions of BlitzPlus and the current version (1.86) of Blitz3D that would be great!!
PS: I got the idea to try this from the Blitz3D documentation. There's a line that says "You really have to use these commands TWICE to get anything out of them. Each call you make returns the difference in location since the LAST time you called it."...
Now, whats funny is in the example code given (in Blitz3D Documentation) does NOT call MouseXSpeed and MouseYSpeed immediately after the call to MouseMove... This example code (just like my code) will run just fine in BlitzPlus 1.11 but will not run correctly (as is) BlitzPlus 1.37. It will run in both older and newer versions of Blitz3D.
In the Sample Code, if you add a call to MouseXSpeed and MouseYSpeed immediately after the call the MoveMouse, the Sample Code will work in BlitzPlus 1.37.
DEFINITELY, UNQUESTIONABLY A BUG HERE SOMEWHERE. Either BlitzPlus 1.37 isn't handling MouseXSpeed/MouseYSpeed correctly (most likely), OR all the other versions of BlitzPlus and Blitz3D are not handling it correctly (unlikely).
Here is the Sample Code from the Blitz3D Docs, for reference
(this is the code without the extra calls after MoveMouse, it will work fine in Blitz3D and older versions of BlitzPlus, but not in newer versions of BlitzPlus):
Graphics 640,480
SetBuffer BackBuffer()
x=320
y=240
; infinite mouse movement
Repeat
Cls
xs=MouseXSpeed() ; see how far the mouse has been moved
ys=MouseYSpeed()
MoveMouse 320,240 ;put the mouse back in the middle of the screen
x=x+xs ;adjust mouse co-ords
y=y+ys
If x>GraphicsWidth()-1 Then x=x-GraphicsWidth() ;wrap screen
If x<0 Then x=x+GraphicsWidth()
If y<0 Then y=y+GraphicsHeight()
If y>GraphicsHeight()-1 Then y=y-GraphicsHeight()
Text x,y,"X",True,True
Flip
Until KeyHit(1)
End
Here is that same sample code with the extra call to MouseXSpeed and MouseYSpeed after the call to MoveMouse (this will work correctly in all versions of BlitzPlus and Blitz3D):
Graphics 640,480
SetBuffer BackBuffer()
x=320
y=240
; infinite mouse movement
Repeat
Cls
xs=MouseXSpeed() ; see how far the mouse has been moved
ys=MouseYSpeed()
MoveMouse 320,240 ;put the mouse back in the middle of the screen
;;
;; Extra call to MouseXSpeed/MouseYSpeed to overcome BUG in BlitzPlus 1.36 and 1.37:
;;
tmp=MouseXSpeed()
tmp=MouseYSpeed()
x=x+xs ;adjust mouse co-ords
y=y+ys
If x>GraphicsWidth()-1 Then x=x-GraphicsWidth() ;wrap screen
If x<0 Then x=x+GraphicsWidth()
If y<0 Then y=y+GraphicsHeight()
If y>GraphicsHeight()-1 Then y=y-GraphicsHeight()
Text x,y,"X",True,True
Flip
Until KeyHit(1)
End
Hopefully this will help others who want to use the Mouse to move game characters in BlitzPlus!