Skip to content

rboyd/cocos2d-cljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cocos2d-cljs

A Cocos2d-x example app in ClojureScript.

Write a game in ClojureScript and target iOS, Android, Windows and HTML5? Yes please.

Building and serving

  1. To build the application, while watching for changes, run:

    lein cljsbuild auto

  2. To view the result in the browser, run:

    lein ring server

Attaching a REPL

  1. Run:

    lein repl

  2. 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))

  3. Now, refresh the browser.

  4. In the repl, test with:

    cljs.user=> (js/alert "Hello, world!")

Cider/Emacs

  1. 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)

  2. alt-x package-install cider

  3. Install cider using package-install from marmalade.

  4. Open project.clj in emacs

  5. alt-x cider-jack-in to start a repl based on the current project file

  6. 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))

  7. Follow steps under Building and serving

Leiningen

  1. Get https://raw.github.com/technomancy/leiningen/stable/bin/lein

  2. Copy to ~/bin/lein

  3. Run:

    chmod a+x ~/bin/lein

Troubleshooting

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

About

A Cocos2d-x example app in ClojureScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published