parent
e26acf2c2e
commit
6f482e8d2c
5 changed files with 35 additions and 4 deletions
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,19 @@ |
||||
app.game.speechbubble = |
||||
start: -> |
||||
@sprite = [0, 0, 27, 13] |
||||
|
||||
say: (text) -> |
||||
clearTimeout(@timeout) if @timeout |
||||
|
||||
switch text |
||||
when 'help' then @sprite = [0, 0, 27, 13] |
||||
when 'toofar' then @sprite = [0, 13, 90, 13] |
||||
|
||||
@visible = true |
||||
@timeout = window.setTimeout @hide, 1000 |
||||
|
||||
hide: => |
||||
app.game.speechbubble.visible = false |
||||
|
||||
render: -> |
||||
app.layer.drawRegion app.images.speechbubbles, @sprite, app.game.mouseX+5, app.game.mouseY-15 if @visible |
Loading…
Reference in new issue