Git Product home page Git Product logo

flixeljs's Introduction

Direct port of Flixel from AS3 to Javascript (HTML5/Canvas)

I started this project a few months ago and haven't yet completed it (that last 10% is a killer!) but it's been stagnating too long, so I'm releasing what I have to the world, and perhaps someone can fix it up before I do ;)

I initially converted by hand from AS3 to Javascript. I realized I would run into many errors that way. I did patch up many that I encountered. Unfortunately, the errors got pretty unruly, and so I went back to convert it automatically - which, yes, I should have done in the first place! At that point I was fatigued with the whole damn thing; the conversion script is almost, but not entirely, complete.

Unfortunately it's currently broken and incomplete in a few ways:

- <strike>Collision completely broken :( This is the most crushing problem. You can't make much without collision</strike>
- Transparency problems
- A few minor classes not yet converted
- Asset loading system not added (was waiting til I got the library working)
- Tilemap issue (it draws a little notch on tilemaps for some reason)
- Problems with sprite rotation (Currently disabled IIRC)

I plan on picking this project back up now and getting it in working order, but if you want to hack on it too then pull requests are welcome!

(NOTE: I based my port off the dev branch of Flixel)

flixeljs's People

Contributors

billywm 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

flixeljs's Issues

FlxTilemap: one tile off

In the example game, the tilemap shows a weird notch: The second tile in the map is an empty space

FlxSprite.drawLine

Unimplemented because it's a method of Sprite. Try using Canvas drawing methods to recreates this functionality. If Canvas won't do it without anti-aliasing, stick in a line-drawing algorithm that does it manually.

No asset handling

The asset handling system will eventually handle pre-loading all images, sounds, etc, and providing a convenient reference to them.

A single Assets object will hold references to all assets, for example: Assets.images.playerImg

This loader should provide preloading information. At the very least, it should periodically report the number of files loaded / total so developers can build a preloading screen with this information. Getting the bytes loaded / bytes total is problematic (cross-browser issues) but will be considered for future inclusion.

Problems with alpha handling

The game background is transparent instead of a color, and other objects such as tilemaps set transparency vs colors incorrectly too. This is probably because of the way I handle drawing BitmapData objects on Canvas

Sprite rotation: Angles are always NaN

If you attempt to rotate any FlxObject, its angle will become NaN. I've so far been unable to determine why or where this happens. Because Flixel determines which drawing method to use based on rotation and scaling, I've put in a hack to force angle to 0 all the time.

Unimplemented classes

The following are not yet implemented but are planned, roughly in order of importance:

  • FlxText
  • FlxPause
  • FlxSave
  • FlxQuake, FlxFlash, FlxFade
  • FlxGamepad

The following are not planned:

  • FlxPanel: This gets around a limitation in Flash. In an HTML page there's no reason to display link buttons in a special way
  • FlxKong: For obvious reasons

No text support

Text handling has not yet been addressed, in part because the asset system is not finished (Text in Flixel needs to use a developer-specified font)

Converter incomplete

The automatic conversion script is almost, but not entirely complete. As I recall, it should be functional once it handles statics + constants; at that point it should be able to automatically convert all of Flixel's .as files to a .js file full of classes.

It won't, however, be guaranteed to correctly convert users' games, as it takes a lot of shortcuts.

Consider writing a proper parser with Jison to allow people to convert games in-browser, and even unzip them with a JS unzip library

Collision broken

Collision doesn't work. collide() and overlap() checks never detect any collisions.
Haven't tracked down the location of the issue yet. Probably a small error in the arithmetic of FlxU's collision-related functions: solveXCollision or solveYCollision. Also possible there's an error in FlxQuadTree or the use of it

No sound/music support

Because asset handling isn't added yet, sound has not been addressed. We'll attempt to dynamically create HTML5 objects.

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.