You need to create a function or sub-routine in the player.agc file that you call from the first file. Not sure what you are trying to do here but having multiple do-loop's can cause all sorts of problems.
Here is a simple example of what an additional file is good for.
main.agc:
#include "player.agc"
// Project: Quest For The Pie
// Created: 2015-01-30
// set window properties
SetWindowTitle( "Quest For The Pie" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
//Creation
dead = 0
//Background
background = createSprite(0)
setSpriteColor(background,0,255,0,128)
do
//background properties
setSpriteDepth(background, 1000)
setSpriteSize(background,10000,-1)
//If dead
if dead = 1
setSpriteColor(background,255,0,0,128)
GameOver()
setSpriteColor(background,255,255,255,128)
endif
Sync()
loop
player.agc:
function GameOver()
doneHere = 0
repeat
print("Game Over-Click to continue")
if GetPointerPressed()>0 then doneHere = 1
Sync()
until doneHere>0
endfunction
Using AppGameKit V2 Tier 1