Saturday, 22 June 2013

Diamond Square Algorithm

One of my favourite areas of computer graphics is landscape generation. During the September 2012 PyWeek I was able to try out the Diamond square algorithm for my Mars based game. Just a simple zap-zap affair I'm afraid!

I was curious to see how Dart would cope with this number crunching task. Of course, it worked well :-)

Turns out it works well - you can try the demo here- it redraws every second. There's a bit of work to be done to tidy up the edges slightly but for a first iteration it works well enough.

The basic code for the HTML and class are on github - add to a WebUI project to get up and running.

This Week In Dart #2

The big news this week is Dart going into BETA - congratulations to all the team for reaching this important milestone!

The release notes carry all the detail. There's been a big focus on performance with dart2js, Dart VM and the Dart Editor all getting boosts. (Given I am currently developing a HTML5 game in Dart on an Atom netbook, I was very pleased to hear this!)

The release was covered on a number of the big sites including engadget and InfoQ

On pub.dartlang.org there is an interesting weather package - weather_underground_api

Finally, as a follow up to last weeks cheat sheet, the writers have listened to feedback and there are already some updates for mobile and tablet appearing on the project's github page.

Sunday, 16 June 2013

This Week In Dart #1

There's been a number of interesting Dart related projects and resources springing up this week. Here are a few highlights.

The Dart Cheat Sheet
is a very handy reference to bookmark. Has anyone managed to print it neatly?

Angular.js has announced a port to Dart:

Pluralsight have published a Dart Web Applications online course.

Finally the Dart Editor/SDK had its usual weekly update to R23799 - with refactoring and editor improvements. More details in the Change Log.

Monday, 10 June 2013

Dartclass Got Types! (Optionally)

My first live Web UI app, 'Dartclass' has had a little update. It has Type Declarations which are, of course, optional in true Dart style.

Properties/Observables - String.name="daftspaniel" becomes String name = "daftspaniel";

Methods - int.getAge becomes int getAge(){}

The notation of int.getAge is a bit funny but it allows spaces to separate the list of items and is easy to type. I'd welcome feedback on that choice and any other aspect of the tool. It would be easy to add an alternative character. I first consider an underscore but it requires the SHIFT key on my keyboard. Hope this helps you get started coding some great ideas.

Next for Dartclass, I'd like it to generate a basic HTML file for Web Components.

Pub Deploy Bug To Be Aware Of

Dart is still maturing as an environment, so if you start working in it you should expect the odd issue.

Dart has a command 'Pub Deploy' to create a regular JS web deployable version of your project. It works great for a first release of such a big feature. Unless you are using GIT. 10983: Pub deploy fails if out/ is in .gitignore.

Easy enough to get .gitignore out the way, deploy and then put it back. A fairly painless workaround. Enough of a frustrating GOTCHA to be worth highlighting. Makes me wonder where they are going long term with this tool. I don't think DEPLOY should depend on a particular VCS. Odd.

Wednesday, 5 June 2013

Class Wizard

I like the editor that comes with the SDK but I hate the look of a new blank file! So I wrote this little tool to generate the basic code of a class. I find it good for working on ideas too. Feedback appreciated!

Dart Class Wizard Tool - Update Should really have the BETA tag on this :-) There's various small updates being published to this URL. Should settle down soon.

Code is on GitHub

Converting A Game From Python and PyGame To Dart

I am working on converting my PyWeek game to Dart. Work in progress screenshot:

Here's the Python Version