Selaa lähdekoodia

Lua : initialize math random seed with current timestamp

Justin Donaldson 9 vuotta sitten
vanhempi
commit
7d387963bd
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      std/lua/Math.hx

+ 3 - 0
std/lua/Math.hx

@@ -39,5 +39,8 @@ extern class Math {
 
 	public static function random() : Float;
 	public static function randomseed(i : Float) : Float;
+
+	//  initialize the random seed with the current time
+	public static function __init__() : Void randomseed(Os.time());
 }