Skip to content

Instantly share code, notes, and snippets.

@boxp
Created June 23, 2014 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxp/dafd82133455d033f5cd to your computer and use it in GitHub Desktop.
Save boxp/dafd82133455d033f5cd to your computer and use it in GitHub Desktop.
動かないゴミコード
enchant();
/* global vars */
const WIDTH = 320;
const HEIGHT = 480;
/* initial function */
window.onload = function () {
var game = new Game(WIDTH, HEIGHT);
/* barrages */
var testBarrage =
"<bulletML><action label='top'><fire><bullet/></fire></action></bulletML>";
/* scenes */
var resultScene = new Scene(WIDTH, HEIGHT);
var battleScene = new Scene(WIDTH, HEIGHT);
var titleScene = new Scene(WIDTH, HEIGHT);
game.fps = 45;
game.preload('icon1.png');
game.onload = function () {
/* characters */
var WhiteBare = Class.create(Sprite, {
initialize: function (x, y) {
enchant.Sprite.call(this, 32, 32);
this.x = x;
this.y = y;
this.image = game.assets['chara1.png'];
this.frame = 5;
},
});
var BrownBare = Class.create(Sprite, {
initialize: function (x, y) {
enchant.Sprite.call(this, 32, 32);
this.x = x;
this.y = y;
this.image = game.assets['chara1.png'];
this.frame = 0;
},
});
var player = new WhiteBare(160, 400);
battleScene.addChild(player);
var enemy = new BrownBare(160, 50);
battleScene.addChild(enemy);
/* push batttle scene */
game.pushScene(battleScene);
var testBarrage = new AttackPattern(BulletML.build(testBarrage));
var ticker = testBarrage.createTicker(player);
enemy.addEventListener("enterframe", ticker);
}
game.start();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment