Introducing the new Citrus engine
Talking about Actionscript 3, Flash and Game development.
Almost a couple of years ago I showed you how to create a Flash platformer using Citrus Engine, so if you are an old time reader, you should already know Citrus Engine
Now a completely new version of the engine has been released, with these breath-taking features:
* GPU accelerated via Stage3D technology which supports your choice of 2D or 3D using either the Starling Framework or Away3D.
* Open-source ActionScript 3 based community project that you can extend or alter in any way to fit your needs.
* Box2D, NAPE and AwayPhysics are available out of the box. With Citrus you have access to three supported physics engines enabling you to create 2D or 3D experiences. You can even build a 3D game that uses 2D physics, like a side-scroller platformer.
Although Citrus still features a lot of platform game oriented classes, with automatic generation of platforms, heros, coins, crates, cannons and so on, I will show you how to create a basic level of the famous Totem Destroyer game, which has nothing to do with platform games.
First, the main class:
package { import citrus.core.starling.StarlingCitrusEngine; public class Main extends StarlingCitrusEngine { public function Main() { setUpStarling(true); state = new starlingState(); } } }
where starlingState
is:
package { import citrus.core.CitrusEngine; import citrus.core.starling.StarlingState; import citrus.physics.box2d.Box2D; import citrus.objects.Box2DPhysicsObject; import Box2D.Common.Math.b2Vec2; public class starlingState extends StarlingState { public function starlingState() { super(); } override public function initialize():void { super.initialize(); var box2D:Box2D=new Box2D("box2dworld",{gravity:new b2Vec2(0,5),visible:true}); add(box2D); var ground:Box2DPhysicsObject=new Box2DPhysicsObject("ground",{x:320,y:480,width:640,height:40}); ground.body.SetType(0); add(ground); add(new Box2DPhysicsObject("block 1",{x:380,y:440,width:40,height:40})); add(new Box2DPhysicsObject("block 2",{x:260,y:440,width:40,height:40})); add(new Box2DPhysicsObject("block 3",{x:320,y:400,width:160,height:40})); add(new Box2DPhysicsObject("block 4",{x:320,y:360,width:80,height:40})); add(new Box2DPhysicsObject("block 5",{x:300,y:320,width:120,height:40})); add(new Box2DPhysicsObject("block 6",{x:320,y:260,width:160,height:80})); } } }
Look how easy is to create a primitive Box2D body, but it’s not over… next time I am showing you how to embed your own graphics and extend Box2DPhysicsObject class to have our custom, destroyable bricks.
Meanwhile, the result:
I have to say I like this engine a lot, probably I’ll create some kind of game with it.
Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.