2014. augusztus 4., hétfő

Release of v.0.1.4

At last I released this update. One month of work went into this, because I wasn't ready to publish this update in July. This release has a ton of breaking change and a ton of new stuff. Just look at the changelog.

Whats new?
  • One of the biggest breaking change is: State us the Phaser like load, create and update methods. So you will have to use it instead of load, create.
  • Physics class with only one method(collision), which can detect collision between Sprite vs Sprite, Group vs Sprite, Sprite vs Group and Group vs Group. It's a cool method because i used Dart's optional typed system to make it work.
  • GameObjectFactory can make almost anything , but Background.color object.
  • Got some getters from StageXL: autoHiDpi, isMobile and devicePixelRatio.
  • I started trying out doing unit test, although i still have a long way to go.
  • World-Camera system, which is not fully functional because the Camera class needs work and an example how to use it.
  • Using World instead of Stage, because it's better to use store gameobject in some other container.
  • You can use Tween class if you want , because i exported from StageXL. Although you can make tweens through the GameObjectFactory.
  • New classes Keyboard and Touch, which only have some event handlers.
  • Button has and isDownByTouch method, which can the if the button is held down by touch.
  • The most awesome change is the new movement system for the Sprite class.

The movement system
This is the main reason, because I couldn't make the release in july . This was one of the hardest change to make, because I wanted to make something really easy to use. 

So i tried out two option:
  1. Using the onKeyDown and onKeyUp listener to make the sprite move. Thats why the Keyboard class have that function that handles both of them. This worked and made the code more readable, because i made it base on 4 different direction(up, down, left, right). The biggest fault of the system is that the sprite had to be stopped direction wise for every keyUp event.
  2. Using a Phaser like movement system, where you can control the sprite with changing it's speed value in the update loop. The only problem I had with this that you had to change the speed value to change direction and it looked ugly and didn't really made the code more readable.

My solution is based on 4 main different direction(up,down,left,right) and using these directions you can move around the Sprite. Direction is actually a vector(StageXL.Vector object), which means it's super easy to work with and made it possible to rotate directions and the sprite with ease. 
You can do any kind of top-down game with it.
Instead of using event listeners for keys in the create method, we must use the update loop to change the direction of the sprite, which actually made the code more readable.

tl;dr: I unified the two option that I mentioned before and made a really cool system.

You don't believe me?
Look at this example code and you can try it out live here.
You can move with WASD and you can turn with QE.

Future plans
I don't plan to wait for another month for a new release, so you can expect a new release in this month. :D

What will I work on?
  • Add some more feature to the movement system: acceleration and easier rotating
  • Making a universal isDown method for Button
  • Start working on the World-Camera system

Physics Engine
DartRocket's development is going great and soon i have to think about using or making a Physics Engine.
  • Using dart-box2d, which is not an option for me, because i want to use some really simple physics engine first and box2d is not the easiest thing out there.
  • Using Javascript physics engine is not an option, because i want a Dart only solution.
  • Make my own physics engine, which can do some really basic stuff. My only problem with this is the fact that I never liked physics in general, although in this case the physics engine has to deal with some vectors and I already use vectors to move some stuff, so it should be an easy task(or not).
I think after the next release I start working on the physics engine at last. 
Let me know if you have any feature request or new idea about how the physics engine should work. 

I'm thinking about starting a forum for the project, so I can give some support for the brave souls, who try to use or thinking about using DartRocket.

My favourite mix for development.

Nincsenek megjegyzések:

Megjegyzés küldése