Flipping a Sprite causes the collision Circle to flip thus:
// Project: flip
// Created: 2019-01-31
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "flip" )
SetWindowSize( 1080, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1080, 720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
red = MakeColor(255,0,0) : green = MakeColor(0,255,0)
DrawBox(0,0,24,48,red,green,red,green,1)
IMG = GetImage(0,0,24,48)
This = CreateSprite(IMG)
SetSpritePosition(This,200,200)
SetSpriteShapeCircle(This,0,-12,12)
That = CloneSprite(This)
SetSpritePosition(That,300,200)
SetPhysicsDebugOn()
NextFlip = Timer() + 1
do
if Timer() > NextFlip
if GetSpriteFlippedH(This) = 1
SetSpriteFlip(This,0,0)
SetSpriteFlip(That,0,0)
else
SetSpriteFlip(This,1,0)
SetSpriteFlip(That,0,1)
endif
NextFlip = Timer() + 1
endif
Print( ScreenFPS() )
Sync()
loop
Original discussion including
errors in AppGameKit Source.