All Projects â†’ craftyjs â†’ Crafty

craftyjs / Crafty

Licence: mit
JavaScript Game Engine

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Labels

Projects that are alternatives of or similar to Crafty

lightsout
🎲 Lights Out Game
Stars: ✭ 23 (-99.25%)
Mutual labels:  games
blues
Blues Brothers, Jukebox Adventure & Prehistorik 2 engine reimplementation (SDL2)
Stars: ✭ 28 (-99.09%)
Mutual labels:  games
Game Datasets
🎮 A curated list of awesome game datasets, and tools to artificial intelligence in games
Stars: ✭ 261 (-91.47%)
Mutual labels:  games
Neural-Fictitous-Self-Play
Scalable Implementation of Neural Fictitous Self-Play
Stars: ✭ 52 (-98.3%)
Mutual labels:  games
agent
Universal script based text hooker (powered by FRIDA).
Stars: ✭ 32 (-98.95%)
Mutual labels:  games
lazap
Lazap, a cross-platform Games Client/Launcher - All your games at ONE library
Stars: ✭ 15 (-99.51%)
Mutual labels:  games
Roguelike
A text based Rogue Like game I made to teach myself Ruby.
Stars: ✭ 19 (-99.38%)
Mutual labels:  games
Games
Create interesting games by pure python.
Stars: ✭ 3,431 (+12.09%)
Mutual labels:  games
GameIndustry-hosts-Template
Unique host templates to enhance own privacy in games, websites and regulary software on Desktop and Android devices
Stars: ✭ 25 (-99.18%)
Mutual labels:  games
Boxtron
Steam Play compatibility tool to run DOS games using native Linux DOSBox
Stars: ✭ 262 (-91.44%)
Mutual labels:  games
mnimi
🎲 Mnimi (A Game of Memory Skill)
Stars: ✭ 15 (-99.51%)
Mutual labels:  games
overwolf-modern-react-boilerplate
OMRB is a free and open source opinionated boilerplate based on React that helps developers create fast, modular and modern overwolf app.
Stars: ✭ 21 (-99.31%)
Mutual labels:  games
PokemonBattleEngine
A C# library that can emulate Pokémon battles.
Stars: ✭ 92 (-96.99%)
Mutual labels:  games
GetFreeGames
Python script to search and find free games using Steam's API and to claim them using ASF's IPC API.
Stars: ✭ 18 (-99.41%)
Mutual labels:  games
Awesome One Person Games
🎮 A curated list of successul games, made (quite) entirely by a lone gamedev.
Stars: ✭ 276 (-90.98%)
Mutual labels:  games
xcloud-shield
Xcloud Beta Unofficial App for the Nvidia Shield Android TV. Playing Xbox Cloud Gaming directly on the box Nvidia Shield tv in the best way.
Stars: ✭ 93 (-96.96%)
Mutual labels:  games
roadblocks
🚜 My entry for JS13K 2015. An isometric drag & drop puzzle game in 13 kilobytes.
Stars: ✭ 19 (-99.38%)
Mutual labels:  games
Glas
WebGL in WebAssembly with AssemblyScript
Stars: ✭ 278 (-90.92%)
Mutual labels:  games
Quiz Game
Multiple choice questions answer game for android (Quiz game).
Stars: ✭ 277 (-90.95%)
Mutual labels:  games
Aitrack
6DoF Head tracking software
Stars: ✭ 262 (-91.44%)
Mutual labels:  games

Crafty JS Travis Build Status AppVeyor Build Status Sauce Test Status

Crafty is a JavaScript game library that can help you create games in a structured way…

Key Features:

  • Entities & Components - A clean and decoupled way to organize game elements. No inheritance needed!
  • Eventbinding - Event system for custom events that can be triggered whenever, whatever and bound just as easily.
  • No dom manipulation or custom drawing routines required.

Other Goodies:

  • Thriving community - Help is readily available in the forum.
  • Community modules - A growing collection of user-generated code you can use.
  • Pure JavaScript - No magic. Works in all major browsers and can be combined with your favorite js library.

Using Crafty

A simple game of pong:

Crafty.init(600, 300);
Crafty.background('rgb(127,127,127)');

//Paddles
Crafty.e("Paddle, 2D, DOM, Color, Multiway")
    .color('rgb(255,0,0)')
    .attr({ x: 20, y: 100, w: 10, h: 100 })
    .multiway(200, { W: -90, S: 90 });
Crafty.e("Paddle, 2D, DOM, Color, Multiway")
    .color('rgb(0,255,0)')
    .attr({ x: 580, y: 100, w: 10, h: 100 })
    .multiway(200, { UP_ARROW: -90, DOWN_ARROW: 90 });

//Ball
Crafty.e("2D, DOM, Color, Collision")
    .color('rgb(0,0,255)')
    .attr({ x: 300, y: 150, w: 10, h: 10,
            dX: Crafty.math.randomInt(2, 5),
            dY: Crafty.math.randomInt(2, 5) })
    .bind('UpdateFrame', function () {
        //hit floor or roof
        if (this.y <= 0 || this.y >= 290)
            this.dY *= -1;

        // hit left or right boundary
        if (this.x > 600) {
            this.x = 300;
            Crafty("LeftPoints").each(function () {
                this.text(++this.points + " Points") });
        }
        if (this.x < 10) {
            this.x = 300;
            Crafty("RightPoints").each(function () {
                this.text(++this.points + " Points") });
        }

        this.x += this.dX;
        this.y += this.dY;
    })
    .onHit('Paddle', function () {
        this.dX *= -1;
    });

//Score boards
Crafty.e("LeftPoints, DOM, 2D, Text")
    .attr({ x: 20, y: 20, w: 100, h: 20, points: 0 })
    .text("0 Points");
Crafty.e("RightPoints, DOM, 2D, Text")
    .attr({ x: 515, y: 20, w: 100, h: 20, points: 0 })
    .text("0 Points");

Left paddle is controlled by W & S, right paddle by UpArrow & DownArrow.
Check it out online and try to modify it yourself here.

Developing

If you want to fix a bug, please submit a pull request against the development branch. Some guides to help you can be found on the wiki

If you would like to make larger contributions please catch us in the forum and we will help you get started. Much appreciated :-)

Quick build instructions

The easiest way to build crafty is to use gruntjs, which requires node and npm. If you have grunt, node, and npm already installed, then run npm install from Crafty's root directory. (This will pull down about 30MB of node packages.) From then on, just run grunt to build.

You can also use yarn instead of npm.

(Full instructions here.)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].