This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test | |
{ | |
public static function main() | |
{ | |
var test = new Test(); | |
trace(test.style); | |
} | |
public function new() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main | |
{ | |
public static function main() | |
{ | |
trace(haxe.Json.stringify({a:1,b:2,c:3}, function(k,v){ | |
return k == "" ? v : v + 10; | |
})); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 045276ae065567ca2610ef4976c823c54473fa89 Mon Sep 17 00:00:00 2001 | |
From: David Peek <[email protected]> | |
Date: Tue, 11 Jun 2013 11:13:18 +1000 | |
Subject: [PATCH] Patch required by homebrew formula - no static, paths | |
--- | |
Makefile | 7 ++++--- | |
src/tools/install.neko | 2 +- | |
2 files changed, 5 insertions(+), 4 deletions(-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test | |
{ | |
static function main() | |
{ | |
draw(0xFF); | |
draw(function(x,y){ return 0xFF0000; }); | |
// draw(function(x,y){ return "foo"; }); // compile error, not color | |
} | |
static function draw(color:Color) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test | |
{ | |
public static var instance(default, null):Test = new Test(); | |
public static var lazy(get, null):Test; | |
static function get_lazy() return lazy == null ? lazy = new Test() : lazy; | |
static function main() | |
{ | |
trace(instance); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/source | |
# dependencies | |
sudo apt-get update | |
sudo apt-get install libgc-dev bzip2 git-core make gcc g++ gnuplot glade imagemagick libusb-dev python-usb python-lxml python-wxgtk2.8 speech-dispatcher libgnomecanvas2-dev m4 libsdl1.2-dev | |
# neko | |
git clone https://github.com/HaxeFoundation/neko.git ~/source/neko | |
cd ~/source/neko | |
make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GameScene extends Scene { | |
// ... | |
public override function update() { | |
// Keep camera.x centered on the player | |
HXP.camera.x = player.x - HXP.halfWidth + 64; | |
// Keep camera.y centered on the player, | |
// unless it would show below the map. | |
// In that case, keep to the bottom fo the map. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VerEx | |
{ | |
public static function main() | |
{ | |
var test = new VerEx() | |
.startOfLine() | |
.then("http") | |
.maybe("s") | |
.then("://") | |
.maybe("www.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main | |
{ | |
static function main() | |
{ | |
var context = new MyContext(new View()); | |
} | |
} | |
class MyContext extends mmvc.impl.Context | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test | |
{ | |
static function main() | |
{ | |
new Test().a().a().a().a().a().a().a().a().a().a().a().a().a().a().a().a().a().a().a().a().a() | |
.a() // 0.460s | |
.a() // 0.910s | |
.a() // 1.860s | |
.a() // 3.630s | |
.a() // 7.350s |