Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "script/Tutorial/lib_sound.dnh"
- let selectIndex = 0;
- let obj = ObjPrim_Create(OBJ_SPRITE_2D);
- @Initialize{
- SetAutoDeleteObject(true);
- TBackground;
- TMenu;
- }
- @MainLoop{
- yield;
- }
- @Finalize{
- }
- task TBackground{
- ObjPrim_SetTexture(obj, "script/Tutorial/images/screensave.png");
- ObjSprite2D_SetSourceRect(obj, 0, 0, 640, 480);
- ObjSprite2D_SetDestRect(obj, 0, 0, 640, 480);
- Obj_SetRenderPriorityI(obj, 10);
- }
- task TMenu{
- if(GetCommonData("Continues", 0) < 0){
- selectIndex = 1;
- }
- let texts = ["Continue", "Return to Title", "Save Replay", "Retry Game"];
- let elementCount = length(texts);
- let X = -70;
- let Y = 220;
- ascent(i in 0..elementCount){
- TMenuItemText(i, X, Y, texts[i]);
- Y += 40;
- }
- while(GetVirtualKeyState(VK_OK) != KEY_FREE || GetVirtualKeyState(VK_CANCEL) != KEY_FREE){yield;}
- let frameKeyHold = 0;
- loop{
- if(GetVirtualKeyState(VK_OK) == KEY_PUSH){
- ok0(40);
- SetScriptResult(selectIndex);
- CloseScript(GetOwnScriptID());
- return;
- yield;
- }
- Obj_Delete(obj);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement