2015. március 9., hétfő

DartRocket 0.1.7+1 is out

It's been a while I published my framework, but ironically I published it twice in a  week time.
So let's see what's new in DartRocket and why did I need to publish twice.

DartRocket 0.1.7

  • You can use gravity thanks to the newly gravity class in physics folder and also you can find an example about how to use in the example folder. Not to mention you can also try it out.
  • Now the sound can be stopped, which is pretty handy in case you want to stop it.
  • Added Shapes and Mask from StageXL
  • GameObjectfactory can create basic shapes(Rectangle, Circle)
  • DartRocket now use up to date version of StageXL(0.10.3), which is why the InteractiveBitmap class got simpler.
  • The biggest change is the re-factoring of the library structure. I wrote about this in my last post, but for sort the library got more modular and got more unit tests. The best part is that the user can't feel anything about this, because it did not bring any breaking change.


I have to admit I was a little hasty, when I published 0.1.7, because I didn't test the GameObjectfactory's new methods, which led to the hot fix release.

DartRocket 0.1.7+1
  • Fixing GOF's shape creation. Unfortunately the new shape methods gave back graphics instead shape. oooppss
  • Moving centerPivot into InteractiveBitmap, so every child has it(like button,sprite).
  • Added some docs to MovementSystem
  • Removed multiSprite from GOF, because i never really used it and didn't really like it at all. It was an unnecessary feature.

What does the future holds?
First it holds a lot more unit test and more re-factoring of the code base. 
I also eagerly waiting for the next release of StageXL, because DisplayObjectContainer will be iterable, which will make it extremely easy to use. Future looks bright. :D

Feature wise I'm thinking about making a CSS system for the framework, so it will be easier to make responsive games and putting objects on to the screen, but I'm still in the thinking/planning phase, so let me know if you have any idea about this.

That's it for today folks.


tl;dr Hooray hooray a new version of DartRocket!

2015. február 23., hétfő

Breaking DartRocket up

Maybe some of you noticed I finally started doing updates on the library(in form of git commits). After thinking about a lot about the library and how it structured. I finally decided to break up the big library into smaller sub libraries and I also started adding unit test for it. For now there won't be any new feature added to the library, because I feel that I need to make the unit tests first.

Why the sub libraries?
Whenever I see a big chunk of code I became  nervous, because I like simple and small things. Although I still wasn't sure about the sub libraries, because the big library structure worked, but I find out with a little test(making physics into a sub lib) that my project has high coupling , which was kind of like a punch in the face(Ughh). The final push came from StageXL, because it already used sub libraries. Once again the solution for my problem was to copy-past an idea from StageXL. :D

The night of the unit tests
I never really did any unit testing, because I kind of like to do Cowboy coding, but unfortunately it's not considered a "clean" way of doing software developments, so I started to write unit tests to make the code base cleaner and it's actually working.(Weird :D) At first I  will only do synchronous test, because I still have no idea how to write async tests.

That's all I can say for now.

Before I forget. Let me know if any of you want to jump on the DartRocket train.

2014. november 11., kedd

Release of v.0.1.6

Another month and another update for DartRocket. I made all of you wait, because I was lazy and got other stuff do to as well.

What`s new?
  • The biggest change is the new physics directory, because it contains the moving parts and the collision detection.
  • Another big change is movement system, because it consist 3 classes which are layered on top of each other like 3 layer burrito. These are:   DirectionSystem, MovementSystem and MovementControll.
  • DirectionSystem manages where the game objects are heading.
  • MovementSystem manages how the game objects are moving with the help of  the DirectionSystem.
  • MovementControll gives us a simple interface on how to use the MovementSystem. 
  • Sprite and Camera class now uses the MovementControll class for moving. 
  • My favorite change is the unified look of the code base. It just looks better. :D
  • Shape class from StageXL can be used with DartRocket. You can use canvas methods with it.
Tasks for the next version:
  • Writing tutorials for the github wiki
  • Fixing bugs
  • Making better collision detection using polygons. Something like this.
  • Also start using 0.10.x version of StageXL. 
  • Writing test, which i should have already done long time ago. :D
  • I also welcome any feature request or contribution to the project.

Development got a little slower so I have to step up my game and work 

2014. október 13., hétfő

Not dead yet

Been a while since I posted anything on DartRocket's blog or made any improvements on the library, but from now on I promise I will give DartRocket some love.

To prove i. I made the Sprite class less horrible by putting Sprite's moving system into the new MovingSystem class. The cool thing about this is the fact that the usage of the Sprite class stayed the same.

Another cool thing is how I dvided the MovementSystem's code into chunks by adding long comments. I stole the basic idea  from StageXL. I think this would be an awesome feature to have in the DartEditor, because it make the code more understandable.

You can see what I'm talking here: MovementSystem class

It's been a while since I released a new version, so in this or the next week i will release an update.
The only thing that i need to do before updating is:
  1. Making Camera use the MovingSystem class
  2. Making the code more readable by separating the code into chunks
  3. Usual stuff like adding/updating documentation

That's all I can say for now and also here is the music that inspired the post's title:

2014. augusztus 22., péntek

Release of v.0.1.5(in time for LD)

Update
Like I promised, I released this update in this month. A lot of good stuff is in this release as well and I can say that this was the most challenging one. So what's new?

  • The new vector based movement system that I wrote about in the last post. One of my favorite, because I find it so simple and elegant solution for moving sprites.
  • Acceleration added for sprite, which means sprite can speed up and slow down.
  • A new class: Direction, which is full of String constants. You can use it if a method wants a String direction.
  • You can find a Moving System example in the repo, which show how it works.
  • I made a getting started guide in the repo's wiki, which pretty basic.
  • I made a project template for faster start with DartRocket.
  • More event handlers for keyboard: onKeyDown and onKeyUp, which means you can use only the keyboard to handle this events. You don't need to add event listeners for world.
  • CollideWorldBounds mean that the Sprite can't go out of the world bounds if it's true.
  • KillOutOfBounds mean that the Sprite will be killed if it's out of the world's bounds.
  • Fullscreen mode has minScale and maxScale which you can set in the Game's constructor. I added this because scaling the game big time can make the performance worse.
  • Button has isDown handler for touch and for mouse click.
  • I made a small fix about using the world instead of the stage in the library.
  • One of the hardest change is that now the Camera class basic's function works. It was really hard, because "moving"  a camera actually means moving the world. So everything is backwards.
  • We can move the camera with moveDistance method, which uses direction names from the Direction class.
  • Camera has a follow method which will follow a sprite and an unfollow method which will do the opposite.
  • A new example, which show this new methods in practice.
  • Biggest breaking change is the fact that I removed the name parameter from the State's constructor, because I can give the name of the state thru the statemanager. This change will be also feel the same what Phaser use, although you can still give the next state's name to the State's constructor.
  • State no longer extends Stream<String>. I made this change because I wanted to use a private function to start a state instead of the public listener method and because the  State only need the private StreamController to work correctly.
  • This many change also brought to you an updated documentation.
You can find the changelog here.

New Examples
Moving system (code) : You can move with wasd, you can rotate with qe and you can accelerate with jk.
World-Camera (code): You can move the ship with wasd, you can unfollow the ship with space and you can move the camera with cursors.

Ludum Dare 30
Another big event for the week is Ludum Dare 30. I will participate in it and I hope I will get a better score this time. Naturally i will use DartRocket for this competition.


Ultimate Music of the week :D

2014. augusztus 11., hétfő

Some news

I have some brief news for the week.

Forum
DartRocket now has an official forum.
I chosed Ost.io to host the forum, because you can use it with a Github account.  I made the forum, so i can give support or talk about the development of DartRocket.


Wiki
I started doing the wiki and I plan to make it a in-depth introduction of DartRocket.
I want to show with this wiki how the game engine is built up and how it should be used.
If the wiki is completed then I plan to publish a gitbook, which will give an a better reading experience than the wiki.

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.

Solution:
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.
Options:
  • 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. 

Forum
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.