Add inital setup including 'go' command

This commit is contained in:
Andrew Miner
2018-05-26 21:49:53 -06:00
parent bb665bca3c
commit 4563482d17
7 changed files with 542 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# Constants ############################################################################################################
RETURN_KEY = 13
# Global Data ##########################################################################################################
$(document).ready ->
$input = $("input.entry")
$input.on "keydown", ->
if event.which isnt RETURN_KEY then return
STORY.interpret($input.val())
$input.val("")
$log = $(".log")
$logText = $("p.log-text")
STORY.log.onChange = (log)->
$logText.html(log.content)
$log.scrollTop($log[0].scrollHeight)
STORY.begin()
$input.focus()