I first got into TGC back around 2008 with their DarkBASIC software. Loved it. Used two versions of it up until very recently. I bought a new computer and wanted the latest and greatest from TGC. They don't seem to offer DB anymore, but I got their AppGameKit Studio which appears to be 95% of what DB used to be plus new features that allow you to create apps/games for phones. Excellent! Many of the commands seem to have been overhauled to accommodate these features. I get that. But I'm having problems and I'm wondering if I'm not understanding some of the changes.
Example:
I'm just trying to get a hold of camera commands. I copied this from one of the examples:
do
If GetPointerState()
Camera_Angle_X# = GetCameraAngleX(1) + ((GetPointerY()-OldPointerY#)*0.5)
Camera_Angle_Y# = GetCameraAngleY(1) + ((GetPointerX()-OldPointerX#)*0.5)
if Camera_Angle_X# < -90 then Camera_Angle_X# = -90
if Camera_Angle_X# > 90 then Camera_Angle_X# = 90
SetCameraRotation(1,Camera_Angle_X#,Camera_Angle_Y#,0)
endif
OldPointerX# = GetPointerX()
OldPointerY# = GetPointerY()
Sync()
loop
... And it works. I looked up the GetPointerState() command and I understand that it's a general way for the program to acknowledge a "pointer" whether or not it's the mouse on a PC or a finger pointing on a phone. But if I try to modify the commands and tailor it to a PC by specifying that I'm on a PC...
do
If GetRawMouseLeftPressed()
Camera_Angle_X# = GetCameraAngleX(1) + ((GetPointerY()-OldPointerY#)*0.5)
Camera_Angle_Y# = GetCameraAngleY(1) + ((GetPointerX()-OldPointerX#)*0.5)
if Camera_Angle_X# < -90 then Camera_Angle_X# = -90
if Camera_Angle_X# > 90 then Camera_Angle_X# = 90
SetCameraRotation(1,Camera_Angle_X#,Camera_Angle_Y#,0)
endif
OldPointerX# = GetPointerX()
OldPointerY# = GetPointerY()
Sync()
loop
... the program runs, but the camera does not move when I press the left mouse button even though it worked fine with the GetPointerState() command. What am I missing? Why doesn't this work? And what's even more strange is that if I say "If GetRawMouseLeftPressed() then end" it works; the program ends when I click the mouse. So I know I'm using the command/syntax right. I've even tried saying "If GetRawMouseLeftPressed() = 1..." and there's no change. Am I wrong in believing that something that would've worked back in DB should work here? (Although, technically the old DB command would've been "if mouseclick() = 1...) I'm just getting frustrated with it and I'm beginning to wonder if I should just try to install my old DB software on my new computer, but I'd really like to get familiar with AppGameKit.