Clojurians
#clojure-gamedev
<
2017-04-17
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

selfsame12:04:07

@neurogoo hmm good question, I know i've built a clojure libGDX project for android before but can't remember how

neurogoo12:04:00

it seems that it was depended on lein-droid, but that project seems to be on hiatus.

selfsame12:04:24

ah yes that sounds familiar

selfsame12:04:53

you could also try aot'ing the clojure and using android studio

neurogoo12:04:34

Hmmm, I have to look into it, but unfortunately does seem like that using Clojure for Android game is not realistically possible currently :disappointed:

selfsame12:04:09

yeah possible but not done that often or documented

selfsame12:04:43

I know Arcadia can do it but I've never actually tested anything out

neurogoo12:04:32

Yeah Arcadia is one possibility, but I have understood that it is in quite alpha stage. Also as Unity as engine is not familiar to be I should probably first learn it before using Arcadia

selfsame12:04:59

eh it's alpha but very stable - but you're right learning Unity at the same time is a lot to take in

sineer15:04:53

@neurogoo Have you considered using ClojureScript instead? There's play-cljs and a few others... I find it best to develop for the web for devel phase then target android/ios with re-natal.

sineer15:04:23

I too had a really hard time working with lein-droid and I don't think it's worth the trouble unless you really need to build some native java code. Working with re-natal and cljs is a lot easier I find and the tools improved a lot last few months

neurogoo16:04:45

I have considered, but if I have understood correctly, React Native is still somewhat limited for complex graphics.

neurogoo16:04:20

I am not that familiar with front-end world, but I think I need something like svg or canvas. My idea was to make simple isometrix 4x game

sineer17:04:50

@neurogoo I understand. I've spent huge amount of time understanding frontend stuff instead of actually doing graphic stuff.

sineer17:04:49

React(Native) job is not to do complex graphics really it's more about dealing with components lifecycle.

selfsame17:04:21

it has a canvas element no?

sineer17:04:05

You can use whatever you want with react really, canvas, svg, WebGL, ...

sineer17:04:44

In my latest experiment I mixed gl-react with http://thi.ng to do GLSL in WebGL using om next...

sineer17:04:35

Recently I've decided that pixi.js looks like what I need for it does WebGL and fall back to canvas if not available

selfsame17:04:50

yeah pixi is great

selfsame17:04:07

re: react native, does that mean you used a webview?

sineer17:04:11

I'm not sure, there may be "native" webgl component but they probably do use a webview

sineer17:04:34

I haven't done WebGL on android yet

sineer17:04:50

I do think it's a good thing to use a webview too because it makes it that much easier to target the web instead and it's a lot easier develop in your browser than on your android device

sineer17:04:45

even for simple app I find it a lot easier to develop in plain react then port instead of trying to develop using react native (unless you have some native requirements that can't be done in plain react, ie Bluetooth LE stuff)

sineer17:04:29

There is nothing like chrome devtools for react native. figwheel and devcards are also a huge plus for me not to mention dirac awesome repl

selfsame17:04:08

yeah think we're at a point where a web based game would run fine on most phones

sineer17:04:35

That said, if all you want to do is code a simple game that you can already plan ahead what it will look like then perhaps all theses tools are a distraction and one could simply code it and focus on implementing the plan...

sineer17:04:48

Yeah for 2D stuff I think webview on mobile is fine. We also have core.async that can be very useful for concurency.

neurogoo19:04:22

When I looked into React Native it didn't seem to have canvas element. I could be wrong as it is new to me

neurogoo19:04:02

There is 3rd party version of canvas for React Native, but that is currently unmaintained

neurogoo19:04:57

Webview is something that I need to test to see how it perfoms, but it does feel quite unefficient way to do things.

sineer22:04:22

I'm not sure it can be used in ReactNative too.

sineer22:04:52

WebGL in webview I suspect would outperform any canvas due to help from the GPU. That is why I believe libs such as pixi.js that target WebGL are the best option

sineer22:04:54

You might be plesently surprised by Webview canvas performance too since it's mainstream and very much optimized... Using webview with react and virtual DOM is very fast.