Coder Social home page Coder Social logo

hxdoom's People

Contributors

kevansevans avatar pxshadow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hxdoom's Issues

Some feedback

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.

  1. Instead of doing
	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>) 
  • There is no need I guess to use Any here, I would avoid this where possible.
  • I don't really see a reason why you need 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 ๐Ÿš€

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.