playif / play_phaser

A Dart port for Phaser 2D game engine.
MIT License
72 stars 13 forks source link

Exception: The null object does not have a getter 'x'. #5

Closed darkoverlordofdata closed 9 years ago

darkoverlordofdata commented 9 years ago

This error is coming from Sprite.update crop.:

//this._crop = Rectangle.clone(this.cropRect, this._crop);
this._crop.x += this._frame.x;

this._crop is null. If you un-rem the lines, there is no Rectangle.cone method. It looks like Phaser.Rectangle.clone = function (a, output) { isn't getting ported.

playif commented 9 years ago

Hi @darkoverlordofdata

I do not implement the static method Rectangle.clone due to name conflict problem. Therefore, there is only a instance method of "clone". The problem is that I forgot to set the return value to crop.

I fixed the bug as follows:

    this._crop = this.cropRect.clone();

please update the package to 0.10.2, and let me know if the bug is still there, thanks.

darkoverlordofdata commented 9 years ago

It all works now. I was able to finish my port my demo game from coffeecscript to dart: http://darkoverlordofdata.com/alienzed/ https://github.com/darkoverlordofdata/alienzed

Now I just have to finish the game :)

Thanks!

On Sun, Aug 31, 2014 at 11:24 PM, playif notifications@github.com wrote:

Closed #5 https://github.com/playif/play_phaser/issues/5.

— Reply to this email directly or view it on GitHub https://github.com/playif/play_phaser/issues/5#event-159495545.

Bruce Davidson Schedule a meeting: https://meetin.gs/meet/bruce-davidson