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.




2014. június 30., hétfő

Release of v.0.1.3

This release brings a lot of breaking change, which is bad, but at the same time it shows that the library is improving. I have to admit i love breaking things, because it makes DartRocket cleaner and easier to use. Not to mention it's so easy to break thing in Dart, because refactoring is excellent in the Dart Editor.

What's new in this version?

  • EventLiseners on stage are automatically removed during state change, so you don't have to remove them anymore.
  • Button class is simplified and easier to use. You don't have to use the setCoordinates method anymore.
  • Fixed embarrassing typo KillteState to KillState and isMoveable to isMovable
  • Named constructors for Sprite, Button and Background class. This change make possible to use more ways to create game objects.
  • Background class undergo a big change and now has more options like scaling and repeating the background. Moving background now support all kinds of speed values.
  • GameObjectFactory class to make gameobject easier, although only sprites are supported for now.
For more information look at the documentation, changelog and the space invader example.

Issues i found:
  • During testing space invader on different browsers i found out that only Chrome and Dartium showed correctly the moving background.
  • Another interesting issue is that only on IE, I couldn't make the ship to move.

Favourite video of the moth: https://www.youtube.com/watch?v=2pTgRhGqXok

2014. június 13., péntek

Release of v.0.1.2

This release was hard to make, because i wanted to make DartRocket mobile friendly or at least compatible with cocoonjs. It was especially hard, because i don't have a smartphone, so I used the built in emulator in Dartium and Chrome. Actually i mostly used Dartium, because that was the only one that had working touch emulation. For some unknown reason in Chrome, it didn't work.
It's ironic that i don't have a smartphone, but have a really powerfull pc. :D

DartRocket is mobile friendlier now and has a Button class, which is good for making buttons. Duhhh
I'm not to happy about the Button class, because i had to overwrite some event listeners to make it work. I'm still thinking about how to make it more clean, but at least it works.

Future plans:

  • GameObjectFactory class
  • Better Background class
  • Arcade Physics
  • Thinking about making a platformer example

Tip of the day: https://www.youtube.com/watch?v=neI_Pj558CY

You can find the Docs here: DartRocket 0.1.2 (Thanks dartdocs.org :D)

State Machine example and Space invader

2014. május 29., csütörtök

Version 0.1.0 is out

I published yesterday a new version, so here is what's new:
  • There is only 1 Sprite Class, which means you don't have to think about what to use.
  • Sprite is not abstract so to make a Sprite you don't have to extend it
  • Making a Sprite is easier because you don't have to give the constructor a bitmapdata, instead you have to give it a context and a resource name
  • There is a new class the Group, which is a simple container for Sprites
  • Group is List, which has some additional functionality
  • Group has 2 function, which doesn't belong to the List class: forEachAlive and anyAlive
  • Space Invader example is reworked to use these new things
  • I updated the documentation, but unfortunately there is bug in docgen, which makes my documentation on dartdocs.org useless(it's an empty page)
This release made the space invader example so much cleaner, so you should look into the example to see the changes and because there is no online documentation at the moment.

2014. május 24., szombat

Challenge accepted

I was surfing on the internet and mopping around, when I visited the ludum dare site an it caught my attention that there will be a Tool Jam next weekend (May 31st-June 1st) and I thought that this will be the best time to make a major release and to promote DartRocket. :D

Here is the Battle Plan:

  • A Sprite class to rule them all, so there will be only one sprite class
  • Drag support for sprite
  • Finalized version of the Group class
  • Better background class
  • Implementing a Sound class
  • Better Text class
  • Making a Keyboard class
  • Make the space invader more simple with these additions
  • Finally complete the space invader example, so it will look like an actual game
It's a little unfair to other competitors, because i have been making this since the ludum dare 29 ended, but it's for the greater good. :D

2014. május 17., szombat

TIL Documentation with docgen

At last i made a documentation for the package and i have to say that it was not a piece of cake. The last three days was all about documentation and i learnt a lot from it.

Experience:

  • You better start learning markdown or be an active redditor
  • The documentation about documentation generation is out of date, which i find ironic
  • docgen is in the dart-sdk, so you don't need the bleeding edge repo
  • docgen is slow. It's like watching a sport event which is full of commercials. argh
  • Documentation is ready -> get it on github
  • docgen produce a lot of files -> if you use github gui client you gonna have a bad day
  • Github doesn't like symlink directories and so will break your documentation
  • After finding this site: http://www.dartdocs.org/ -> I go to a dark corner and start crying
After all, I'm happy because I managed to survive and it seems like we have a brighter future ahead.

The new documentation of DartRocket got on the site.


2014. május 14., szerda

Introduction of DartRocket

 This will be my first blog post that introduces DartRocket to everybody and also this will be my first blog in english and my first blog for a project. I destroy a lot of first with this blog. :D
I try to answer to the most important questions.

What is DartRocket?

 DartRocket is a HTML5 Game framework, which is written entirely in the Dart programming language. DartRocket depends on the awesome StageXL webGL render engine.

What are the goals?

 My primary goal is to make DartRocket an easy to use game framework and and easy to learn game framework. My second goal is to introduce Dart to gamedevs and hope to make it a little more popular.
All in all my goal is to make a game framework like Phaser, but in Dart.

Why did you start making it?

My first reason:  There is a saying in gamedev community: "Make games, not game engines" and I agree with that, but what if there are no game engines? :D (Dart has some game engines, but none of them is "complete")
 Before i even started thinking about making DartRocket, I was using Dart and StageXL to make some simple experimental games and i even participated in Ludum Dare 29 Compo.
 After LD29 i noticed that there are a lot of common code sections in my games, which made me start thinking about making a framework.

My second reason: I got annoyed with Javascript way of making HTML5 games and I'm always seeking cleanly structured code(after watching some Uncle Bob video), which is really hard to make in Javascript's case. Not to mention using a language, which is so out of date that it's not even funny anymore.

My third reason:I think Dart is an incredibly good platform, which was designed for web development and so it's enjoyable to work with. Not to mention the batteries are included.

When did i start making it?

 My first thought about DartRocket was after LD29, but even before that i made state machine for LD29, which eventually became the base of my game framework.
LD29 was a really good starting point for a game framework, because i got a lot of great feedback, which give the boost to start making it.

How will i make it?

 My plan is that i keep making games with DartRocket and if i see a code that i can reuse, then i will build it into the framework.
 My second plan is include features that are required for making HTML5 games with ease.

Is it usable?

 DartRocket is in early stage, so there will be a lot of breaking change when i update the framework, but at the same time there will be examples to show how it works and how the features are working.
DartRocket best feature the state machine is working and there is a working simple game in the examples. You can try it out with a little courage. :D
There is no documentation, but i will work on it.

Where can i find it?

You can find it on pub and on github

Who am I?

 I'm Dart enthusiast, webdev, gamedev and unfortunately a student, who has to study for his final exam.