-
-
Save Mouq/0eddb558f2dbf3b1b1c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ThroughTheWindow b/ThroughTheWindow | |
index 8161553..e7aeb14 100755 | |
--- a/ThroughTheWindow | |
+++ b/ThroughTheWindow | |
@@ -64,7 +64,9 @@ class Game is Steroids::Game { | |
$!last-cloud = $!distance; | |
} | |
- if self.is_pressed("Space") and $!runner.y == GROUNDLEVEL - $!runner.h { | |
+ state $secs; | |
+ if self.is_pressed("Space") { | |
+ $secs = now; | |
$!runner.velocity[1] = -22; | |
unless $!jumped { | |
$!jumped = True; | |
@@ -72,7 +74,10 @@ class Game is Steroids::Game { | |
$b.y += $b.h; | |
$b.velocity[0] = -5; | |
} | |
+ } elsif $!runner.y > GROUNDLEVEL - $!runner.h { | |
+ $!runner.velocity[1] = 2*(now - $secs); | |
} | |
+ | |
$!distance++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment