読者です 読者をやめる 読者になる 読者になる

ゆうたクラブ日記

ゆうたクラブTV http://gantakun.hateblo.jp/

yuta,s1

Dげーむのソースコード

Puppet.create("うちゅうせん", {
    filename: "enemy01.png",
    w: 16,
    h: 16,
    behavior: ["zigzagY", "tapChase", "standAlone",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }]
});
Puppet.create("かみなり", {
    filename: "images/corocoro/kaminari.png",
    w: 16,
    h: 16,
    behavior: ["randomSetup",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }, "moveRandomDir", "hitAndDie",
    {
        init: function() {
            this.collision.push("うちゅうせん");
        }
    }, {
        hit: function() {
            enchant.puppet.Theatre.instance.score += parseFloat(0) || 0;
        }
    }]
});
Puppet.create("ひこうき", {
    filename: "starship.png",
    w: 24,
    h: 24,
    behavior: ["randomSetup",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }, "hitAndDie",
    {
        init: function() {
            this.collision.push("うちゅうせん");
        }
    }, {
        hit: function() {
            enchant.puppet.Theatre.instance.score += parseFloat(0) || 0;
        }
    }, "moveRandomDir"]
});
Puppet.create("ひこうき2", {
    filename: "starship.png",
    w: 24,
    h: 24,
    behavior: ["randomAppearRight",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }, "hitAndDie",
    {
        init: function() {
            this.collision.push("うちゅうせん");
        }
    }, {
        hit: function() {
            enchant.puppet.Theatre.instance.score += parseFloat(0) || 0;
        }
    }, "moveRandomDir"]
});
Puppet.create("ひこうき3", {
    filename: "starship.png",
    w: 24,
    h: 24,
    behavior: ["randomAppearBottom",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }, "moveRandomDir", "hitAndDie",
    {
        init: function() {
            this.collision.push("ひこうき2");
        }
    }, {
        hit: function() {
            enchant.puppet.Theatre.instance.score += parseFloat(0) || 0;
        }
    }]
});
enchant.puppet.Theatre.changeScreen("spacebg.png");
Puppet.create("ひこうき4", {
    filename: "starship.png",
    w: 24,
    h: 24,
    behavior: ["moveRandomDir", "standAlone",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }, "hitAndDie",
    {
        init: function() {
            this.collision.push("うちゅうせん");
        }
    }, {
        hit: function() {
            enchant.puppet.Theatre.instance.score += parseFloat(0) || 0;
        }
    }]
});
Puppet.create("ひこうき5", {
    filename: "starship.png",
    w: 24,
    h: 24,
    behavior: ["randomAppearLeft",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }, "hitAndDie",
    {
        init: function() {
            this.collision.push("うちゅうせん");
        }
    }, {
        hit: function() {
            enchant.puppet.Theatre.instance.score += parseFloat(0) || 0;
        }
    }, "moveRandomDir"]
});
Puppet.create("ばくはつ", {
    filename: "effect0.gif",
    w: 16,
    h: 16,
    behavior: ["randomAppearTop",
    {
        sceneStart: function() {
            this.interval = 30;
            this.initialNumber = 10;
        }
    }, "moveRandomDir", "hitAndDie",
    {
        init: function() {
            this.collision.push("うちゅうせん");
        }
    }, {
        hit: function() {
            enchant.puppet.Theatre.instance.score += parseFloat(0) || 0;
        }
    }, {
        init: function() {
            this.collision.push("うちゅうせん");
        }
    }, {
        hit: function(event) {
            var other = event.other;
            if (window.うちゅうせん && (other instanceof window.うちゅうせん)) {
                (function() {
                    var theatre = enchant.puppet.Theatre.instance;
                    theatre.end(theatre.score, "score: " + theatre.score, theatre.assets["clear.png"]);
                }());
            }
        }
    }]
});