qq40660 / AlloyGameEngine

made game making super easy

Home Page:http://alloyteam.github.com/AlloyGameEngine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alloy Game Engine

让游戏制作变得超级容易

AlloyRenderingEngine

超快的2d渲染引擎,支持webgl和canvas渲染

基础例子

一分钟快速入门

要实现下面的效果:

usage

可以使用下面的代码:

var bmp, stage = new Stage("#ourCanvas");
bmp = new Bitmap("img/atLogo.png");
//(0.5,0.5)==〉The center is the point of rotation
bmp.originX = 0.5;
bmp.originY = 0.5;
//bind click event, the event monitor can be accurate to pixel
bmp.onClick(function () {
    //apply a random filter to the bmp
    bmp.filter=[Math.random(), Math.random(), Math.random(), 1];
});
//add object to stage
stage.add(bmp);

var step = 0.01;
//loop
stage.onTick(function () {
    bmp.rotation += 0.5;
    if (bmp.scaleX > 1.5 || bmp.scaleX < 0.5) {
        step *= -1;
    }
    bmp.scaleX += step;
    bmp.scaleY += step;
});

教程

工具推荐

This content is released under the (http://opensource.org/licenses/MIT) MIT License.

About

made game making super easy

http://alloyteam.github.com/AlloyGameEngine/


Languages

Language:JavaScript 78.9%Language:HTML 21.1%