/* Even the simplest example like this does not export to the Android APK file, there is an error "Failed to copy source folder":
*/
SetErrorMode(2)
SetWindowTitle("android_example" )
width = GetMaxDeviceWidth ( )
height = GetMaxDeviceHeight ( )
SetWindowSize( width, height, 1 )
SetWindowAllowResize( 1 )
SetVirtualResolution( 100, 100 )
SetOrientationAllowed( 1, 1, 1, 1, 1 )
SetSyncRate( 60, 0 ) // 30 frames per second instead of 60 to save battery
SetScissor( 0,0,0,0,0 )
UseNewDefaultFonts( 1 )
SetRawMouseVisible( 1 )
#constant KEY_ESC 27
// artificial skybox
SetSkyBoxSkyColor(77,121,255)
SetSkyBoxHorizonSize(15,0)
SetSkyBoxHorizonColor(255,255,255)
SetSkyBoxVisible(1)
// fog
SetFogMode(1)
SetFogRange(50,1000)
SetFogColor(255,255,255)
ground = CreateObjectPlane( 10000, 10000 )
RotateObjectGlobalX( ground, 90 )
SetObjectColor(ground,0,128,0,255)
SetObjectPosition(ground,0,-100,0)
cube = CreateObjectBox(10,10,10)
SetObjectColor(cube,0,0,255,255)
SetObjectPosition(cube,0,5,30)
AddVirtualJoystick(1,15,85,20)
make
RotateCameraLocalX(1,GetVirtualJoystickY(1))
// keep the x-axis within certain limits
if GetCameraAngleX(1) > 50, then RotateCameraLocalX(1,0-GetVirtualJoystickY(1))
if GetCameraAngleX(1) < -50, then RotateCameraLocalX(1,0-GetVirtualJoystickY(1))
RotateCameraLocalY(1,GetVirtualJoystickX(1))
SetCameraRotation( 1, GetCameraAngleX(1), GetCameraAngleY(1), 0 ) // This is to keep the camera upright
If GetRawKeyState(KEY_ESC) then end
Sync()
loop
/* what's written here https://forum.thegamecreators.com/thread/227716 doesn't help.
*/