Thursday, 24 May 2012

HeliDartris begun

New idea for a game (because you can never have too many projects on the go!)  Working title is HeliTetris -- play tetris-like line making game using the winch under a helicopter, probably coupled with gravitational sensor data on phones and tablets. How hard could it be? :-)

Decided to try prototyping/writing it in Google's new Dart language.  I'd heard of this several months back but 2 weeks back, my interest was galvanized by the Dart hackathon!  I went along and we had a stab at a multi-player PacMan clone.  Not a bad effort given we wrote everything from scratch and hadn't touched Dart before then!  (1 guy had written a little and I read the docs on the 30m train journey in!)  My conclusion: Dart has great potential.  More approachable than Scala -- my other favourite "I hope this is the future" language.

Anyway, Seth Ladd had mentioned there was a Box2D port (via the Java port) so what better platform to prototype/write in for cross-platform productivity?

(My opinion: JavaScript is just frustratingly badly tooled -- once you get above a certain project size, it sits the un-fun-dark-side of hackyness.  Even when kept well structured (which it doesn't help you with), it just becomes more and more work (*1).  Dart's optional strong-typing means decent toolability (like Java and Scala).  Let's see how it bears out in practise, though!)

*1: Perhaps it's time for "Big H Notation" which represents how developer headache scales with increases in size of project.  Yeah, it could be described as how complexity scales, but let's face it, we don't mind some complexity without the headache!  What would you propose for different languages?  Hm, this feels like a Twitter/G+ question!

Anyway, for a bit of a change, I decided to both (a) try the Pomodoro technique and (b) keep a development blog.  Let me know what you think -- good and 'suggested changes' ;-)

15:00 start on Linux
15:10 IDE installed
15:15 box2d library found and downloaded (cloned from Google Code Git).
15:20 still trying to run demos
15:30 Don't use Dart Editor integrated webserver, use file path:
file:///home/username/Dev/Dart/Libs/dartbox2d/demos/demos.html?demo=BallCage
15:34 Discovered bug in library for all demos "UnsupportedOperationException: Cannot add to a non-extendable array":
Exception: UnsupportedOperationException: Cannot add to a non-extendable array
 Stack Trace:  0. Function: 'ObjectArray.add' url: 'bootstrap_impl' line:125 col:5
  1. Function: 'BroadPhase._bufferMove@3b3cfbc8' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/lib/collision/broadphase/BroadPhase.dart' line:215 col:58
  2. Function: 'BroadPhase.createProxy' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/lib/collision/broadphase/BroadPhase.dart' line:71 col:16
  3. Function: 'Fixture.createProxy' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/lib/dynamics/Fixture.dart' line:96 col:35
  4. Function: 'Body.createFixture' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/lib/dynamics/Body.dart' line:189 col:26
  5. Function: 'Body.createFixtureFromShape' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/lib/dynamics/Body.dart' line:221 col:25
  6. Function: 'BlobTest.initialize' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/demos/BlobTest.dart' line:47 col:36
  7. Function: 'BlobTest.main' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/demos/BlobTest.dart' line:29 col:20
  8. Function: '::main' url: 'file:///home/username/Dev/Dart/Libs/dartbox2d/demos/BlobTest.dart' line:101 col:16
(started trying to debug. Why doesn't the debugger breakpoint in this library!? Hm, investigate more later.  print() it is for now = bletch!  15:39 no typeof!?  Ah, reflection still in development.  Workaround?  print("List?: "+ moveBuffer is List) can't be right?!)
15:50 Bug found -- new List(SIZE) is a fixed-length list!  Is that expected by 2d author?
15:55 DartBox2D authors haven't stuck to Java Box2D form here -- looks like they relied on List being dynamic.
16:02 Decided to try switching to dynamically-sized list.
16:10 Better.  Now different error to do with requestAnimationFrame() having extra param.  Luckily, hit this before.  Scratch param! 5 of this same error -- removed all.
         Man, this new IDE version performs terribly on compile!!!  Quick Google doesn't show obvious bug about this.  Maybe check later?
16:12 Woohoo, works.  Time for a commit?  Not done with Google Code Git before!
16:47 Cloned, committed, learnt Google Code Git, pushed, e-mailed group.

1 pomodoro?

17:19 Blog written.  Hope you enjoyed as much as I did!

No comments:

Post a comment