Claw Games!

Adds claw games, the absolute most-infuriating arcade game known to
mankind.
- Uses new fancy HTML5 / Javascript code stuff
- Is buildable!
- Science can produce the board with programming 2
- Requires a matter bin, manipulator, some cables, and a sheet of glass
- Costs money!
- Accepts cash or ID swipes, 15 credits per play token
- Dispenses prizeballs!
- Open them for a random plushie, carp plushie, or action figure!
- Two sets of sprites, thanks to FoS and Stephanov

Notes for the coders / future:
This provides a basic example for introducing new HTML5 / Javascript
arcade games, as well as a base type machine to use for such games.
While this may seem silly, this proves that we are not doom to have to
tolerate only the battle game and Orion Trail forever, and can even make
our own games for the arcade.
This commit is contained in:
FalseIncarnate
2015-12-09 00:37:30 -05:00
parent 4afec741fd
commit 6dfbd8f260
8 changed files with 106 additions and 49 deletions
+10 -17
View File
@@ -49,7 +49,7 @@
setTimeout(function(){
state='falling';
$('#debug-streak').html(0); //reset streak
document.getElementById("lose_btn").click();
setTimeout(gameShutDown(),500); //end game because you dropped it
},4*error+300);
}
@@ -99,16 +99,7 @@
state='hidden';
prizeWon = true;
document.getElementById("win_btn").click();
//$('#debug-streak').html(parseInt($('#debug-streak').html())+1); //inc streak
//spawn new prize
/*
setTimeout(function(){
prizes[prizes.length] = new Prize(prizes.length,{top: Math.ceil(Math.random()*100),left: original_left},crane);}
,1000);
*/
gameShutDown();
}
CheckBoundaries();
@@ -182,7 +173,7 @@
if(keys["right"] && !state) //right
left += hspd;
if(keys["down"] && !state) { //space
if(keys["down"] && !state) { //drop
state = 'down';
$('#'+id+' #crane-claw').css(frames['open']);
@@ -256,11 +247,13 @@
}
function gameShutDown(){
if(prizeWon != true)
document.getElementById("lose_btn").click();
var close_game_link = '<h2>TRY AGAIN!<a href="byond://?src=/* ref src */;prizeWon=0">\[Close Game\]</a>'
if(prizeWon)
close_game_link = '<h2>YOU WON!</h2><br><a href="byond://?src=/* ref src */;prizeWon=1">\[Close Game\]</a>'
document.getElementById('game').innerHTML = '<center><h1> GAME OVER!</h1><br>'+close_game_link+'</center>'
}</script>
</head>
<body onunload="gameShutDown()">
<body>
<div id='game' style='position: relative;'>
<div id="background"></div>
@@ -279,8 +272,8 @@
</div>
<div style='position: absolute; top: 550px'>
<br><button id="play_btn" onclick="gameStartUp()">Play Now!</button><a id="win_btn" href='byond://?src=\ref[src];prizeWon=1' hidden="true"></a><a id="lose_btn" href='byond://?src=\ref[src];prizeWon=0' hidden="true"></a>
<div id='controls' style='position: absolute; top: 550px'>
<br><button id="play_btn" onclick="gameStartUp()">Play Now!</button> <button id="close_btn" onclick="gameShutDown()">Close Game.</button>
<br>
<button onmouseover="joystickControlOn('left')" onmouseout="joystickControlOff('left')">/==<br>\==</button>
<button onmousedown="joystickControlOn('down')" onmouseup="joystickControlOff('down')">DROP<br>CLAW</button>