Category — Getting Started
Unity 3D Game Development Essentials

I’ve just received my copy of Unity 3D Game Development Essentials which is written by Will Goldstone. In a nutshell its about giving novice programmers right the way through to experienced developers a good and thorough handle on building a game with Unity. It covers physics, scripting, particle effects,instantiation terrain generation and generally everything required for the modern game.
It’s based on the 2.5 version of Unity and uses Javascript for its scripting language.
Once I’ve finished reading it I’m gonna post a review which should be up in a couple of weeks, but going on first impressions it looks a great book! If you what to get a better impression on how the book is written and whether you’d benefit from it, there’s a sample chapter available here.
If you already have the book, let me know what you think!
December 3, 2009 No Comments
HYPE Framework – Bring experimentation to the masses.
Recently Joshua Davis and Brendan Hall released a new framework call HYPE. The aim of the framework is to allow everyone from newbie level to professionals experiment with ease using Flash.
I’m hoping to find some time in between GCSEs to have a go at making some stuff with this, so keep any eye out. You can download it here, and find the setup instructions here.
Have fun!!
November 3, 2009 No Comments
Creating special effects in Flash CS3
Right well, I have seen many different demos and examples of how to create unique, random art by code. Now this looks very cool, but how on earth do you recreate this? Well the is what I am going to show you. There final piece can be downloaded here. As you can see, this is quite a cool piece of generative art. Now I am going to show you how to achieve this.
Step 1:
First of fire up Flash CS3. If you don’t have a copy you can download a trial from Adobes site. Right, now create a new Flash Actionscript 3 document. The next thing to do is set up the stage. I kept my dimensions of my Flash file as the default, 550px x 400px. Also set the frame rate to about 30fps. This stops the animation from appearing to be slow, and chuggy.
Now for this tutorial you need a simple graphic that will be used as our starting point for the animation. So, draw a simple circle on the stage, make sure its not very bit (maximum 100×100) and then select it all and press F8. This will present you with a box that will let you create a movie clip. Set the name to ‘Circle’, and then set the type to Movie Clip. Now, there should be a Linkage section, but if its not present, click the Advanced button in the bottom right hand corner.
In the linkage section there should be a check-box saying “Export for Actionscript”. Once this is clicked, some of the boxes that were greyed out should be come editable. There should be a box saying Linkage ID (or Symbol name), or something similar. If it is not already containing the word ‘Circle’, adjust it accordingly.
So now click OK. There might be a warning come up, but just click OK. The next thing to do is the delete the graphic that you created from the stage. All you need to do is select it (single click) and then press DELETE. This will delete it from the stage, but it will still be in the library.
Step 2:
Now we have the flash file set up, click on the first frame of the timeline and press F9 to access the actionscript editor.
So, now to set up everything that we need for the tweening etc. So click in the first line and add this code:
import gs.TweenLite; import gs.easing.Expo;
For this to work you need to have TweenLite in your class path. You can download it from here. If you don’t have a special class path just unzip the file that you have just downloaded and copy the folders to the same directory that your Flash file is.
So with the appropriate imports done, now we need to set up some basic variables that will make our development much easier:
var amountOfCircles:Number = 30; var stageW:Number = stage.stageWidth; var stageH:Number = stage.stageHeight; var ranX:Number = Math.random() * stageW - 300; var ranY:Number = Math.random() * stageH - 300; var ranAlpha:Number = Math.random() * .5;
Now here’s an explanation of what these lines are for.
The first one is fairly obvious. This is how many difference instances of the graphic you created earlier we will create. As you can see from the completed version there are multiple circles flying around.
The next two contain the width and height of the stage. This is purley to make it easier to reference to the value of the width of the stage. Basically it saves more typing.
The two after that are variables that hold a random X and Y value that are within the width of the stage.
The last one is a random alpha value between 0 – 50. This means that the graphic will never be completely opaque.
Step 3:
Now we need to create the 3 filters that we are going to create. There are two blur filters and a glow filter. You will see soon how we animate and apply them to out graphic.
var blur:BlurFilter = new BlurFilter(10, 10, 1); var blurBM:BlurFilter = new BlurFilter(20, 0, 1); var glowBM:GlowFilter = new GlowFilter(Math.round( Math.random()*0xFFFFFF ));
It is fairly obvious which filters are what, but the parameters are not! So here we go.
For a blur filter it is as follows new BlurFilter(BlurX, BlurY, Quality). Now the BlurX and BlurY are fairly straight forward, it sets how much you want the filter to blur the graphic on the respective axis. The next is the quality, and I usually set this to one for high quality. You can set it 1 – 15, and the X and Y can go from 0 – 255.
Later we will apply these filters to out bitmap data.
Step 4:
Now we are getting to the more exciting bits. We are going to create and add the bitmap and bitmap data objects.
So to do this we use:
var bmd:BitmapData = new BitmapData(550, 500, true, 0x000000); var bm:Bitmap = new Bitmap(bmd); bm.x = 0; bm.y = 0; addChild(bm);
Right now, this is most probably a new bit for you. So first a bit on bitmap and bitmap data objects.
- Bitmap Data - This is basically something that holds all you data that you are going to insert into your bitmap object. So this includes the width, height, whether it is transparent or not, if so what color should be displayed in the transparent area. This will also hold all the data we want to draw, as you will see late.
- Bitmap – This is the actual bitmap that all the data from the bitmap data will be inserted into and be drawn out. Think of this as the container and the bitmap data being the cargo.
So in the first line we create the bitmap data object and assign all the necessary data for now. This is what I explained earlier.
Next we create the bitmap will is where all the data from the bitmap data will be drawn out into.
After this will align the bitmap to the top left corner of the stage as the top left of the stage is always at X = 0 and Y = 0.
Finally we actually add it to the stage so we can visually see it.
Step 5:
Now we come to an exciting part, creating and adding all the instances of the graphic we created earlier to the stage.
Add this code straight after the last one.
for (var i:uint = 0; i <= amountOfCircles; i++) { var circle:Circle = new Circle(); circle.x = ranX + Math.random() * 100; circle.y = ranY + Math.random() * 100; circle.alpha = ranAlpha; circle.filters = [blur, glowBM]; addChild(circle); }
So what we are doing here is creating a simple loop that will keep running until it has looped over the same about of times as we set in the amoutOfCircles.
Here we also set the current circle to have random X and Y positions, and also random alpha value.
Now, this is where we are starting to use the filters we created earlier. An movie clip or graphic has an array that the filters can be assigned to, so what we are doing is assigning an array of filters to the filters property of circle. Lastly we add it to the stage.
Step 6:
Next we need to add an event listener that will call a function every time a frame is executed. This is an ENTER_FRAME event. Also, we call the function that will randomly move the circles we created earlier to a new random position with a random alpha and colour.
mover(); addEventListener(Event.ENTER_FRAME, enterFrame);
Step 7:
Now this is a main part of our special effect, the mover() function. This is where part of the magic happens.
function mover():void { for (var i:uint = 0; i <= amountOfCircles; i++) { var object:DisplayObject = getChildAt(i); if (object == bm) { i++; } else { object.alpha = ranAlpha; TweenLite.to(object, 1, {x: ranX + Math.random() * 1000, y: ranX + Math.random() * 1000, alpha: 0, ease:Expo.easeInOut, onComplete:mover, blurFilter:{blurX:Math.random()*100, blurY:Math.random() * 100}, tint:Math.round( Math.random()*0xFFFFFF )}); glowBM.color = Math.round( Math.random()*0xFFFFFF ); glowBM.alpha = ranAlpha / 2; } } }
So, here goes.
First of we create a loop that will iterate through all the circles. Then within this we create a variable called object and then we find a circle by using the getChildAt() which finds an object in the display list at the depth of i . We then assign the result of this to object . This gives us a handle on the current circle we are working with.
As the getChildAt() is designed to return anything that is on the stage so we need to check if it has returned the bitmap. We don’t want that, so what we do is skip to the next object in the display list. Once this has happened or if we didn’t have a handle to the bitmap in the first place we move on the code animates the circle.
First of we assign a new alpha value, then we tween it. Now this is beyond the scope of this tutorial, showing you how to use TweenLite, but here is a good tutorial. Just scroll down to the usage section. It is fairly self explanatory anyway.
Next we assign a new colour to the glow filter and also a new alpha value.
Step 8:
Now we are on the last bit of the tutorial. This defines the ENTER_FRAME function.
function enterFrame(evt:Event):void { bmd.draw(stage); bmd.applyFilter(bmd, bmd.rect, new Point(0,0), blurBM); bmd.applyFilter(bmd, bmd.rect, new Point(0,0), glowBM); bmd.scroll(10, 0); }
So, the first line captures what you can see and assigns the data that was captured to the bitmap data, and in turn then to the bitmap.
Next we apply to filters to the bitmap data. These look a little weird to here is an explanation.
The first parameter is which source bitmap data that you want to apply the filter to. The next is what area you want to apply the filter to, and we want to apply it to the whole bitmap data, then the destination point (99.9% of the time you won’t need to change this), and then finally which filter you want to apply to it.
Finally the last one moves everything in the bitmap 10px to the right.
Final Code:
import gs.TweenLite; import gs.easing.Expo; var amountOfCircles:Number = 30; var stageW:Number = stage.stageWidth; var stageH:Number = stage.stageHeight; var ranX:Number = Math.random() * stageW - 300; var ranY:Number = Math.random() * stageH - 300; var ranAlpha:Number = Math.random() * .5; var blur:BlurFilter = new BlurFilter(10, 10, 1); var blurBM:BlurFilter = new BlurFilter(20, 0, 1); var glowBM:GlowFilter = new GlowFilter(Math.round( Math.random()*0xFFFFFF )); var bmd:BitmapData = new BitmapData(550, 500, true, 0x000000); var bm:Bitmap = new Bitmap(bmd); bm.x = 0; bm.y = 0; addChild(bm); for (var i:uint = 0; i <= amountOfCircles; i++) { var circle:Circle = new Circle(); circle.x = ranX + Math.random() * 100; circle.y = ranY + Math.random() * 100; circle.alpha = ranAlpha; circle.filters = [blur, glowBM]; addChild(circle); } mover(); addEventListener(Event.ENTER_FRAME, enterFrame); function mover():void { for (var i:uint = 0; i <= amountOfCircles; i++) { var object:DisplayObject = getChildAt(i); if (object == bm) { i++; } else { object.alpha = ranAlpha; TweenLite.to(object, 1, {x: ranX + Math.random() * 1000, y: ranX + Math.random() * 1000, alpha: 0, ease:Expo.easeInOut, onComplete:mover, blurFilter:{blurX:Math.random()*100, blurY:Math.random() * 100}, tint:Math.round( Math.random()*0xFFFFFF )}); glowBM.color = Math.round( Math.random()*0xFFFFFF ); glowBM.alpha = ranAlpha / 2; } } } function enterFrame(evt:Event):void { bmd.draw(stage); bmd.applyFilter(bmd, bmd.rect, new Point(0,0), blurBM); bmd.applyFilter(bmd, bmd.rect, new Point(0,0), glowBM); bmd.scroll(10, 0); }
So there you go, phew! I hope I explained it enough and you now understand how to create these sort of effects in Flash CS3.
Any problems, suggestion, complaints etc, please feel free to contact me!
- Harry
November 8, 2008 1 Comment
Contributing to the community.
![]()
Over the past six months to a year, I have been saying to myself I must use my skills to earn a little of extra cash.
When I say this, I mean by contributing to sites like FlashDen.net and Ultrashock, with things like creative templates. Now, the trouble is that I get bored while making these templates. The reason is because with a template, you cant be as creative as you would be working on an individual project.
This is the part I strugle with. When I work on a project I like to be creative, cut lose, go out at try anything and everything. With a template, you can do this to an extent, but you have to make it so that it is appealing to a wide range of people.
I thought this might be worthy of a post because it would be interesting to see if anyone suffers from this inability to be boring :)
In the future, I hope to be creating some stuff, so now I have mentioned it on my site, it will be an incentive to start, and finish (!) working on a template!
Harry.
September 25, 2008 No Comments
Adobe Cs4
I have just been watching the Creative Suite 4 launch event. I have to say that it looks absolutly bloody brilliant!!
You can read more about the new release here: http://www.adobe.com/products/creativesuite/.
My favorite feature must be the new animaton model in Flash. Also, the ability to add a skeleton to 2D graphics. It is just great, but there is too much for me to tell you about, so head over and read all about it!
Harry.
September 23, 2008 No Comments
Matte Painting.
Some of you, back in the old days :) may have read my post on matte painting, basically saying that I was trying to get into matte painting, but other things got in the way. So here I am again, giving it another stab.
I have been researching it intently and here are some links on how to get started:
- http://forums.cgsociety.org/forumdisplay.php?f=196 – Probably one of the best resources available!
- http://www.mattepainting.org/gallery/main.php?g2_itemId=193 – List of the video workshops available on matte painting.
- http://www.mattepainting.org/gallery/main.php?g2_itemId=191 – List of the books available.
- http://www.mattepainting.org/gallery/main.php?g2_itemId=194 – Some tools that make a matte painters life easier.
- http://www.digitalartsonline.co.uk/tutorials/index.cfm?featureid=1629&pn=1 – An extremely good tutorial on creating a photo-realistic matte painting.
- http://flashenabledblog.com/2008/03/27/tutorial-digital-matte-painting-tips/ – Some very good tips.
- http://www.mattepainting.org/vb/index.php – Forums dedicated to matte painting.
- http://www.computerarts.co.uk/tutorials/3d__and__animation/digital_matte_painting – This is a very cool showcase of matte paintings and tips.
- http://mattepainting.org/vb/showthread.php?t=676 – A very good tutorial on how to do a simple matte painting.
Inspirational Work:
- http://www.dusso.com/pages/mp02.htm – This is the showcase of one of the best matte painters in the world ( I think so anyway :)).
- http://www.cgnetworks.com/gallerycrits/58284/58284_1105088582.jpg
- http://davidluong.net/subpages/mattepainting.html – A selection of very cool pictures.
- http://www.cgnetworks.com/gallerycrits/58284/58284_1108976931.jpg
- http://www.cgnetworks.com/gallerycrits/63705/63705_1109693699.jpg
- http://www.cgnetworks.com/gallerycrits/58284/58284_1120382988.jpg
So there you go for starters. I hope it helps and if anyone has any tips please let me know :)
Harry.
September 20, 2008 No Comments
Playing with Away3D
I have just spent a couple of hours last night getting to grips with Away3D. I just created a little demo that creates a few spheres and then adds an ENTER_FRAME event listener and responds to mouse movement.
You can download the whole thing here: http://harry-northover-code-store.googlecode.com/files/Away3DBasics.zip
Here is a screene:
And here’s the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | package { import away3d.cameras.HoverCamera3D; import away3d.containers.View3D; import away3d.primitives.Sphere; import flash.events.MouseEvent; import flash.display.Sprite; import flash.events.Event; import caurina.transitions.Tweener; public class Away3DBasics extends Sprite { public var stageHeightCenter:uint = stage.stageHeight / 2 - 100; public var stageWidthCenter:uint = stage.stageWidth / 2 + 100; public var cam:HoverCamera3D = new HoverCamera3D( { zoom:1, focus:200 } ); public var view:View3D = new View3D( { x:stageWidthCenter, y:stageHeightCenter, camera:cam } ); public function Away3DBasics() { cam.steps = 16; // Add the view to the stage. addChild(view); // Create 20 spheres. for (var i:uint = 0; i <= 20; i++) { var sphere:Sphere = new Sphere(); sphere.invertFaces(); sphere.x = Math.random() * 1000; sphere.y = Math.random() * 1000; sphere.z = Math.random() * 600; sphere.rotationX = Math.random() * 360; sphere.rotationY = Math.random() * 360; view.scene.addChild(sphere); } // Add Event listeners. this.addEventListener(Event.ENTER_FRAME, onRun); // Render the scene... cam.hover(); view.render(); } // This is the code for the ENTER_FRAME event. private function onRun(evt:Event):void { cam.rotationX = Math.random() * 360; cam.rotationY = Math.random() * 360; cam.rotationZ = Math.random() * 360; cam.pan(Math.random() * 360); Tweener.addTween(cam, { zoom: (stage.mouseY / stage.stageHeight) * 4 + 0.5, time:0.1, transition:"easeInOutExpo" } ); cam.hover(); view.render(); } } } |
There you go! I will be doing a lot more stuff with Away3D so keep an eye out!
Harry.
September 13, 2008 No Comments
Away3D – Getting Started
I have recently been trying to pick up Away3D. I have to say this engine is absolutly awesome!
I have decided to build my portfolio using this, so this will help me get used to using the engine as well as hopefully creating a sweet site! :)
During my efforts to find out more info and tutorials about this engine, I have found these links:
- http://www.flashmagazine.com/tutorials/index/ – This site has a whole host of tutorials and info on Away3D and Flash 3D in general.
- http://blog.paranoidferret.com/index.php/2008/03/28/getting-started-with-adobe-flex-and-away3d/ - Getting Started with Away3D and Adobe Flex.
- http://www.thetechlabs.com/3d/setting-up-away3d-with-flex/ – Setting up and using Away3D in Flex.
- http://flashenabledblog.com/2008/09/02/frameworks-away3d-away3d-web-roundup-tutorials-and-examples/ – This is a haven for info on Away3D tutorials, samples and general info!
- http://www.lemlinh.com/flash-tutorial-away3d-pathextrude-cords-ribbons – Away3D Path Extrude – Cords And Ribbons.
- http://blog.arnomanders.nl/index.php/archives/imageviewer3d-final-release/ - This is a very cool application demonstrating the powers of Away3D.
- http://www.closier.nl/playground/greenplanet.html – This is a very cool example, indeed! Green Planet!!
- http://flash-3d.org/en/Create-the-Earth-and-heavens-in-less-than-an-hour-with-Away3D – This is a great tutorial for Away3D. This could be used for some sort of language selection of area selection or even a contact form. The potential is infinite… :)
- http://www.ultrashock.com/forums/third-party-tools/away3d-93241.html – This sheds on Away3D and how it differs from Papervision3D.
- http://www.sharingb.com/programming/away3d/focus-on-away3d – Some very cool examples of Away3D in action.
- http://drawlogic.com/2008/04/11/3ds-parser-added-to-papervision-from-away3d/ – 3DS Parser Added to Papervision3D from Away3D.
- http://docs.google.com/View?docid=dczs397v_12ftrscdd9 – Getting started with Away3D.
- http://www.closier.nl/playground/temple.html – This is a very cool example indeed!
So there you go for starters. I hope this helps you guys out!
Harry.
September 3, 2008 3 Comments
What to use?
Well, over the past few years, the web has changed drastically, and I thought it would be the time to post my views on it all :)
1. AIR
![]() Adobe AIR |
This is the most noticeable development in the web, and is also the most useful! As most of you know, AIR enables you to take web applications to the desktop, with unimaginable ease. The best thing about AIR, is that you can use your existing skills, to create the applications. Also, due to the AIR run-time, it is cross platform. Now this combined with the use of tradition web languages (HTML, AS, JavaScript, etc…), opens up a huge mark, never touched upon by web developers. The power of this is still to be put to it’s full potential.
For example, you could just launch a desktop app to do your shopping, instead of launching the browser, log-in in, then waiting for the browser to refresh as you add whatever you need to your cart. All this could be done without one page refresh, no long loading times etc. This would make doing your weakly shopping much easier and less of a pain in the arse.
Here are some links to get you started:
- Gotoandlearn() – Getting started with AIR. Lee Brimelow
- Getting started with AIR on Linux. Mike Chambers
- Adobeairtutorials.com.
- 101 AIR Resources.
2. Flex / Flash
Adobe Flash CS3 |
Adobe Flex 3 |
Now, these technologies are a lot more mature than AIR. Flex is on version 3 and Flash is almost at version 10. Nearly, if not all animation and creative sites are made using Flash technologies. The same thing using other technologies would take 10x as much work, and also when using Flash you have a universal platform. This means that Flash designers/developers can kick browser compatibility out the window.
With Flash, not only can it be a great tool to create with, but also a great tool to provide inspiration with. Now you may be thing that you can gain inspiration from anything. Now this is very true. For example, is it as easy to gain inspiration to get into web dev but looking at a PHP script, or looking at a cool animation done in Flash? Now the whole reason I go into the web, was because of Flash. I remember thinking how cool it would be to creating experiences like that, and even better, show them to the whole world!
Alternatively, you could use Flex, which is based on the Flash platform, for creating RIA (Rich Internet Applications). Flex is split into two parts, the Flex framework. This provides all the components, etc, that you build Flex applications with, then there is Flex Builder. This is a Flex IDE built on Eclipse. Flex Builder (now at version 3) is very good for getting the best out of Flex. It combines a visual GUI designer and a code view.
Flex was originally designed to be used by tradition coders and not designers, but now is evolving the same way Flash did, catering for designers and developers. Although Flex, I think it will always be more for coders than designers.
Now, if you combine Flex and Flash, you get a functional RIA but with a very fancy GUI. A lot of was done in Flash, and the back end could be developed in Flex. This means that the traditional web app, will become a lot more interesting, but not lose any of its functionality.
Tutorial Links:
3. HTML / Javascript / Ajax

Ajax
Now onto the most tradition web technologies. These have been used since the early days of the web (apart for AJAX). The backbone of the web is HTML. This, in it’s self, cannot do much. This is where Javascript and other languages come in. These can be combined with HTML to provide much more functionality. This could be animation using something like Moo Tools, or a CMS using PHP/Ajax.
I haven’t had much experience using these technologies. Flash is my main one, but when I first for into web, I used HTML is extensively and also I got to know PHP.
These different technologies are now being combined with Flash, and each other to provide more complete web sites/apps.
Getting started:
Conclusion:
Well, now you know what the main aspects of some of the main languages. It really depends on what you want to do. If you want to make animations etc, then go for Flash. For RIA , use Flex. If you want to just make anything else, then you could use a combination of these languages, or see which one makes the task you need the easiest.
Harry.
August 16, 2008 No Comments
AIR On Linux
For you web designer/developers on Linux wanting to get started with Adobe AIR, their is the perfect tutorial over at Gotoandlearn().
This video is presented by Mike Chambers, who is, shall we say, a master in Flash. The video shows you how to get started with Adobe AIR on the Linux platform.
Here it is:
http://www.gotoandlearn.com/player.php?id=80
Hope it is useful, and cheers to Lee and Mike for making this happen!
Harry.
August 12, 2008 No Comments













