giraz2d – test 1: cameras
October 15th, 2009
This is the first public test of the 2D game engine – called giraz2d – that I am working on. This is a very early not optimized version. The test is meant to show some of the camera capabilities.
There are five views on the screen. Each view renders all the visible game actors existing in the world into its viewport.
Each view uses Renderer component of each actor to display the actors. Each view is also connected to one camera existing in the world to define the actors relative positions.
The bigger view is connected to the MainCamera. The View has a GameViewController attached to that controls and parse the mouse and keyboard input.
The smaller views on the side shows you different cameras output: (from the top)
- Camera following the mouse with a spring
- Camera as child of the big circle-cloud (note how the rotation of the object matters)
- Camera following the small dot (no spring)
- Camera following the small dot with a spring
Also you may have notice that the TV has set as “texture” the bitmapdata output of the following-mouse-camera. This creates a cool effect when you drag for example the small dot over the tv.
The engine is written in AS3, I took inspiration from Mike McShaffry Game Development book, Colby Williams cheezeworld engine, unity3D component structure, and many other interesting projects found around the web.
It uses components more or less in the same you would use them in unity3D. The physics engine I am using in this example is Erin Catto’s box2d (which is very cool) and in theory, thanks to the components structure, you should be able to change it and implement the physics engine you prefer the most.
There is still a lot of work to be done before you can call this a game engine. At the current stage it is good enough for me use it as framework for my projects and I will try to update it as soon as I have some time.
If you are interested in the project drop me an email at riccardo.giraldi@gmail.com
