GXSceneStart - boxgaming/gx GitHub Wiki

Syntax

GXSceneStart

Description

Start the game loop.
This method will not return control to the calling program until the game loop is interrupted with the GXSceneStop method. Game events will be sent to the GXOnGameEvent method throughout game loop execution.

Examples

Example1: Create a scene and start the game loop. Exit the game loop when the user presses the ESC key. Once the game loop completes print a message and exit.

'$INCLUDE: 'gx.bi'

GXSceneCreate 320, 200
GXSceneStart
PRINT "Game Over"

SUB GXOnGameEvent (e AS GXEvent)
    SELECT CASE e.event
        CASE GXEVENT_UPDATE
            IF GXKeyDown(GXKEY_ESC) THEN GXSceneStop
    END SELECT
END SUB

'$INCLUDE: 'gx.bm'

See Also

GXSceneCreate, GXSceneStop