Hi, I'm starting a new app using AGK(trial). I'm going to buy AppGameKit in awhile, so please don't hate. The app only goes to a menu for now, only the quit option works when you click on it.
I'm not sure if its my computer or the app itself but i get really low FPS. It starts out fine in the beginning, but then the FPS drops low a 7-8.
Can some one help me out and check if its the apps code or my computer?
Ill include the app in my post so anyone can download and try it.
Here is the Download link:
http://www.yourfilelink.com/get.php?fid=722908
And here is the app code: There are some unused stuff in there so just never-mind it.
rem AGK Application
//Author: Shawn W. Benson
//Game based on the mysterious substance known as starjelly
//A spaceshooter game, simple yet fun.
//Date of creation: Septemper 01, 2011
//Ported to AGK on: November 06, 2011
//Begin main scoure code
//*******************************Initailize the game*******************************
startgame() `call function to start the game and load everything nessesary
//*******************************Start the main game loop*******************************
repeat
select gamestate$
case "menu":
menu() //call function to load the menu screen
endcase
case "play":
endcase
endselect
sync()
until gamestate$ = "quit" //only quit when the play chooses to do so
`endscreen() //call function to display a end message whne the player chooses to quit the game
end
//*******************************************Functions section****************************************
//This function sets up the game to ready it for play
function startgame()
setsyncrate (60, 0)
//*******************Figure out which device this game is being played on*****************************
if getdevicename() = "windows"
setvirtualresolution (640, 480)
global mousex# as float
global mousey# as float
global pointer$ as string = "mouse"
endif
if getdevicename() = "Bada"
setvirtualresolution (800, 480)
global pointerX# as float
global pointery# as float
global pointer$ as string = "touch"
endif
//**************************************Declare all global variables***********************************
global gamestate$ as string = "menu" //set the main menu to appear after the splash screen
endfunction
//this fuction creates a menu screen for player to pick what they want to do next
function menu()
starjelly = createtext("STARJELLY")
settextposition ( starjelly, 320, 50)
settextsize (starjelly, 75)
settextalignment ( starjelly , 1)
settextcolor (starjelly, 96, 0, 191, 255)
if mousex# > 224 and mousey# > 155 and mousex# < 416 and mousey# < 177
play = createtext("PLAY GAME")
settextposition ( play, 320, 150)
settextsize (play, 35)
settextalignment ( play , 1)
settextcolor (play, 255, 255, 255, 255)
else
play = createtext("PLAY GAME")
settextposition ( play, 320, 150)
settextsize (play, 35)
settextalignment ( play , 1)
settextcolor (play, 96, 0, 191, 255)
endif
if mousex# > 243 and mousey# > 251 and mousex# < 395 and mousey# < 278
options = createtext("OPTIONS")
settextposition ( options, 320, 250)
settextsize (options, 35)
settextalignment ( options , 1)
settextcolor (options, 255, 255, 255, 255)
else
options = createtext("OPTIONS")
settextposition ( options, 320, 250)
settextsize (options, 35)
settextalignment ( options , 1)
settextcolor (options, 96, 0, 191, 255)
endif
if mousex# > 276 and mousey# > 352 and mousex# < 360 and mousey# < 378
help = createtext("HELP")
settextposition ( help, 320, 350 )
settextsize (help, 35)
settextalignment ( help , 1)
settextcolor (help, 255, 255, 255, 255)
else
help = createtext("HELP")
settextposition ( help, 320, 350 )
settextsize (help, 35)
settextalignment ( help , 1)
settextcolor (help, 96, 0, 191, 255)
endif
if mousex# > 9 and mousey# > 449 and mousex# < 59 and mousey# < 470
quit = createtext("QUIT")
settextposition ( quit, 35, 450 )
settextalignment ( quit , 1)
settextsize (quit, 20)
settextcolor (quit, 255, 255, 255, 255)
if getrawmouseleftreleased() = 1 then gamestate$ = "quit"
else
quit = createtext("QUIT")
settextposition ( quit, 35, 450 )
settextalignment ( quit , 1)
settextsize (quit, 20)
settextcolor (quit, 96, 0, 191, 255)
endif
if mousex# > 537 and mousey# > 451 and mousex# < 622 and mousey# < 464
credits = createtext("CREDITS")
settextposition ( credits, 580, 450 )
settextsize (credits, 20)
settextalignment ( credits , 1)
settextcolor (credits, 255, 255, 255, 255)
else
credits = createtext("CREDITS")
settextposition ( credits, 580, 450 )
settextsize (credits, 20)
settextalignment ( credits , 1)
settextcolor (credits, 96, 0, 191, 255)
endif
if mousex# > 256 and mousey# > 450 and mousex# < 380 and mousey# < 466
highscore = createtext("HIGHSCORES")
settextposition ( highscore, 320, 450 )
settextsize (highscore, 20)
settextalignment ( highscore , 1)
settextcolor (highscore, 255, 255, 255, 255)
else
highscore = createtext("HIGHSCORES")
settextposition ( highscore, 320, 450 )
settextsize (highscore, 20)
settextalignment ( highscore , 1)
settextcolor (highscore, 96, 0, 191, 255)
endif
mousex# = getpointerx()
mousey# = getpointery()
print (screenfps())
print (mousex#)
print (mousey#)
endfunction
Programming and video games, what else could you need?