arkeus / axel Goto Github PK
View Code? Open in Web Editor NEWAn open source, hardware accelerated 2D flash game library
Home Page: http://axgl.org
License: MIT License
An open source, hardware accelerated 2D flash game library
Home Page: http://axgl.org
License: MIT License
Performance on retina display iPods and iPhone 4 is really bad, because they seem to struggle with anything complex in the fragment shader. Removing the color transform from the fragment shader results in a huge performance boost.
A quick fix would be to make two shader programs, one with color transform, one without, and only use the expensive one if it's actually needed.
Another thing that would be great is drawing in batches like it is implemented in Starling, where everything on the same texture is drawn at the same time, if possible. For reference: http://wiki.starling-framework.org/manual/performance_optimization?s[]=performance#minimize_state_changes.
I wonder if it would be possible to implement multiple cameras in Axel. Currently there is only one camera and I exepect it won't be as easy as adding an array of cameras in Ax - just like Flixel does it. Is it feasible in Axel's architecture and rendering system?
Add these properties for help with determining the view box size after zooming.
Currently zooming works inconsistently. Sometimes things get scaled funny or spaces appear between tiles, etc.
To fix this, I will be placing a hard requirement such that you can only zoom at integer levels (x2, x3, x4, etc). Smooth zooming is cool, but it seems to be introducing a lot more problems than it is worth. I think for now if that is something you need, it'll have to be handled in post processing (probably easier once rendering to a texture is in there).
Also, drawing will now be aligned to x1 pixels. So if you zoom the game at 4x, if you move right a tiny bit, the sprite would move at a minimum 4 pixels (so that the left side cannot be mid-pixel, like it can now). I do not like this behavior, but I think it's a requirement for consistent zooming, and is probably preferred by most.
Implement AxAtlas such that it supports loading texture atlases in format(s) that popular tools export to. Also support manually creating the atlas via code.
Most likely you will construct it as follows:
var atlas:AxAtlas = new AxAtlas(xmlFormat);
And it will load from formats such as the one TexturePacker exports to. You'll also be able to add your own via code (so you can create the manually):
atlas.add("player_stand", 50, 72, 32, 32);
atlas.add("player_walk", 50, 84, 32, 32, 5, 10);
Then in AxSprite you can load from an atlas. This will add all the relevant animations also.
Change Ax.as private properties and methods to be protected, for easier extending.
Changing AxTilemap.scale doesn't seem to do anything, for example in the AxeliteBasic demo I'm trying:
...
tilemap.scale.x = 4;
tilemap.scale.y = 4;
add (tilemap);
I have a question: Why does not support zoom out?
I found that I just changed very little code can support this feature.
you are deliberately wrote?
change the following code:
1.
public function Ax(initialState:Class = null, width:uint = 0, height:uint = 0, zoom:uint = 1, framerate:uint = 60, fixedTimestep:Boolean = false) {
if (zoom < 1) {
throw new Error("Zoom level must be an integer greater than 0");
}
==>
public function Ax(initialState:Class = null, width:uint = 0, height:uint = 0, zoom:Number = 1, framerate:uint = 60, fixedTimestep:Boolean = false) {
//if (zoom < 1) {
//throw new Error("Zoom level must be an integer greater than 0");
//}
Ax.worldZoom = Math.ceil(worldZoom);
==>
Ax.worldZoom = worldZoom;
If you play sounds or musics by Ax.sound()/Ax.music(), it will new a AxSound and push it into the Ax.sounds (an AxGroup) for updates.
But if the AxSound.destroy() has been called after play (there have another bug that it will never been called by listener), the object reference still within the Ax.sounds group, and updating.
Should be a way to remove it from the group after playback.
And if the program like your tutorial, let's say just using Ax.sound(FIRE); after thousands plays it will crashed, by array overflow and updating a null reference.
UPDATE:
I fixed this issue by:
That would fixed this issue.
With 11.2 we can now have custom right click functionality. Figure out how to sensibly allow you to use Ax.mouse.pressed(AxMouseButton.RIGHT). Might require something like Ax.enableRightClick so that it doesn't destroy the default right click menu in flash (or if there's a way to rebind the default one, enable right click by default and give a way to disable it).
In Flash, I normally use ColorTransform a lot.
In Axel, it seems like only the multiply part is available, not the add/offset part.
Could that be added?
Also, having a fog color (+ fog intensity) would be great.
So the final color would be:
(color * colorTransformMul + colorTransformAdd) * (1 - fogIntensity) + fogColor * fogIntensity
Implement A* pathfinding in AxTilemap. Given a start and end tile, attempt to find the shortest path and return that as an AxPath which will be a series of either tile indices or points. Heuristic will be Manhattan distance.
Stretch goals: Include options for simplifying the path, whether to allow diagonal movement, etc.
In the future: Possibly support adding weights to tiles. Perhaps use raycasting to further simplify paths.
Please feel free to mention any ideas or requests you have for pathfinding. :)
Sprite flipping behaves funny when you have offsets. Fix this.
Current fix will be to, if the sprite is flipped, flip the graphic but keep the exact same bounding box. That means if your bounding box is in the bottom right, and you flip it, it will still be in the bottom right. I don't know any uses cases where this is a problem, but please speak up if you have a reason this shouldn't be the behavior.
The AxFont.fromFont function throws an Invalid BitmapData Error when using embedded fonts. The error happens in line 219 where the bitmap is created.
This happens because at times, tf.width - dpadding becomes 0 or less than 0.
If you want to overlap an AxSprite with an AxGroup, you might try sprite.overlaps(group). This will work, as both Group and Sprite inherit from Rect, but it does not make sense. The x and y coordinates of the group are probably the default values of 0, so the call will always return false.
Re-implement drawing bounding boxes in debug mode.
Implement:
getTileAt()
getTileAtPixelCoordinates()
setTile()
removeTile()
Change:
tile() to getTile()
tiles() to getTiles()
Add an option to fix the timestep with the framerate.
I see there have been no updates for 4 months. The last milestone which included atlases has not been completed yet.
Arkeus, are you still working on the framework? If not, is anyone willing to pick it up?
Cheers
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.