TGC Codebase Backup



really simple code menu(so easy to understand!!!!) by gameer meeting

24th Oct 2009 9:46
Summary

this is so easy to use



Description

to add another button under do put down
if Button(where it is e.g 20,55 , "the name of your button") = 1 then goto where ever it is. e.g start button would be
if button(20,55,"newgame")=1 then goto newgame

newgame:
the the code hear.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Do
if Button(20,55,"New Game")=1 then Goto New_Game
Button(20,95,"Load Game")
If Button(20,135,"Exit")=1 then End
sync
loop

function Button(x1,y1,WORDS$)
Pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1 and mousex()<x1+x2
if mousey()>y1-y2 and mousey()<y1+y2
Pressed=1
endif
endif
if pressed=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed