this is the code in player.agc
#include "constants.agc"
type tipoPlayer
sprite as integer
endtype
function iniciarPlayer(play ref as tipoPlayer)
if (GetSpriteExists(play.sprite) = FALSE) then play.sprite = CreateSprite(loadImage("orange_cat.png"))
SetSpritePhysicsOn(play.sprite, 2)
endfunction
then , I create the player in main.agc
#include "player.agc"
player as tipoPlayer
iniciarPlayer(player) //iniciar objeto
SetPhysicsDebugOn()
setClearColor(255,255,255)
SetVirtualResolution( 800, 600 )
SetSyncRate( 30, 0 )
do
Sync()
loop