Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 6 files changed
  • 0 comments
  • 1 contributor
15  TODO
... ...
@@ -1,16 +1,23 @@
1  
-- die animation
  1
+TODO:
  2
+
2 3
 - iphone fullscreen
3 4
 - sounds + preload
4 5
 - theme initializer
5 6
 - avoid double jumps
6  
-- vertical scroll?
7 7
 - different background colors (image)
8 8
 - startscreen image
9  
-- factor out sprite mapping
10  
-- invisible steps
11 9
 - geeko exit
12 10
 
13 11
 - release! blog entry
14 12
 
15 13
 
  14
+IDEAS:
  15
+
  16
+- vertical scroll
  17
+- die animation
  18
+- Teleporters
  19
+- Speed Boosters
  20
+- invisible steps
  21
+
  22
+
16 23
 
32  js/controls.js
@@ -2,12 +2,31 @@
2 2
 
3 3
 function hideControls() {
4 4
     document.getElementById("pad-controls").style.visibility = "hidden"
  5
+    enable_default_touch()
5 6
 }
6 7
 
7 8
 function is_touch_device() {
8 9
     return !!('ontouchstart' in window);
9 10
 }
10 11
 
  12
+function preventDefault(event) {
  13
+  event.preventDefault();
  14
+}
  15
+
  16
+// prevent scrolling etc
  17
+function disable_default_touch() {
  18
+    document.body.addEventListener('touchmove', preventDefault, false);
  19
+    document.body.addEventListener('touchstart', preventDefault, false);
  20
+    document.body.addEventListener('touchend', preventDefault, false);
  21
+}
  22
+
  23
+// re-enable touch events for menu
  24
+function enable_default_touch() {
  25
+    document.body.removeEventListener('touchmove', preventDefault, false);
  26
+    document.body.removeEventListener('touchstart', preventDefault, false);
  27
+    document.body.removeEventListener('touchend', preventDefault, false);
  28
+}
  29
+
11 30
 
12 31
 function registerControls() {
13 32
     window.onkeydown = function (e) {
@@ -67,18 +86,9 @@ function registerControls() {
67 86
         document.getElementById("pad-controls").style.visibility = "visible"
68 87
     }
69 88
 
70  
-    // prevent scrolling
71  
-    document.body.addEventListener('touchmove', function (event) {
72  
-        event.preventDefault();
73  
-    }, false);
  89
+    // prevent scrolling etc
  90
+    disable_default_touch()
74 91
 
75  
-    document.body.addEventListener('touchstart', function (event) {
76  
-        event.preventDefault();
77  
-    }, false);
78  
-
79  
-    document.body.addEventListener('touchend', function (event) {
80  
-        event.preventDefault();
81  
-    }, false);
82 92
 
83 93
     var left = document.getElementById("control-left");
84 94
     left.addEventListener('touchstart', function (event) {
3  js/game.js
@@ -457,11 +457,10 @@ function gameLoop() {
457 457
 
458 458
 
459 459
 function initGame() {
460  
-
461 460
     window.clearInterval(gameInterval);
462 461
     var canvas = document.getElementById("game");
463 462
     ctx = canvas.getContext("2d");
464  
-
  463
+    hideMenus()
465 464
     hideControls()
466 465
     // draw initial level for menu background
467 466
     load_level()
2  js/menu.js
@@ -46,6 +46,7 @@ if (button = document.getElementById("button-play3")) {
46 46
 var start_menu = document.getElementById("game-menu");
47 47
 
48 48
 function showStartMenu() {
  49
+    hideControls()
49 50
     start_menu.style.visibility = "visible";
50 51
 }
51 52
 
@@ -61,7 +62,6 @@ document.getElementById("button-restart").addEventListener('click', function (ev
61 62
 }, false);
62 63
 
63 64
 document.getElementById("button-menu").addEventListener('click', function (event) {
64  
-    hideGameOver()
65 65
     initGame()
66 66
     showStartMenu()
67 67
 }, false);
BIN  themes/suse/images/player_sprites.png
BIN  themes/suse/images/resources/player_sprites.xcf
Binary file not shown

No commit comments for this range

Something went wrong with that request. Please try again.