Giter Site home page Giter Site logo

boom's Introduction

Boom

Boom is a game framework built on top of Defold. It is heavily inspired by the Kaboom.js game framework.

Setup and Installation

  • Add Boom as a project dependency. Use one of the versions on the releases page.
  • Add boom/boom.collection to your project
  • Set boom/render/boom.render as your render script
  • Set boom/boom.input_bindings as your input bindings

Usage

Boom can be started from any script in your project. For setup in a new project simply create a new script file and add the following code:

local boom = require("boom.boom")

function init(self)
	boom(function()
		-- add your boom game code here
	end)
end

Concepts

Just like Defold, Boom is based around the concept of game objects and components. Boom uses Defold game objects and components under the hood, and adds its own constructs on top of it.

You create a Boom game object with a sprite and a position component like this:

	-- create a player game object
	local player = add({
		sprite("hero"),
		pos(100, 100)
	})

Once you have created a game object you can use the components on the object:

	-- set the player x position to 200
	player.pos.x = 200

	-- move the player left 100 pixels per second
	player.move(LEFT, 100)

Tags

You can assign tags to game objects and use these to perform operations on game objects with a specific tag:

	-- create a bunch of balls
	for i=1,10 do
		add({
			sprite("ball"),
			pos(rand(0, width()), rand(0, height()))
			"ball"
		})
	end

	-- call a function on all balls and start moving them up at 100px/s
	every("ball", function(ball)
		ball.move(UP, 100)
	end)

API Reference

Full API reference here.

Examples

Several examples of how to use Boom can be found in the examples/ folder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.