

Show HN: An isometric marble run build in CoffeeScript - robert-boehnke
http://marbleo.us/#GQIAAP8AAAYvAgAA_wAAFDwAAAA_AAAABwICAP8AAAQAAAAAAAAAABgCAgD_AAALAQEAAP8AAAYpAQAAGgcIAf8AAAU_AAAAPwEAAP8AAAU_AAAAPwEAAP8AAAU_AAAAKwAAAB4CBQD_AAAEAAAAAAAAAAAwBwgA_wAABAAAAAAAAAAAAAAAACwHCQD_AAADAQEAAP8AAAYpAQAA_wAAIgAAAAAAAAAAAAAAAAABAAD_AAADKQEAAP8AAAYpAQAA_wAAKQEBAAD_AAAGKQEAAP8AACkBAQAAFAAAARUAAAAVAAAAFQAAABUAAAAFBwkAKQEAABYAAAEVAAAAFQAAABUAAAAFBwkA_wAAARUAAAAVAAAAFQAAABUAAAAVAAAABQIGAP8AAA8AAAAAAAAAAAAAAAAAAAAAFAEAAP8AAAIAAAAAAAAAAAAAAAAAAAAAMAIAAP8AAAIFAgAA_wAABjECAAAA=

======
natesm
It's a little hard to tell where the marble is in "3d" space. I think it might
be a little better if it was even lighter while "underground". A lot of
isometric games use shadows to show exactly where objects are - that could
help as well.

Edit: now I figured out what the big problem is: you can't see where it's
headed when it's underground. In Roller Coaster Tycoon, when your train went
into a tunnel, there was a sort of transparent view of the underground track.
I think having that here would make a lot of sense.

~~~
robert-boehnke
thanks for pointing that out, that does seem like a good idea and I will look
into that

------
jashkenas
Direct links to some of the interesting source:

[https://github.com/robb/Marbleo.us/blob/master/src/js/Block....](https://github.com/robb/Marbleo.us/blob/master/src/js/Block.coffee)

[https://github.com/robb/Marbleo.us/blob/master/src/js/Path.c...](https://github.com/robb/Marbleo.us/blob/master/src/js/Path.coffee)

[https://github.com/robb/Marbleo.us/blob/master/src/js/Game.c...](https://github.com/robb/Marbleo.us/blob/master/src/js/Game.coffee)

------
duck
Turn your design into something real: <http://woodgears.ca/marbles/run.html>
or <http://woodgears.ca/marbles/modular.html>

------
jonty
Building this successfully destroyed all my productivity.
<http://bit.ly/g11Q6h>

~~~
d0m
Playing with it destroyed a bit of my productivity ;) I like the ending of the
map.

------
ullrich
this is quite cool:
[http://marbleo.us/#PwAAAD8AAAA_AAAAPwAAAAMAAAAoAAAAKgAAAD8AA...](http://marbleo.us/#PwAAAD8AAAA_AAAAPwAAAAMAAAAoAAAAKgAAAD8AAAAfAgEAPQAAAj8AAAADAAAAKAAAACoAAAA_AAAALwIBAD4AAAI_AAAAAwAAACgAAAAqAAAAAAAAABgCAQAVAAACPQAAAAMAAAAoAAAAKgAAAAAAAAAsAgEAFgAAAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA_wAABz8AAAA_AAAAPwAAAD8AAAArAAAAKgAAACoAAAA_AAAAAwEBADwAAAE_AAAAKwAAACoAAAAqAAAAAgAAAAQCAQA8AAACPwAAACsAAAAqAAAAKgAAAAAAAAAYAwEAAQAAAwAAAAAAAAAAAAAAABgHCAAAAAAABAMBABQAAAMBAAAAAAAAAAAAAAAAAAAAAAAAACACAQAWAAACAQAAAAAAAAAAAAAAAAAAADAHCQADAAADFAAAAAEAAAAAAAAAAAAAAAAAAAAqAAAAGgcIAD0AAAMrAAAAKgAAACoAAAAqAAAAKgAAABoDAQA9AAADKwAAACoAAAAqAAAAKgAAACoAAAAiAgEAPgAAAisAAAAqAAAAKgAAACoAAAACAAAABAIGABQAAAIpAAAAKgAAAP8AAAIdAgUAGQMBAv8AAAUUAQUAMQIBARcAAAIBAAAAAAAAAAAAAAAAAAAAMAIGABcAAAIVAAAAAQAAAAAAAAAAAAAAAAAAACoAAAAaAgEAPQAAAisAAAAqAAAAKgAAACoAAAAqAAAAGgMBAD0AAAMrAAAAKgAAACoAAAAqAAAAKgAAADICAQA_AAACKwAAACoAAAAqAAAAKgAAAP8AAAcIAgUAAAAAAv8AAAUVAQQAFQAAAQEAAAAAAAAAAAAAAAAAAAAAAAAAIQIFABYAAAIVAAAAAQAAAAAAAAAAAAAAAAAAACoAAAAKAgEAPAAAAisAAAAqAAAAKgAAACoAAAAqAAAAMgIBAD8AAAIrAAAAKgAAACoAAAAqAAAA_wAABxQAAAAVAAAAFQAAACkBAQD_AAADHAIFABUAAAL_AAAFIAIFABYAAAIVAAAAAQAAAAAAAAAAAAAAAAAAACkBBQAWAAABFQAAAAEAAAAAAAAAAAAAAAAAAAAqAQEA_wAABh0CAQApAAACKgAAACoAAAAqAAAAKgAAACoAAAA-
AQEAKwAAASoAAAAqAAAAKgAAACoAAAAqAAAAPgEBABcAAAEVAAAADQICACgAAAIqAAAAKgAAAAUDAQAUAAADFQAAADEHCQArAAADKgAAACoAAAA1AgUAFwAAAhUAAAABAAAAAAAAACgAAAAqAAAAKQEEABYAAAEVAAAAAQAAAAAAAAAoAAAAKgAAAAYCAQD_AAAGNgIBACsAAAIqAAAAKgAAACoAAAAqAAAAKgAAABUAAAAVAAAAKQAAACoAAAAqAAAAKgAAACoAAAAVAAAAFQAAACkAAAAqAAAAKgAAACoAAAAqAAAABQIEABQAAAIpAAAAKgAAACoAAAAqAAAAKgAAABUBBAAVAAABFQAAACkAAAAqAAAAKgAAACoAAAA1AgUAFwAAAhUAAAApAAAAAgAAACgAAAAqAAAA)

------
bni
I feel my curly-brace intertia softening a bit lately, so Im considering
converting Orbium to CoffeScript.

The game has "classes", like this:

<https://github.com/bni/orbium/blob/gh-pages/js/tile.js>

<https://github.com/bni/orbium/blob/gh-pages/js/inspector.js>

So I think it will translate well.

Anyone with CoffeScript experience that can share what its like to convert
over a codebase from JS -> CoffeScript?

~~~
jashkenas
Hah, mostly: delete, delete, delete.

<http://www.screenr.com/xd0>

Fair warning, the syntax in that screencast is a bit out of date.

For your codebase, instead of having to "call super" manually:

    
    
        orbium.Inspector = function(count, xnr, ynr, vari, col) {
          
          this.setBase = function() {
            orbium.Tile.prototype.setBase.call(this, "modtile");
          };
    
        }
    

It'll look more like:

    
    
        class orbium.Inspector extends orbium.Tile 
        
          constructor: (count, xnr, ynr, vari, col) ->
            ...
    
          setBase: ->
            super "modtile"

~~~
bni
Thanks, probably some search and replace will do most of the boring stuff.
Since it follows the classical pattern already the structure of the code will
be mostly the same, but with a lot less dense syntax :-)

Im concerned about adding a compile step, since I like the "just reload"
workflow a lot that you get with JS.

text/coffeescript script tags could help out with this. But from the the
CoffeScript site: "it's not recommended for serious use". Why not?

~~~
jashkenas
Check out the --watch flag, which will give you the same "just reload"
workflow you have with JS.

Using `text/coffeescript` script tags works, but isn't recommended because
you're effectively programming through an eval(), and debugging becomes more
difficult.

------
grantbachman
I think it's pretty cool, but might I suggest loading a fully built track as
the default?

~~~
DanielRibeiro
I found it is. Just click on a green arrow after test map.

~~~
grantbachman
My mistake, the fact that they have the ability to jump over distances is even
cooler. Nice touch.

------
peregrine
This basically does not run at all in my browser. (Chrome 11.0.696.44 beta)

~~~
robert-boehnke
I have had some trouble with it on my Windows netbook with 2d canvas
acceleration enabled, could that be it?

------
ullrich
the sources can be found on github <http://github.com/robb/Marbleo.us>

------
waqf
The very first thing I thought to do when I saw the app was to widen my window
(to 2000px or so) so that I wouldn't have to scroll to see all the available
blocks.

But the block selector doesn't resize with the window. Please could you fix
that?

------
a1k0n
I wish I could just buy blocks like these for my son. Bandai Spacewarp-type-
things are a little too much yet, and the marble toys we have are pretty lame
in comparison to this.

~~~
robert-boehnke
You can: They were based off marble blocks built by a Swiss company called
Cuboro: <http://cuboro.ch/en/Info/Products> They are not very cheap though.

~~~
corin_
I grew up with a set of those (not sure if from that company or just a really
similar product), and to me it represents a nicer time when toys for children
were... can't quite find the right way to put it, but overall _nicer_. Loading
the marbleo.us page instantly took be back in my mind, so thankyou :)

------
syntsalt
Very cool. What does isometric mean? Is it like Eschere drawing, i.e. marble
goes bak up the hill?

~~~
ejames
"Isometric" refers to the style of the 3D viewpoint. The x and y axis are
presented at a 45° angle, and the camera looks 'down' on the surface
diagonally.

Escher's work is an example of how an isometric perspective can be manipulated
to present an impossible object, such as a staircase that appears to go
upwards even though the 'top' stair is connected to the 'bottom'.

------
indrora
my little thing: <http://j.mp/etrO8H>

