Last active
August 29, 2015 14:12
-
-
Save jacobemcken/22d6eb2049a8e5f4ba27 to your computer and use it in GitHub Desktop.
Example thats triggers bug (?) in Weasel 0.5.0 upon namespace change
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
(ns rfgs.core | |
(:require [weasel.repl :as ws-repl] | |
[clojure.string :as string])) | |
(enable-console-print!) | |
(defonce game-state (atom {})) ; Atom to store the game state | |
(if-not (ws-repl/alive?) | |
(do (print "Open REPL") | |
(ws-repl/connect "ws://localhost:9001" | |
:verbose true | |
:print #{:repl :console} | |
:on-error #(print "Error! " %)))) | |
(defn ^:export init [] ; The entry point into the game from the HTML page | |
(.log js/console "Launching game") | |
) |
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
<html> | |
<head> | |
<script src="game/out/goog/base.js" type="text/javascript"></script> | |
<script src="game/rfgs.js" type="text/javascript"></script> | |
<script type="text/javascript">goog.require("rfgs.core");</script> | |
</head> | |
<body> | |
<canvas id="game-canvas"></canvas> | |
<script type="text/javascript"> | |
rfgs.core.init(); | |
</script> | |
</body> | |
</html> |
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
(defproject rfgs "0.1.0-SNAPSHOT" | |
:description "FIXME: write a game description" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.6.0"] | |
[org.clojure/clojurescript "0.0-2665"] | |
[com.cemerick/piggieback "0.1.5"] | |
[weasel "0.5.0"]] | |
:plugins [[lein-cljsbuild "1.0.4"]] | |
:cljsbuild { | |
:builds [{ | |
:source-paths ["src"] | |
:compiler { | |
:output-to "resources/public/game/rfgs.js" | |
:output-dir "resources/public/game/out" | |
:optimizations :none | |
:pretty-print true}}]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment