kevansevans / hxdoom Goto Github PK
View Code? Open in Web Editor NEWHaxelib for aiding with Doom based programs
Haxelib for aiding with Doom based programs
Hi, I saw this repo via twitter. Very cool you managed to create Doom in Haxe ๐ฏ Hope you dont mind but wanted to give some random feedback. now I haven't tried to compile the project but just looking at the code I noticed these things.
public static var WADDATA(get, null):WadCore;
//...
static function get_WADDATA():WadCore
{
return WADDATA;
}
You can also do:
public static var WADDATA(default, null):WadCore;
f you do want to use these kind of getters, I would advice to remove the public
(to avoid using that getter directly) and add inline
there, to avoid having the function call, so:
public function get_xpos():Float
{
return xpos;
}
becomes:
inline function get_xpos():Float
{
return xpos;
}
Instead of doing:
public static inline var
you can do:
public static inline final
Instead of doing: (I saw this in Patch.hx)
public static var CONSTRUCTOR:(Array<Any>) -> Patch = Patch.new;
public var width:Int;
public var height:Int;
public var offset_x:Int;
public var offset_y:Int;
public var pixels:Vector<Vector<Int>>;
public function new(_args:Array<Any>)
You can just use
public static var CONSTRUCTOR:(Array<Int>) -> Patch = Patch.new;
public var width:Int;
public var height:Int;
public var offset_x:Int;
public var offset_y:Int;
public var pixels:Vector<Vector<Int>>;
public function new(_args:Array<Int>)
Any
here, I would avoid this where possible.CONSTRUCTOR
instead of just using Patch.new
directly, or why not even just use new Patch()
, so you could also remove the CONSTRUCTOR altogether and maybe even drop that array and use something like this// ...
class Patch extends LumpBase
{
public var width:Int;
public var height:Int;
public var offset_x:Int;
public var offset_y:Int;
public var pixels:Vector<Vector<Int>>;
public function new(width,height,offset_x, offset_y) {
super();
this.width = width;
this.height = height;
this.offset_x = offset_x;
this.offset_y = offset_y;
}
// ...
And at call side:
var patch = new Patch(16, 16, 16, 16);
Hope it helps in some way ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.