billywm / flixeljs Goto Github PK
View Code? Open in Web Editor NEWFlixel in Javascript (HTML5/Canvas)
License: Other
Flixel in Javascript (HTML5/Canvas)
License: Other
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)
FlxGroups are busted. They apparently destroy the clearRect ;)
In the example game, the tilemap shows a weird notch: The second tile in the map is an empty space
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.
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.
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
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.
The following are not yet implemented but are planned, roughly in order of importance:
The following are not planned:
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)
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 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
Because asset handling isn't added yet, sound has not been addressed. We'll attempt to dynamically create HTML5 objects.
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.