Jump to content

Ash-js - A JavaScript port of Ash Framework, an entity framework for game development

Recommended Posts

I've ported the Ash Framework to Javascript and it can be found on github at: http://brejep.github.io/ash-js/.



Ash is a high-performance entity system framework for game development originally written in Actionscript 3. It organizes code in an interesting way that is reminiscent of data-driven programming.


Those of you with backgrounds in Flash and Actionscript may know the Ash Framework already but more information can be found at http://www.ashframework.org/. There are a couple of good introductory articles there as well as links to other ports and demos.


Hope this is useful to some of you.









Link to post
Share on other sites

I' m in a process of porting the Ash framework form AS3 to TypeScript I was aware of your pure JS port and picked up some things.


In the moment I'm porting and testing the Asteroids example game... and I'm still struggling to make it work, but i think I'm very close. (once again tnx to your working port ;) )


Beside that, very good work, also wanted to ask you if you think, that we can made the same example like the Ashteroids AS3 version with  3 different rendering systems.


- canvas - js views like now

- canvas with sprites

- webgl (three.js)


Beside I'm going to try making it myself with TypeScript but don't know when cause all game programing is still personal free time project :)




Don't know if this is intentional but in the readme on github the last part:


Example on how to use ash-js


The "abiyasa" version doesn't start and yours: https://github.com/brejep/ashjs-asteroids-example works.

Link to post
Share on other sites

Is the Typescript port and asteroids example on github? I'd be happy to help out with it - if and where I can.


I think adding the various different rendering systems is a good idea. Possibly including a DOM-based version too. It shouldn't require much work as the asteroids example only has a few visual elements.


I'm also concentrating on developing another example - https://github.com/brejep/ashjs-platformer-example - very much a work in progress at the moment. My intentions are to add spritesheet-based animations and some parallax scrolling to this example. 


With regards the readme, thanks for pointing that out. I've changed the example back to the brejep one for now. I believe abiyasa is updating the example to work with recent changes he made to the framework - using class-js - but that appears to still be a work in progress.

Link to post
Share on other sites

Well I'll make e repo and upload in Github these days, so stay tuned.


I'm glad you're open for help but also i hope I'll get it running myself :) anyway if i do or don't make it


I'll upload the project very soon.


And yes sprite animation, parallax, and viewport(camera) are on my to do list cause thing like this are fundamentals for many games.

Link to post
Share on other sites

Hi Mike,


The Ashteroids example (https://github.com/abiyasa/ashjs-asteroids-example) is still not finished yet, but you can try this if you want to run it:

- Make sure you have installed node.js & grunt

- From the ashteroids folder, do 'grunt connect'. This will start a local webserver on port 9000

- Open 'localhost:9000/ashteroids.dev.html' on your browser.


Currently, it run on Chrome & the latest FireFox. IE is still not supported: class-js requires ECMAScript 5 support

Link to post
Share on other sites

Well I'll try to make a one line difference about Crafty and Ash, which i think is pivotal:


1. Crafty Entity holds - data, and logic

2. Crafty Components - hold logic


2. Ash Entity - is unique identifier there is no data, or logic

3. Ash Component - hold data (again no logic)

3. Ash Systems - holds logic


And in general Ash is designed to be more decoupled and more reusable ...


the last is personal opinion with working with both.


I\ll be glad if someone make more in depth comparison, also you can check this article

which make comparisons of Entity Component Systems in general:



Link to post
Share on other sites



Here is what i promised:


https://github.com/MikeMnD/AshTS - it's not working yet


It's the whole project with .ts and .js files.


One thing i've kind-a struglled was the Nodes and that there are properties added to the "object.prototype" and TypeScript doesn't like very much this kind of property assignment.


So, you can check it, and see if you could point out the problems, where i've messed up.


There is the asteroids demo of course.


@abiyasa - I've got node, but i may tried latter since i have other priorities, tnx for the info and explanation

Link to post
Share on other sites

Thank you abiyasa, i've download it and it's working indeed, even more ...


I make a slight edit in: ashteroids.dev.html


        <!-- RequireJS -->
        <script data-main="src/config" src="lib/vendor/require.min.js"></script>


removing the / before "src" and "lib" folders and the dev version works too, which is very cool for debuging and looking trought code

in the browser. Here i may say that brejep's version uses a minified ash.js which makes debuging a bit off and just swaping the full version doesn't seems to work.


So, thanks. I hope i'll get the time to get my port working soon.

Link to post
Share on other sites

I make a slight edit in: ashteroids.dev.html


        <script data-main="src/config" src="lib/vendor/require.min.js"></script>


removing the / before "src" and "lib" folders and the dev version works too


Thanks! I've updated GitHub repo. Now you can play them by opening the HTML files directly on the browser. No more Grunt/node command!


Looking forward for your TypeScript port of Ash  :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...