summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game.html.coffee20
1 files changed, 9 insertions, 11 deletions
diff --git a/game.html.coffee b/game.html.coffee
index c073f42..372bb63 100644
--- a/game.html.coffee
+++ b/game.html.coffee
@@ -850,6 +850,8 @@ genPage = ->
ctx.fillRect w - 1, 0, 1, h
@
@brew 'SeamlessPlane', @ParallaxPlane, ->
+ @initSeamlessPlane = @init
+ @frameSeamlessPlane = @frame
@withRect = (rx,ry,rw,rh,cb)@>
{ w, h } = @
if (ex = rx + rw) > w
@@ -876,7 +878,6 @@ genPage = ->
@withRect (@@random() * @w | 0), (@@random() * @h | 0), s, s >> 2, (x,y,w,h)->
ctx.fillRect x,y,w,h
@
- @initSeamlessPlane ?= @SeamlessPlane::init
@method 'init', (options)@>
{ lower, w, h, moltf, colors } = @
if lower?
@@ -893,7 +894,6 @@ genPage = ->
x = 200
while x-- > 0
@randomStuff()
- @frameSeamlessPlane ?= @SeamlessPlane::frame
@frame = (t)@>
{ ctx, moltf } = @
@@ -1088,12 +1088,10 @@ genPage = ->
@lower = seafloor
@
@
- @bluescape =
- __proto__: @SeamlessPlane::
- bluescapeSuper: @SeamlessPlane::
- lower: @waterscape
- logzoom: 0
- frame: (t,sx,sy)@>
+ @bluescape = do(waterscape = @waterscape)=> @SeamlessPlane::spawn ->
+ @lower = waterscape
+ @logzoom = 0
+ @frame = (t,sx,sy)@>
{ ctx, w, h } = @
x = @x + sx
@@ -1126,7 +1124,7 @@ genPage = ->
# t.fillRect 0, 0, 100, 100
# t.clearRect 0, 0, 100, 100
# t.drawImage t, 0, 0, 100, 100, 50, 50, 100, 100
- init: (options)@>
+ @init = (options)@>
{ w, h, lower } = @
@w = w
@@ -1135,13 +1133,13 @@ genPage = ->
lower.w = (w >> 2) * 5
lower.h = (h >> 2) * 5
- @bluescapeSuper.init.call @, options
+ @initSeamlessPlane options
ctx <. @
# ctx.fillStyle = "#0099dd"
# ctx.fillRect 0, 0, @w, @h
-
+ @
@setup = ->
{ time, bluescape, radx, rady } = @