A Cocos2d-x example app in ClojureScript.
Write a game in ClojureScript and target iOS, Android, Windows and HTML5? Yes please.
-
To build the application, while watching for changes, run:
lein cljsbuild auto
-
To view the result in the browser, run:
lein ring server
-
Run:
lein repl
-
Then enter the following in the REPL:
user=> (require 'cljs.repl.browser)
user=> (cemerick.piggieback/cljs-repl :repl-env (cljs.repl.browser/repl-env :port 9000))
-
Now, refresh the browser.
-
In the repl, test with:
cljs.user=> (js/alert "Hello, world!")
-
Add marmalade to emacs, by putting the following in init.el:
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.milkbox.net/packages/") t)
-
alt-x
package-install
cider -
Install cider using
package-install
from marmalade. -
Open project.clj in emacs
-
alt-x
cider-jack-in
to start a repl based on the current project file -
Enter the following into the repl emacs provides you:
user=> (require 'cljs.repl.browser)
user=> (cemerick.piggieback/cljs-repl :repl-env (cljs.repl.browser/repl-env :port 9000))
-
Follow steps under Building and serving
-
Get https://raw.github.com/technomancy/leiningen/stable/bin/lein
-
Copy to ~/bin/lein
-
Run:
chmod a+x ~/bin/lein
A. Cider: "pp does not exist"
See: [clojure-emacs/cider#382 (comment)] [clojure-emacs/cider#382 (comment)]
i. Delete .emacs.d/elpa/nrepl* and .emacs.d/elpa/cider* and .emacs.d/elpa/clojure-mode*
ii. alt-x package-install-file
nrepl-0.2.0.el from https://marmalade-repo.org/packages/nrepl-0.2.0.el
iii. alt-x package-install
cider