-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
630 lines (542 loc) · 23.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
<!DOCTYPE html><html><head><title>Joyrider3774's Browser Stuff</title><meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui=1"><meta charset="UTF-8"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="description" content=""><link rel="manifest" href="manifest.json"><link rel="icon" type="image/png" href="icon64.png"><link rel="apple-touch-icon" sizes="180x180" href="icon180.png"><link rel="icon" type="image/png" sizes="32x32" href="icon32.png"><link rel="icon" type="image/png" sizes="16x16" href="icon16.png"><style>html,body {
margin: 0;
padding: 0;
background-color: #000;
overflow:hidden;
font-family: Verdana;
}
.noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#canvaswrapper {
text-align: center ;
}
</style><style>@font-face { font-family: "BitCell" ; src: url("fonts/BitCell.ttf") format("truetype"); }</style><style>@font-face { font-family: "Edunline" ; src: url("fonts/Edunline.ttf") format("truetype"); }</style><script>window.fonts = ["BitCell","Edunline"]</script></head><body class="noselect custom-cursor" oncontextmenu="return false;"><div id="canvaswrapper"></div><script type="text/javascript">var resources = {"images":[{"file":"arrow_left.png","version":11,"size":175,"properties":{"frames":1,"fps":5}},{"file":"arrow_right.png","version":6,"size":177,"properties":{"frames":1,"fps":5}},{"file":"exit.png","version":21,"size":152,"properties":{"frames":1,"fps":5}},{"file":"gamepad.png","version":33,"size":327,"properties":{"frames":1,"fps":5}},{"file":"icon.png","version":250,"size":748,"properties":{"frames":1,"fps":5}},{"file":"icon_transparent.png","version":19,"size":741,"properties":{"frames":1,"fps":5}},{"file":"keyboard.png","version":24,"size":272,"properties":{"frames":1,"fps":5}},{"file":"microstudio.png","version":1,"size":17652,"properties":{}},{"file":"poster.png","version":4,"size":56514,"properties":{"frames":1,"fps":5}},{"file":"rotate.png","version":47,"size":286,"properties":{"frames":1,"fps":5}},{"file":"touch.png","version":25,"size":239,"properties":{"frames":1,"fps":5}}],"assets":[],"maps":{},"sounds":[{"file":"microfxr-back.wav","version":1,"size":51772,"properties":{}},{"file":"microfxr-enter.wav","version":1,"size":51772,"properties":{}},{"file":"microfxr-switch.wav","version":1,"size":4872,"properties":{}},{"file":"microfxr-welcome.wav","version":1,"size":95192,"properties":{}}],"music":[]};
var graphics = "M1";
</script><script type="text/javascript">var orientation = 'landscape' ;
var aspect = 'free' ;
var ms_libs = [] ;
window.skip_service_worker = true;
window.exported_project = true;
window.ms_use_server = false ;
</script><script src="compiler.js"></script><script src="parser.js"></script><script src="processor.js"></script><script src="program.js"></script><script src="routine.js"></script><script src="runner.js"></script><script src="token.js"></script><script src="tokenizer.js"></script><script src="transpiler.js"></script><script src="microengine.js"></script></body><script type="text/javascript">//
//
// The game is started with the code below.
// Once you have received the "started" signal (see below),
// you can do the following:
// 1) Inject functions or objects into the global context of the microStudio engine, example:
//
// window.player.setGlobal("special_callback",function(x) { console.info(x) }) ;
// // Your microScript code can now call the "special_callback" function
//
// 2) Call microScript global functions from your JavaScript code, example:
//
// window.player.call("call_me_from_javascript",[10,1000]) ;
// // arguments to the function call are provided as an array
//
// 3) Run a microScript code snippet from your JavaScript code, example:
//
// window.player.exec("player.position_x = 50",function(result) { console.log(result) ; }) ;
//
window.addEventListener("load",function() {
window.player = new Player(function(event) {
if (event.name == "started") {
// signal that the game is started
}
else if (event.name == "log") {
// console.info(event.data) ;
}
}) ;
document.body.focus() ;
}) ;
</script><script id="code" type="text/x-microscript">
function()
//in order for games to show an icon must exist
//in order for games to load the following needs to be added to the html page of the game
//you also need to add gamecontroller.min.js in same directory as your html file (for controller suppor)
//from https://github.com/alvaromontoro/gamecontroller.js/blob/master/dist/gamecontroller.min.js
/* <!--
<script>
if(window.parent)
{
window.document.addEventListener('keydown', (event) => {
if(event.key == "Escape")
{
console.log('sended quit');
window.parent.postMessage(JSON.stringify({name:"quit"}), "*");
}
});
window.addEventListener('load', (event) => {
console.log('sended start');
window.parent.postMessage(JSON.stringify({name: "start"}), "*");
});
}
</script>
<script src="./gamecontroller.min.js" >
gameControl.on('connect', function(gamepad) {
gamepad.before('start', functions() {
console.log('sended gamepad quit');
window.parent.postMessage(JSON.stringify({name:"quit"}), "*");
});
});
</script>
-->*/
addGame = function(title,engine,itemtype,gameiconurl, gameurl, isMicroStudioGame)
games += object
title = title
iconurl = gameiconurl
engine = engine
isMicroStudioGame = isMicroStudioGame
itemtype = itemtype
url = gameurl
end
end
addGames = function()
games = []
//microstudio stuff
addGame("Fire","MicroStudio", "Effect", "https://joyrider3774.github.io/my_browser_games/fire_microstudio/icon32.png","https://joyrider3774.github.io/my_browser_games/fire_microstudio", true)
addGame("Plasma","MicroStudio", "Effect", "https://joyrider3774.github.io/my_browser_games/plasma_microstudio/icon32.png","https://joyrider3774.github.io/my_browser_games/plasma_microstudio", true)
addGame("Fire + Plasma","MicroStudio", "Effect", "https://joyrider3774.github.io/my_browser_games/fireplasma_microstudio/icon32.png","https://joyrider3774.github.io/my_browser_games/fireplasma_microstudio", true)
addGame("Blockdude","MicroStudio", "Game", "https://joyrider3774.github.io/my_browser_games/blockdude_microstudio/icon32.png","https://joyrider3774.github.io/my_browser_games/blockdude_microstudio", true)
addGame("Maze Thingie","MicroStudio", "Game", "https://joyrider3774.github.io/my_browser_games/mazethingie_microstudio/icon32.png","https://joyrider3774.github.io/my_browser_games/mazethingie_microstudio", true)
addGame("Znax","MicroStudio", "Game", "https://joyrider3774.github.io/my_browser_games/znax_microstudio/icon32.png","https://joyrider3774.github.io/my_browser_games/znax_microstudio", true)
//playdate stuff
addGame("Blockdude","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/blockdude_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/blockdude_playdate", false)
addGame("Dynamate","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/dynamate_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/dynamate_playdate", false)
addGame("Formula 1","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/f1_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/f1_playdate", false)
addGame("Puztrix","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/puztrix_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/puztrix_playdate", false)
addGame("Puzzleland","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/puzzleland_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/puzzleland_playdate", false)
addGame("Retrotime","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/retrotime_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/retrotime_playdate", false)
addGame("Rubdio","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/rubido_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/rubido_playdate", false)
addGame("Waternet","Playdate", "Game", "https://joyrider3774.github.io/my_browser_games/waternet_playdate/icon.png","https://joyrider3774.github.io/my_browser_games/waternet_playdate", false)
//godot stuff
addGame("Faster Dave","Godot", "Game", "https://joyrider3774.github.io/my_browser_games/fasterdave_godot/index.icon.png","https://joyrider3774.github.io/my_browser_games/fasterdave_godot", false)
//WASM4 stuff
addGame("Formula 1","WASM4", "Game", "https://joyrider3774.github.io/my_browser_games/f1_wasm4/icon.png","https://joyrider3774.github.io/my_browser_games/f1_wasm4", false)
addGame("Maze Thingie","WASM4", "Game", "https://joyrider3774.github.io/my_browser_games/mazethingie_wasm4/icon.png","https://joyrider3774.github.io/my_browser_games/mazethingie_wasm4", true)
addGame("Rubdio","WASM4", "Game", "https://joyrider3774.github.io/my_browser_games/rubido_wasm4/icon.png","https://joyrider3774.github.io/my_browser_games/rubido_wasm4", false)
addGame("Waternet","WASM4", "Game", "https://joyrider3774.github.io/my_browser_games/waternet_wasm4/icon.png","https://joyrider3774.github.io/my_browser_games/waternet_wasm4", false)
//Arduboy stuff
addGame("Waternet","Arduboy", "Game", "https://joyrider3774.github.io/my_browser_games/waternet_arduboy/icon.png","https://joyrider3774.github.io/my_browser_games/waternet_arduboy", false)
//Gamebuino Meta stuff
addGame("Waternet","Gamebuino", "Game", "https://joyrider3774.github.io/my_browser_games/waternet_gamebuino/icon.png","https://joyrider3774.github.io/my_browser_games/waternet_gamebuino", false)
//Game boy Stuff
addGame("Waternet","Game Boy", "Game", "https://joyrider3774.github.io/my_browser_games/waternet_gameboy/icon.png","https://joyrider3774.github.io/my_browser_games/waternet_gameboy", false)
end
sortfunc = function(a, b)
keyA = a.title + a.itemtype + a.engine
keyB = b.title + b.itemtype + b.engine
if (sortkey == "engine") then
keyA = a.engine + a.title + a.itemtype
keyB = b.engine + b.title + b.itemtype
end
if(sortkey == "itemtype") then
keyA = a.itemtype + a.title + a.engine
keyB = b.itemtype + b.title + b.engine
end
if(sortdir != "▲") then
tmp = keyA
keyA = keyB
keyB = tmp
end
// Compare the 2 dates
if (keyA < keyB) then
return -1
end
if (keyA > keyB) then
return 1
end
return 0
end
sortGames = function()
games.sortList(sortfunc)
end
shuffle = function()
local g = []
while games.length > 0
local game = games.removeAt(random.nextInt(games.length))
g += game
end
games = g
end
end()
system.javascript("""
// javascript
this.embed = function(url,close_button, isMicroStudioGame) {
console.info(url);
console.info("close_button = "+close_button)
var canvas = document.querySelector("canvas") ;
var parent = canvas.parentNode ;
var iframe = document.createElement("iframe") ;
iframe.src = url;
//added fullscreen 'none' to prevent iframe page going fullscreen even on same domain
iframe.allow = "autoplay; gamepad; midi; fullscreen 'none';";
iframe.style = "position: absolute ; top: 0 ; left: 0 ; width: 100% ; height: 100% ; border: none ; z-index: 0 ; transition-property: opacity ; transition-duration: 2s ; opacity: 0";
iframe.allowFullscreen = false ;
canvas.style["transition-property"] = "opacity" ;
canvas.style["transition-duration"] = "1s" ;
parent.insertBefore(iframe,canvas)
iframe.contentWindow.addEventListener("load",()=>{
//somehow using iframe.XXX caused errors in console
//so just search for the frame
let tmpframe = document.querySelector("iframe")
if(tmpframe)
{
tmpframe.contentWindow.focus();
tmpframe.style.opacity = 1 ;
}
else
console.log("warning iframe not found");
})
//for handling events send by games html pages to notify quit from gamepad
//or start of game (so it fades from black to the game)
window.addEventListener('message', (event) => {
//console.log(event);
data = JSON.parse(event.data);
if(data.name == "quit"){
global.back_to_menu = true ;
}
if(data.name == "start")
{
//somehow using iframe.XXX caused errors in console
//so just search for the frame
let tmpframe = document.querySelector("iframe")
if(tmpframe)
{
tmpframe.contentWindow.focus();
tmpframe.style.opacity = 1 ;
}
else
console.log("warning iframe not found");
}
});
iframe.contentWindow.addEventListener('keydown', (event) => {
console.log('Keydown event in iframe:', event);
if (event.key == "Escape") {
global.back_to_menu = true ;
}
});
if (close_button) {
var img = new Image() ;
img.src = "sprites/exit.png" ;
img.id = "exit-button" ;
//increased the z-index
//because wasm4 games set the z-index of the window (iframe) to some higher value
img.style = "width: 5vw ; position: fixed ; top: 1.5vw ; right: 1.5vw ; opacity: .5 ; image-rendering: moz-crisp-edges; image-rendering: pixelated ; z-index: 9999999;" ;
document.body.appendChild(img) ;
img.addEventListener("click",()=>{global.back_to_menu = true})
}
setTimeout(()=> {
global.processactionsagain = false;
canvas.style.opacity = 0 ;
setTimeout(()=>{
canvas.style.display = "none" ;
global.processactionsagain = true;
},1000)
},0)
setTimeout(()=>{
},500)
global.canvas = canvas
global.iframe = iframe
global.window = window
}
this.restore = function() {
var iframe = document.querySelector("iframe") ;
if (iframe) {
iframe.parentNode.removeChild(iframe) ;
}
var canvas = document.querySelector("canvas") ;
canvas.style.display = "block" ;
setTimeout(()=>{
global.processactionsagain = false;
canvas.style.opacity = 1 ;
setTimeout(()=>{
global.processactionsagain = true;
},500)
},1)
setTimeout(()=>{
},500)
setTimeout(()=> { window.focus() },100)
var exit = document.getElementById("exit-button") ;
if (exit) {
exit.parentNode.removeChild(exit) ;
}
}
this.loadImage = function(url,callback) {
var img = new Image() ;
img.src = url ;
img.onload = ()=> { callback(new global.Image(img)) } ;
}
/*<!--
var fullscreendone = false ;
document.body.addEventListener("mouseup",()=> {
if (! fullscreendone) {
fullscreendone = true ;
document.body.requestFullscreen() ;
}
}) ;
-->*/
""")
function()
CRT = function(size = 240,intensity = .5)
if not CRT_BUFFER.type or size != CRT_BUFFER_SIZE or intensity != CRT_BUFFER_INTENSITY then
CRT_BUFFER_SIZE = size
size *= 2
CRT_BUFFER_INTENSITY = intensity
CRT_BUFFER = new Image(size,size)
CRT_BUFFER.setRadialGradient(size/2,size/2,size/2*1.4142,"rgba(0,0,0,0)","rgba(0,0,0,"+intensity+")")
CRT_BUFFER.fillRect(0,0,size,size)
CRT_BUFFER.setRadialGradient(size/2,size/2,size/2*3,"rgba(0,0,0,0)","rgba(0,0,0,"+intensity+")")
for i=0 to size by 4
//CRT_BUFFER.drawLine(0,0,200,200)
CRT_BUFFER.drawLine(0,i+.5,size,i+.5)
end
end
screen.setPixelated(false)
screen.drawImage(CRT_BUFFER,0,0,screen.width,screen.height)
screen.setPixelated(true)
end
end()
function()
init = function()
sortkey = "title"
sortdir = "▲"
addGames()
sortGames()
for game in games
loadImage(game.iconurl,function(img)
game.image = img
end)
end
browse_position = 0
browse_selected = 0
target_position = 0
position_speed = 0
started = false
back_to_menu = false
dragging = false
processactionsagain = true
control_modes = ["keyboard","gamepad","touch"]
control = object end
clickable = []
mode = "browse"
screen.setFont("Edunline")
end
update = function()
if not started then
if (mouse.press or keyboard.press.ENTER or gamepad.press.A) then
started = true
audio.playSound("microfxr/welcome",.125)
end
return
end
if processactionsagain and gamepad.press.RIGHT or gamepad.press.LEFT or gamepad.A or gamepad.Y then
control_modes = ["gamepad"]
end
if processactionsagain and keyboard.press.Y or keyboard.press.RIGHT or keyboard.press.LEFT or keyboard.press.ENTER or keyboard.press.SPACE then
control_modes = ["keyboard"]
end
//added processaction again
//i could get the system stuck by fastly pressing escape and enter and mouse clicks
//now when fading starts things will be disabled and renabled when fading ended
control.LEFT = processactionsagain and gamepad.press.LEFT or keyboard.press.LEFT
control.RIGHT = processactionsagain and gamepad.press.RIGHT or keyboard.press.RIGHT
control.ACTION = processactionsagain and (gamepad.press.A or keyboard.press.ENTER or keyboard.press.SPACE)
control.BACK = processactionsagain and (back_to_menu or gamepad.press.MENU or (gamepad.X and gamepad.B))
control.SORT = processactionsagain and gamepad.press.Y or keyboard.press.Y
if touch.press and processactionsagain then
control_modes = ["touch"]
dragging = false
if abs(touch.x+150)<10 and abs(touch.y)<25 then
if target_position > 0 then
target_position -= 1
browse_selected = target_position+1
audio.playSound("microfxr/switch",.125)
end
elsif abs(touch.x-150)<10 and abs(touch.y)<25 then
if target_position < games.length-4 then
target_position += 1
browse_selected = target_position+1
audio.playSound("microfxr/switch",.125)
end
elsif abs(touch.x)<140 and abs(touch.y)<50 then
dragging = true
drag_start = target_position
drag_start_x = touch.x
drag_moved = false
browse_selected = round((touch.x+105)/70)+target_position
//tap to sort
elsif abs(touch.x)<36 and touch.y <= -85 and touch.y >=-95 then
control.SORT = true
end
end
if touch.touching and processactionsagain then
if dragging then
if abs(touch.x - drag_start_x) > 10 then
drag_moved = true
browse_selected = -1
end
if drag_moved then
target_position = max(0,min(games.length-4,drag_start+(drag_start_x-touch.x)/30))
end
end
end
if touch.release and processactionsagain then
if dragging then
dragging = false
if drag_moved then
target_position = round(target_position)
browse_selected = target_position + 1
else
control.ACTION = true
end
end
end
if mode == "browse" then
if control.SORT then
audio.playSound("microfxr/switch",.125)
if (sortdir == "▲") then
sortdir = "▼"
sortGames()
else
sortdir = ""
end
if(sortdir == "") then
if (sortkey == "itemtype") then
sortkey = "title"
else
if sortkey == "title" then
sortkey = "engine"
else
sortkey = "itemtype"
end
end
sortdir = "▲"
end
sortGames()
end
if control.RIGHT then
if browse_selected < games.length-1 then
browse_selected += 1
audio.playSound("microfxr/switch",.125)
if target_position < browse_selected-2 then
target_position += 1
target_position = min(games.length-4,target_position)
end
end
end
if (control.LEFT) and browse_selected > 0 then
browse_selected -= 1
audio.playSound("microfxr/switch",.125)
if target_position > browse_selected-1 and target_position > 0 then
target_position -= 1
end
end
if control.ACTION then
//remember it somehow selected wrong position
//after quiting games
browse_selected_pushed = browse_selected
tartget_position_pushed = target_position
mode = "play"
audio.playSound("microfxr/enter",.125)
local game = games[browse_selected]
embed(game.url,control_modes[0] == "touch", game.isMicroStudioGame)
end
else
if control.BACK then
restore()
mode = "browse"
audio.playSound("microfxr/back",.125)
//restore so we keep same selection and view
browse_selected = browse_selected_pushed
target_position = tartget_position_pushed
back_to_menu = false
end
end
position_speed += (target_position-browse_position)*.1
position_speed *= .5
browse_position += position_speed
end
draw = function()
local background = "rgb(5,30,43)"
screen.clear(background)
if screen.width < screen.height then
screen.setAlpha(.5)
screen.drawSprite("rotate",0,0,48)
screen.setAlpha(1)
return
end
screen.setFont("Edunline")
if not screen.isFontReady() then
return
end
screen.drawText("Joyrider3774's",0,80,20,"rgb(65,120,147)")
screen.drawText("BROWSER STUFF",0,55,20,"rgb(65,120,147)")
if not started then
screen.setFont("BitCell")
local size = sin((system.time()%500)/500*PI*2)
screen.fillRect(0,-25,60+size,18+size*.5,"rgb(197,87,87)")
screen.drawText("START",0,-25,10,"#FFF")
screen.drawSprite("icon_transparent",0,20)
screen.drawText("Powered by",0,-70,6,"rgba(255,255,255,.5)")
screen.setPixelated(false)
screen.drawSprite("microstudio",0,-80,50)
screen.setPixelated(true)
return
end
// screen.drawSprite("icon",-120,65,20)
screen.setFont("BitCell")
for i=0 to games.length-1 by 1
local game = games[i]
local x = (i-browse_position)*70-105
if game and game.image and abs(x) <160 then
screen.setAlpha(max(0,min(1,3-abs(x)/160*3)))
if i == browse_selected then
screen.fillRect(x,0,55,55,"rgb(255,142,85)")
screen.fillRect(x,0,51,51,background)
else
screen.fillRect(x,0,55,55,"rgba(255,255,255,.1)")
end
screen.drawSprite(game.image,x,0,50,50)
screen.drawText(game.title,x,-35,7,"rgba(255,255,255,.8)")
screen.drawText(game.itemtype,x,-42,7,"rgba(255,255,255,.8)")
screen.drawText(game.engine,x,-49,7,"rgba(255,255,255,.8)")
end
end
screen.setAlpha(.5)
if target_position > 0 then
screen.drawSprite("arrow_left",-150,0,8)
end
if target_position < games.length-4 then
screen.drawSprite("arrow_right",150,0,8)
end
local dx = -(control_modes.length-1)/2*50
for c in control_modes
screen.drawSprite(c,dx,-65,24)
dx += 50
end
if control_modes.length == 1 then
if control_modes[0] == "keyboard" then
screen.drawText("Sorted on: " + sortkey + sortdir, 0, -80, 8)
screen.drawText("ENTER to start game, Y to Sort, ESC to exit game",0,-90,8)
elsif control_modes[0] == "gamepad" then
screen.drawText("Sorted on: " + sortkey + sortdir, 0, -80, 8)
screen.drawText("[A] to start game - [Y] to Sort - [MENU] to exit game",0,-90,8)
else
screen.drawText("Tap to start game",-75,-90,8)
screen.drawText("Sorted on: " + sortkey + sortdir, 0, -90, 8)
screen.drawText("exit game with",70,-90,8)
screen.setAlpha(1)
screen.drawSprite("exit",100,-90)
end
end
screen.setAlpha(1)
// CRT()
end
end()
</script></html>