Questions tagged [play-clj]

Clojure based game library play-clj.

play-clj is a Clojure library that provides a wrapper for libGDX, allowing you to write 2D and 3D games that run on desktop OSes (Windows, OS X, and Linux) and mobile OSes (Android and iOS) with the same Clojure codebase.

7 questions
2
votes
1 answer

play-clj Android: Access accelerometer

I want to try an acceleration-based application in play-clj, but I'm not quite sure how to access gyroscope and accelerometer from clojure. In Java I'd access Gdx.input.getAccelerometerX(). play-clj does not offer matching events in its defscreen…
waechtertroll
  • 607
  • 3
  • 17
2
votes
0 answers

play-clj tutorial dependency on unretrievable file

I've tried following the steps of the play-clj tutorial. I can't seem to run anything in my light table REPL because I can't retrieve files from Maven and clojars.org/repo/ . I'm using Leiningen as my package manager. This is the error message I…
1
vote
1 answer

Play-clj screen and entities

I am new to the play-clj, and I am confused about [screen entities] as arguments for all of the functions. I went through the tutorial, but am still not getting it i think, what these for all of the functions shared arguments are and what are they…
user4813927
0
votes
0 answers

Why getting item from vec creates NullPointerException in Clojure and Play-clj

I am creating a simple worm game in play-clj. I have a function that should return a vec with dedicated number of new texture object added. It takes the place of coordinate in list and list as arguments. But every time I pass a number greater than 3…
OAJJ
  • 35
  • 7
0
votes
0 answers

Rhythm game in a functional language

I want to make a vertically scrolling rhythm game (even something basic with one lane) in Clojure using play-clj (or maybe clojure-lanterna because responsive TUI apps are neat and it works on Windows) I don't really know how you can represent a…
ohmree
  • 375
  • 3
  • 15
0
votes
1 answer

Rendering a label doesn't work unless the screen function evaluates to it

I'm trying to render! a simple label on the on-render screen function, but it doesn't work. All I get is a blank screen. It took me some time but I finally found that this happens when I return something else but the label. For example, this…
MasterMastic
  • 20,711
  • 12
  • 68
  • 90
0
votes
1 answer

"order of calls" inside another function

Trying to teach myself some clojure, am using play-clj. I dont understand why this works: (defn add-shape [x y entities] (write-state [x y]) (conj entities (o-shape x y))) While this doesnt: (defn add-shape [x y entities] (conj entities…
jaakkoj
  • 121
  • 6