Introducing the new Citrus engine

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.

Get the most popular Phaser 3 book

Through 202 pages, 32 source code examples and an Android Studio project you will learn how to build cross platform HTML5 games and create a complete game along the way.

Get the book

214 GAME PROTOTYPES EXPLAINED WITH SOURCE CODE
// 1+2=3
// 100 rounds
// 10000000
// 2 Cars
// 2048
// A Blocky Christmas
// A Jumping Block
// A Life of Logic
// Angry Birds
// Angry Birds Space
// Artillery
// Astro-PANIC!
// Avoider
// Back to Square One
// Ball Game
// Ball vs Ball
// Ball: Revamped
// Balloon Invasion
// BallPusher
// Ballz
// Bar Balance
// Bejeweled
// Biggification
// Block it
// Blockage
// Bloons
// Boids
// Bombuzal
// Boom Dots
// Bouncing Ball
// Bouncing Ball 2
// Bouncy Light
// BoxHead
// Breakout
// Bricks
// Bubble Chaos
// Bubbles 2
// Card Game
// Castle Ramble
// Chronotron
// Circle Chain
// Circle Path
// Circle Race
// Circular endless runner
// Cirplosion
// CLOCKS - The Game
// Color Hit
// Color Jump
// ColorFill
// Columns
// Concentration
// Crossy Road
// Crush the Castle
// Cube Jump
// CubesOut
// Dash N Blast
// Dashy Panda
// Deflection
// Diamond Digger Saga
// Don't touch the spikes
// Dots
// Down The Mountain
// Drag and Match
// Draw Game
// Drop Wizard
// DROP'd
// Dudeski
// Dungeon Raid
// Educational Game
// Elasticity
// Endless Runner
// Erase Box
// Eskiv
// Farm Heroes Saga
// Filler
// Flappy Bird
// Fling
// Flipping Legend
// Floaty Light
// Fuse Ballz
// GearTaker
// Gem Sweeper
// Globe
// Goat Rider
// Gold Miner
// Grindstone
// GuessNext
// Helicopter
// Hero Emblems
// Hero Slide
// Hexagonal Tiles
// HookPod
// Hop Hop Hop Underwater
// Horizontal Endless Runner
// Hundreds
// Hungry Hero
// Hurry it's Christmas
// InkTd
// Iromeku
// Jet Set Willy
// Jigsaw Game
// Knife Hit
// Knightfall
// Legends of Runeterra
// Lep's World
// Line Rider
// Lumines
// Magick
// MagOrMin
// Mass Attack
// Math Game
// Maze
// Meeblings
// Memdot
// Metro Siberia Underground
// Mike Dangers
// Mikey Hooks
// Nano War
// Nodes
// o:anquan
// One Button Game
// One Tap RPG
// Ononmin
// Pacco
// Perfect Square!
// Perfectionism
// Phyballs
// Pixel Purge
// PixelField
// Planet Revenge
// Plants Vs Zombies
// Platform
// Platform game
// Plus+Plus
// Pocket Snap
// Poker
// Pool
// Pop the Lock
// Pop to Save
// Poux
// Pudi
// Pumpkin Story
// Puppet Bird
// Pyramids of Ra
// qomp
// Quick Switch
// Racing
// Radical
// Rebuild Chile
// Renju
// Rise Above
// Risky Road
// Roguelike
// Roly Poly
// Run Around
// Rush Hour
// SameGame
// SamePhysics
// Save the Totem
// Security
// Serious Scramblers
// Shrink it
// Sling
// Slingy
// Snowflakes
// Sokoban
// Space Checkers
// Space is Key
// Spellfall
// Spinny Gun
// Splitter
// Spring Ninja
// Sproing
// Stabilize!
// Stack
// Stick Hero
// String Avoider
// Stringy
// Sudoku
// Super Mario Bros
// Surfingers
// Survival Horror
// Talesworth Adventure
// Tetris
// The Impossible Line
// The Moops - Combos of Joy
// The Next Arrow
// Threes
// Tic Tac Toe
// Timberman
// Tiny Wings
// Tipsy Tower
// Toony
// Totem Destroyer
// Tower Defense
// Trick Shot
// Tunnelball
// Turn
// Turnellio
// TwinSpin
// vvvvvv
// Warp Shift
// Way of an Idea
// Whack a Creep
// Wheel of Fortune
// Where's my Water
// Wish Upon a Star
// Word Game
// Wordle
// Worms
// Yanga
// Yeah Bunny
// Zhed
// zNumbers