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
// Module check | |
(function (mod) { | |
if (typeof define === "function" && define.amd) { | |
define(['../../modules/enchant','../../modules/ui.enchant','../../modules/hack'], mod); | |
} else { | |
window.addEventListener('load', mod); | |
} | |
})(function () { | |
Math.clamp = function(value, min, max) { |
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
// Game start | |
game.onload = function () { | |
document.oncontextmenu = function(){ | |
return false; | |
}; | |
var map = Hack.maps['map1']; | |
map.load(); // Load Map; Hack.defaultParentNode == map.scene | |
// ラベル削除 |
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
game.on('abuttondown', function () { | |
var speed = 2; // 投げるスピード | |
var time = 3.0; // ボムが爆発するまでのタイム | |
// ボム | |
var item1 = new MapObject('bomb'); | |
item1.setTimeout(function () { | |
// ばくえん | |
var effect1 = new Effect(0, -1, 40); |
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
// ワープ | |
var warp = new MapObject('warp'); | |
warp.locate(7, 8, 'map1'); | |
warp.layer = RPGMap.Layer.Under; | |
warp.onplayerenter = function () { | |
Hack.player.locate(11, 5); | |
}; | |
warp.isKinematic = false; | |
warp.ontriggerenter = function (event) { | |
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
// Game start | |
var __beginTime = new Date().getTime(); | |
var __dump = new Array(15).fill(0); | |
var __stopper = function (id) { | |
var elapsed = new Date().getTime() - __beginTime; | |
__dump[id] ++; | |
return elapsed < 1500; | |
}; |
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
// Game start | |
var __beginTime = new Date().getTime(); | |
var __dump = new Array(15).fill(0); | |
var __stopper = function (id) { | |
var elapsed = new Date().getTime() - __beginTime; | |
__dump[id] ++; | |
return elapsed < 0; | |
}; |
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
// Module check | |
(function (mod) { | |
if (typeof define === "function" && define.amd) { | |
define(function (require, exports, module) { | |
require('enchantjs/enchant'); | |
require('enchantjs/ui.enchant'); | |
require('hackforplay/hack'); | |
mod(); |
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
game.onload = function () { | |
var map = Hack.maps['map1']; | |
map.load(); // Load Map; Hack.defaultParentNode == map.scene | |
// コウモリ | |
var enemy3 = new Bat(); | |
enemy3.locate(7, 5, 'map1'); | |
enemy3.onbecomeidle = function () { | |
var target = Hack.player; |
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
game.preload('enchantjs/monster5.gif'); | |
// ====> ウロボロスクラス | |
// 文字からフレーム配列を生成する | |
var anm = function(source) { | |
Array.prototype._SCALE_ = function(scale) { | |
var result = []; | |
for (var i = 0; i < this.length * scale; ++i) { |
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
// 見た目だけ使いたいMOD 実装2 (テストなし) | |
game.preload('enchantjs/monster5.gif'); | |
// ====> ウロボロスクラス | |
// 文字からフレーム配列を生成する | |
var anm = function(source) { | |
Array.prototype._SCALE_ = function(scale) { | |
var result = []; |
OlderNewer