Buildbox complete infinite runner prototype featuring random enemies, in game tutorial, splash screen, game over screen and more

I love to code, but sometimes I love to experiment with the so called #nocode tools and build stuff.

With Buildbox I already showed you how to build a Sokoban prototype, a 3D version of Two Cars and also a 3D version of Don’t Touch the Spikes.

Today is the turn of a game with no name, an endless runner with all the modern features like splash screen, in game instructions showed only once, game over screen, randomly generated levels, physics and particle explosions.

Have a look at the game, unfortunately Buildbox can’t export for HTML5 so I have to show you a gif image:

Obviously all this stuff requires a bit of coding, but most of the hard work has been done using nodes, as you can see from this image:

The game works looping again and again through this scene:

Everything is grey here, but each time random colors are generated with this simple JavaScript:

let colors = [[255, 0, 0], [0, 255, 0], [0, 0, 255]]

function init(){
	let zPosition = this.entity().worldPosition().z;
	if(zPosition < -10){
		let possible = false;
		let floorColor = randomColor();
		this.entity().setColor(colors[floorColor][0], colors[floorColor][1], colors[floorColor][2]);
		let cubeColors = [];
		for(let i = 0; i < 5; i++){
			let color = randomColor();
			cubeColors.push(color);
			if(color == floorColor){
				possible = true;
			}
		}
		if(!possible){
			let exit = Math.floor(Math.random() * 5);
			cubeColors[exit] = floorColor;
		}
		let cubes = this.scene().find("ColorCube");
		let totalCubes = cubes.length;
		for(let i = 0; i < 5; i ++){
  			let cube = cubes[totalCubes - 5 + i];
			let cubeColor = cubeColors[i];
			cube.setColor(colors[cubeColor][0], colors[cubeColor][1], colors[cubeColor][2]);
			cube.colorMatched = floorColor == cubeColor;
		}
	}
}

function randomColor(){
	return Math.floor(Math.random() * colors.length);
}

Then, once the ship hits a box, we check for the color of the box to match the color of the ground.

I had to edit some built in scripts here and there, but the main logic is all described in the above script.

I am preparing a more detailed tutorial about building a game with Buildbox, but you can check the source code of the entire project and make yourself an idea about the ease of game development using this tool.

I will try to complete the game and publish on the app stores, then share my experience, stay tuned.

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