Created
June 23, 2014 08:13
-
-
Save boxp/dafd82133455d033f5cd to your computer and use it in GitHub Desktop.
動かないゴミコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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