I have a set of files I start each game with. It's constants file, a boilerplate main.agc, and some placeholder backgrounds. Here's the main.agc file. If I remember correctly, I modeled it after something PSY coded a while back. I keep a lot of stuff commented in the beginning so if I need any of those elements, I just c-n-p and uncomment it.
// ====================================
// Project: NEWPROJECT
// Date:
// By: John Albano
// ====================================
// #option_explicit
SetErrorMode(2)
// ====================================
// Initialize Graphics display
// ====================================
initdisplay("NEW PROJECT", 1366, 768, 1, 60) //title, width, height, orientation, maxfps
// orientation: 1=land 2=port 3=both
// ====================================
// CONSTANTS
// ====================================
#constant eliteness 1337
#constant luggagecode 12345
#constant appx 1366
#constant appy 768
// ====================================
// TYPES, ARRAYS, AND VARIABLES
// ====================================
type tabinfo
sfile as string
sname as string
id as integer
endtype
// global dim button[numtabs,numbuts] as tabinfo // The array - [tabs,buttons]
global GameMode as integer // The current GameMode
global LoadInit as integer
global LoadMenu as integer
global LoadMisc as integer
global LoadGame as integer
global LoadOver as integer
global LoadRank as integer
global LoadOpts as integer
global LoadQuit as integer
// ====================================
// BUTTONS, SOUNDS, AND TEXT
// ====================================
// Images and sounds
// LoadImage(1,"imagename.png")
//====================----
// LoadSound(1,"soundname.wav")
// Load Background (General)
LoadImage(1000,"bkgdinit.png")
CreateSprite(1000,1000)
SetSpriteDepth(1000,50)
SetSpritePosition(1000,0,0)
SetSpriteVisible(1000,0)
// Load Credits
LoadImage(1001,"bkgdmenu.png")
CreateSprite(1001,1001)
SetSpriteDepth(1001,1000)
SetSpritePosition(1001,0,0)
SetSpriteVisible(1001,0)
// Load Background for Main Menu
LoadImage(1002,"bkgdgame.png")
CreateSprite(1002,1002)
SetSpriteDepth(1002,5000)
SetSpritePosition(1002,0,0)
SetSpriteVisible(1002,0)
// Creating Sprites
// LoadImage(80,"roundlost.png")
// CreateSprite(80,80)
// SetSpriteDepth(80,5)
// SetSpriteVisible(80,0)
// SetSpritePosition(80,512,256)
// Creating virtual buttons
// AddVirtualButton(1,900,420,90)
// SetVirtualButtonAlpha(1,252)
// SetVirtualButtonSize(1,303,120)
// SetVirtualButtonColor(1,255,255,255)
// SetVirtualButtonText(1,"BTN TEXT") // Use this if using default button image
// SetVirtualButtonVisible(1,0)
// SetVirtualButtonImageDown(1,img1dn)
// SetVirtualButtonImageUp(1,img1up)
// Creating text items
// MyScore = CreateText("0")
// SetTextSize(MyScore,98)
// SetTextBold(MyScore,1)
// SetTextColor(MyScore,255,255,0,255)
// SetTextPosition(MyScore,384,227)
// SetTextAlignment(MyScore,1)
// Credits
CreateText(100,"NEWPROJECT • © 2020 • BY JOHN ALBANO")
SetTextSize(100,18)
SetTextPosition(100,appx/2,appy-20)
SetTextAlignment(100,1)
// =====================================
// Pre mainloop calls and setup
// =====================================
GameMode = 1
LoadInit = 1
LoadMenu = 1
LoadMisc = 1
LoadGame = 1
LoadOver = 1
LoadRank = 1
LoadOpts = 1
LoadQuit = 1
// ==========================================================================
// MAIN LOOP - START
// ==========================================================================
//
do
Select GameMode
// 1 Init 2 Menu 3 Game 4 Over 5 Rank 6 Opts 7 Book 9 Quit
Case 0
//Splash()
EndCase
Case 1
Init()
EndCase
Case 2
Menu()
EndCase
Case 3
Game()
EndCase
Case 4
// Over()
EndCase
Case 5
// Rank()
EndCase
Case 6
// Opts()
EndCase
Case 9
// Quit()
EndCase
EndSelect
fps = val(str(ScreenFPS()))
Print( "FPS: " + str(fps) )
Sync()
//If GetVirtualButtonPressed(1)
//// PlaySound(1)
//EndIf
loop
//
// ==========================================================================
// MAIN LOOP - END
// ==========================================================================
// ==== Init Functions ===============
// =====================================
Function Init()
If LoadInit = 1
// Load Title Screen Stuff
SetSpriteVisible(1000,1)
Print("Load Init...")
LoadInit = 0
EndIf
// Do Initialization Stuff
Print("Init complete.")
If GetPointerPressed()
WipeInit()
GameMode = 2
LoadMenu = 1
EndIf
EndFunction
Function WipeInit()
// Wipe Title Screen Stuff
SetSpriteVisible(1000,0)
EndFunction
// ==== Menu Functions ===============
// =====================================
Function Menu()
If LoadMenu = 1
// Load Main Menu stuff
SetSpriteVisible(1001,1)
Print("Load Menu...")
LoadMenu = 0
EndIf
// Do Main Menu Stuff
Print("Menu Running")
If GetPointerPressed()
WipeMenu()
GameMode = 3
LoadGame = 1
EndIf
EndFunction
Function WipeMenu()
// Wipe Main Menu Stuff
SetSpriteVisible(1001,0)
EndFunction
// ==== Game Functions ===============
// =====================================
Function Game()
If LoadGame = 1
// Load Game Stuff
SetSpriteVisible(1002,1)
Print("Load Game...")
// Reset Variables etc
GameOver = 0
LoadGame = 0
EndIf
// Do Game Stuff
If GameOver = 0
// Play Game
Print("Game Playing")
If GetPointerPressed()
WipeGame()
GameMode = 1
LoadInit = 1
EndIf
EndIf
EndFunction
Function WipeGame()
// Wipe Game Stuff
SetSpriteVisible(1002,0)
EndFunction
// ==== End Game Functions ===========
// =====================================
Function EndGame()
// End game stuff
EndFunction
// ==== Options Functions ============
// =====================================
Function Opts()
// Options screen items
EndFunction
// ====================================
// Function - delay by seconds
// ====================================
Function Delay(seconds#)
ResetTimer()
repeat
Sync()
until Timer() >= seconds#
EndFunction
// ====================================
// Function - Init Display
// ====================================
Function InitDisplay(title as String, width as Integer, height as Integer, orient as Integer, maxframerate as Float)
// set window properties
SetWindowTitle(title)
SetWindowSize(width, height, 0)
// set display properties
SetVirtualResolution(width, height)
// set orientation restrictions
Select orient
Case 1
SetOrientationAllowed(0,0,1,1)
EndCase
Case 2
SetOrientationAllowed(1,1,0,0)
EndCase
Case 3
SetOrientationAllowed(1,1,1,1)
EndCase
EndSelect
SetSyncRate(maxframerate, 0)
UseNewDefaultFonts(1)
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
EndFunction