I just created an UML representation of the class hierarchy in createjs library. Sometimes I need to know some relations and taking a quick look to the class hierarchy is really useful. I didn’t include DOMElement in the diagram because it’s an experimental class and probably will not be a very… Read more »
CreateJS is a powerful library which tries to mimetic the behavior of flash/actionscript3 class hierarchy. It does a really good job, but some of the classes are left away. Maybe because they were too much flash dependent or maybe they were not used so much. There is one class I… Read more »
Currently there is a lot of hype put on ECMA6. ECMA6 is a big improvement which makes many of the old methods obsolete. However, at this stage if you want to develop html5 games it’s hard to find a stable html5 game framework which allows smooth development using ECMA6. ECMA5… Read more »
When we develop games or different tools we have to generate images on the fly or to alter existing images. In plain javascript we don’t have an existing Bitmap class and we don’t really need it. We have to perform the following operations: Let’s start creating a canvas object. We can create directly in… Read more »
As of now we have a player plane which can be controlled using the keyboard. The player plane can shoot bullets so we need now some enemies to dodge and shoot at. We are going to add the enemies in the same way we dealt with the player bullets. We… Read more »
In this tutorial we are adding the functionality to make the player plane to shoot bullets. The easiest way would be to shoot a bullet each time the player press the fire button. A little more elaborate method is to shoot bullets when the fire button is down and to… Read more »
This is the first part from the aeroplane shooting game tutorial. Here are the other sections: 1. Player Movement 2. Shooting Bullets 3. Adding Enemies 4. Collisions 5. Scoring and HUD. 1. Player Movement 1.1. Adding The Player Plane. From the beginning in an aeroplane shooting game we need… Read more »
There are several reasons we might have to export resources from flash: to create libraries to reuse them in other flash projects to use Flash Builder or Flash Develop for writing code and Flash to create graphical assets to use swc libraries in haxe projects Lets take the following sprite:
Depending whether you are using the classic TextField control and the TLFTextField newly introduced in Flash 10, you can choose one of the following options:
|
public static function centerVerticallyTF(textField: TextField): void { // because we're going to change the original position of the TextField // we want to make sure it doesn't cover other controls: textField.parent.setChildIndex(textField, 0); // new we change the position of the TextField so the text will be shown in the middle textField.y += Math.round((textField.height - textField.textHeight) / 2); } |
If we are using an TLFTextField instead of the classic TextField, it’s getting easier, because we have the vertical align feature implemented by the… Read more »
As3 Array/Vector classes don’t provide an implemented method to shuffle/randomize them. However, that’s not a hard task to do and there are quite a few methods to implement such an algorithm. One of the easiest methods is called Fisher-Yates shuffle. Probably it’s not the fastest way to shuffle an array,… Read more »