Skip to content

Commit

Permalink
Fix flappy bird example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed May 14, 2024
1 parent 761a653 commit 0abde54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions examples/flappy-bird/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

require_relative 'highscore'

WIDTH = 420
HEIGHT = 640
GRAVITY = -9.8 * 50.0

class BoundingBox
def initialize(x, y, width, height)
@x = x
Expand Down Expand Up @@ -146,10 +150,6 @@ def render(builder)
end

class FlappyBirdView < Live::View
WIDTH = 420
HEIGHT = 640
GRAVITY = -9.8 * 50.0

def initialize(...)
super

Expand Down Expand Up @@ -230,8 +230,6 @@ def step(dt)
end

def run!(dt = 1.0/20.0)
Console.info(self, "run!")

Async do
while true
self.step(dt)
Expand Down
2 changes: 1 addition & 1 deletion examples/flappy-bird/gems.locked
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
lively (0.6.0)
lively (0.7.0)
falcon (~> 0.47)
live (~> 0.9)
xrb
Expand Down

0 comments on commit 0abde54

Please sign in to comment.