Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function retrodemo()
- symtable = system_load("scripts/symtable.lua")();
- games = list_games({target = "snes"});
- if (#games == 0) then
- shutdown("empty database, can't proceed.");
- return;
- end
- game_1 = launch_target(
- games[math.random(#games)].gameid,
- LAUNCH_INTERNAL,
- game_callback
- );
- game_2 = launch_target(
- games[math.random(#games)].gameid,
- LAUNCH_INTERNAL,
- game_callback
- );
- move_image(game_2, VRESW * 0.5, 0);
- show_image({game_1, game_2});
- end
- function game_callback(source, status)
- if (status.kind == "resized") then
- resize_image(source, VRESW * 0.5, VRESH);
- end
- keymap = {};
- keymap["w"] = "PLAYER1_UP";
- keymap["s"] = "PLAYER1_DOWN";
- keymap["d"] = "PLAYER1_LEFT";
- keymap["a"] = "PLAYER1_LEFT";
- keymap["d"] = "PLAYER1_RIGHT";
- keymap["1"] = "PLAYER1_START";
- keymap["LCTRL"] = "PLAYER1_BUTTON1";
- keymap["LALT"] = "PLAYER1_BUTTON2";
- function retrodemo_input(input)
- if (not input.translated) then
- return;
- end
- local key = keymap[ symtable[input.keysym] ];
- if (key ~= nil) then
- input.label = key;
- target_input(game_1, input);
- target_input(game_2, input);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement