Hrek : Menkszts DarkBASIC-ben |
Menkszts DarkBASIC-ben
::Tutorial:: 2004.06.19. 17:39
Wolfee volt olyan kedves, s a frumon rt neknk egy tutorialt. Ezttal is ksznm a segtsgt, s tovbbra is szvesen vrok ltalatok ksztett tutorialokat, lersokat. Wolfee rst itt olvashatjtok.
TUTORIAL - MEN
Ebben a lersban egy elgg egyszer menrendszert fogok nektek bemutatni, ami nlam mkdtt:
main_menu:
Httrkp betltse: load bitmap "menu_image2.bmp"
A menelemek kirsa, fehr sznnel: ink rgb(255,255,255),0 text 20,120,"j jtk" text 20,160,"Betlts" text 20,200,"Belltsok" text 20,240,"Ksztk" text 20,280,"Kilps"
A ciklus kezdete: repeat
Ha az egr egy menelem felett van, akkor az srga lesz. Ezt gy rhetjk el, hogy megvizsgljuk az egr helyzett, s ha az egyik menelem felett van, akkor az srgv vlik, ha elhzzuk rla, akkor fehr lesz, s ha rkattintunk, akkor kilp. A kilps helyett egyb gosub, illetve ms utastsokat tehetnk be. if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 110) and (mousey() <=130))) then ink rgb(255,255,0),0 : text 20,120,"j jtk" if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 110) or (mousey() >130))) then ink rgb(255,255,255),0 : text 20,120,"j jtk" if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 110) and (mousey() <=130))) and (mouseclick()=1)) then end if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 150) and (mousey() <=170))) then ink rgb(255,255,0),0 : text 20,160,"Betlts" if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 150) or (mousey() >170))) then ink rgb(255,255,255),0 : text 20,160,"Betlts" if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 150) and (mousey() <=170))) and (mouseclick()=1)) then end if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 190) and (mousey() <=210))) then ink rgb(255,255,0),0 : text 20,200,"Belltsok" if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 190) or (mousey() >210))) then ink rgb(255,255,255),0 : text 20,200,"Belltsok" if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 190) and (mousey() <=210))) and (mouseclick()=1)) then end if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 230) and (mousey() <=250))) then ink rgb(255,255,0),0 : text 20,240,"Ksztk" if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 230) or (mousey() >250))) then ink rgb(255,255,255),0 : text 20,240,"Ksztk" if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 230) and (mousey() <=250))) and (mouseclick()=1)) then end if (((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 270) and (mousey() <=290))) then ink rgb(255,255,0),0 : text 20,280,"Kilps" if (((mousex() < 10) or (mousex() > 100)) or ((mousey() < 270) or (mousey() >290))) then ink rgb(255,255,255),0 : text 20,280,"Kilps" if ((((mousex() >= 10) and (mousex() <= 100)) and ((mousey() >= 270) and (mousey() <=290))) and (mouseclick()=1)) then end
a ciklus vge. Az "until false" azt jelenti, hogy addig ismtli a ciklust, amg a felttel hamis nem lesz. Mivel itt nincs felttel, ezrt ez egy vgtelensgig ismtld ciklus, vagy ha valamelyik menelemet kivlasztjuk, akkor a ciklus a futs kzben szakad meg. until false
Wolfee
|