janko metelko a écrit :
hi,

I embeded Neko into some of my basic game framework. So I can write a code like this and it works.

var x = 0;
var dir = 1;

$exports.cb_quickLoad = function() {
    var load = $loader.loadprim("loadImg", 1);
    load("img\\bg\\golf_s.jpg");
    load("img\\spr\\tank1.png");
}

$exports.cb_update = function() {
    var draw = $loader.loadprim("drawImg", 5);
    draw(800, 600, 0, 0, 0);
    draw(105, 95,  x, 500, 1);
    x = 3 * dir + x;
    if ( x < 0 ) dir = 1;
    if ( x > 700 ) dir = -1;
}

it loads two pictures and draws them on screen with one fo them moving.

But I have no idea how to write Haxe now to compile to the same thing?

You can have a look at existing implementations, for instance neko.net.Socket or other haXe classes.

Nicolsa

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to