Totem Destroyer prototype made with Dreemchest

Read all posts about "" game

Do you remember Dreemchest? It’s an amazing 2D development engine packed with features I blogged about some time ago.

Meanwhile Dreemchest evolved and got a bunch of new features, and now the first Dreemchest-powered game, Match them All, has been released on the App Store.

Do you want to have a brief overview of Dreemchest capabilities? Let’s see how to crate a Totem Destroyer prototype in just a few steps. The aim of the tutorial is to create some physics crates destroyable with a mouse click, using the WYSIWYG editor.

First, we want to create a standalone project, which is an executable file to be run on the computer. Let’s enter the resolution and the project name.

We need some graphics, so in the Assets panel let’s start to import assets.

A large brown bar will be our ground, so we are placing it at the very bottom of the stage.

It’s just a PNG image at the moment, so we need to create a physics body which will represent it. In the Assets panel let’s create a shape.

Which kind of shape are we going to create? A rectangle

We assign the newly created shape the same size of the PNG ground

Now that the ground physics body has been created, drag and drop it onto the PNG image to bind physics body to the image.

And we are done with the terrain. The creation of the blocks will require just a little bit of scripting because of the mouse listener.

Create a new script

Which will contain this lua code:

-- Declare new class called 'Create' and subclass it from 'Graphics'
class "Crate"( Graphics )

-- Class constructor
function Crate:Crate()
	-- Set the crate texture, 'bmpCrate' identifier is attached to
	-- 'box.png' image on an 'Assets' pannel
	--
	-- Select the box.png image and you'll see that 'Class' is equal to 'bmpCrate'
	-- on the 'Properties' pannel
	self.texture = 'bmpCrate'
	
	-- Same thing with a 'crateshape' asset
	self:physicalize( { shape = 'shCrate', static = false } )
	
	-- Now attach a listener
	self:attachListener( TapEvent.Up, self, 'onTapUp' )
end

function Crate:onTapUp( e )
	self:release()
end

-- Now you can place this script on the stage by drag-and-drop like an image
-- This will automatically call a constructor and the placed object will have a
-- physical body, image and will be clickable

It’s now easy to load the new crate asset and assign it the bmpCrate class and the physics shape with shCrate class.

At this time, just drag and drop the class on the stage and you will create physics driven boxes which will disappear on mouse click.

This is how your main project will look when you’re done:

As you can see, with Dreemchest you can easily create games with basic scripting and a WYSIWYG editor. Download the project source code or the final Windows exacutable.

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

215 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
// Stairs
// 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