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 shows 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 the game actors’ Renderer component to render and display the actors. Also it is connected to one of the camera to define the actors relative positions.
The bigger view is rendering what 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 do and if any of you out there is interested in the project feel free to contact me at riccardo.giraldi@gmail.com or on skype at riccardo.giraldi
Feedback and ideas are appreciated!
