I'm new to AppGameKit and its BASIC language. I would prefer to use it then the hassle that comes with industry languages. However, I am stuck with syntax...
The following is a snippet of what I have attempted to make... I know it works with out using functions ect... but I'm to use to making it look neat and tidy. Please correct me in the issue I'm struggling with this early on.
Compilation Error: ( main.agc:47: error: Cannot convert type "Integer" to "Type" )
Type PlayerData
obj as Integer
EndType
// Set window properties
Function SetupWindow()
SetWindowTitle( "TestProgram" )
SetWindowSize( 1024, 768, 0 )
// Set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
EndFunction
// Load sprite player
Function SetupPlayerObject(Player as PlayerData)
Player.obj = 1
sprPlayer = LoadImage( "sprites/sprBox.png" )
CreateSprite( objPlayer, sprPlayer )
SetSpritePosition( objPlayer, GetDeviceWidth()/2 , GetDeviceHeight()/2 )
EndFunction Player
// Controls
Function SetupControls()
AddVirtualJoystick( 1, 100, GetDeviceHeight()-100, 100 )
joystickX = GetVirtualJoystickX( 1 )
joystickY = GetVirtualJoystickY( 1 )
EndFunction
Function Main(Player as PlayerData)
SetupWindow()
SetupPlayerObject(Player)
SetupControls()
EndFunction Player
Main(PlayerData)
// Main loop
do
joystickX# = GetVirtualJoystickX( 1 )
joystickY# = GetVirtualJoystickY( 1 )
x# = GetSpriteX( PlayerData.obj )
y# = GetSpriteY( objPlayer )
SetSpritePosition( objPlayer, x# + ( joystickX# / 0.5 ), y# + ( joystickY# / 0.5 ) )
Print ("JoyStick X: "+Str(GetVirtualJoystickX(1),2))
Print ("JoyStick Y: "+Str(GetVirtualJoystickY(1),2))
Print( ScreenFPS() )
Sync()
loop
Cheers for any assistance!
DividedV -- YouTube Channel