Skip to content

Commit

Permalink
Revert "Fixes fossasia#253 Adds Keyboard Control and updates the how-…
Browse files Browse the repository at this point in the history
…to-play svg"
  • Loading branch information
Marauderer97 authored Jan 13, 2017
1 parent 3c402b5 commit 63aa62c
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions javascript/start.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// Execute everything that should be started.
// This script must be the last script. Otherwise not all functions may be loaded.

var characters;
var backgrounds;


window.onload = function() {
scaleToFullscreen();
showStartScreen();

characters = ["bird", "bat", "alien","flappydino","helicopter", "rocket","Santa", "Super_rocket", "Flappyfish", "unicorn", "botty", "black_cat","ball","octodex", "grandma","dog"];
backgrounds=["background","Gotham","space","Snow", "Sea", "Island", "binarybg","Evil"];
var characters = ["bird", "bat", "alien","flappydino","helicopter", "rocket","Santa", "Super_rocket", "Flappyfish", "unicorn", "botty", "black_cat","ball","octodex", "grandma","dog"];
var backgrounds=["background","Gotham","space","Snow", "Sea", "Island", "binarybg","Evil"];

rand=Math.floor((Math.random() * (backgrounds.length)));
backgroundChange(backgrounds[rand])
Expand All @@ -18,31 +17,3 @@ window.onload = function() {
characterChange(characters[rand])

}
i=0;
j=0;
window.onkeydown = function(event){
switch(event.keyCode){
case 32:
var layer=characters[i];
console.log(characters[i]);
characterChange(layer);
i=(i+1)%(characters.length);
break;
case 66:
var layer=backgrounds[j];
console.log(backgrounds[j]);
backgroundChange(layer);
j=(j+1)%(backgrounds.length);
break;
case 13:
startGame();
break;
case 82:
restartGame();
break;
default:
console.log("enterred");
break;
}
return false;
}

0 comments on commit 63aa62c

Please sign in to comment.