From c0baefacf22330fb30e906c3a6976f8fb2bbeca5 Mon Sep 17 00:00:00 2001 From: nagomi Date: Fri, 20 Sep 2013 02:04:09 +0900 Subject: [PATCH] add parameter to the sidemenu --- .tags | 800 ++++ .tags_sorted_by_file | 800 ++++ data/chara1.edg | Bin 0 -> 5592 bytes data/chara1.png | Bin 0 -> 1409 bytes data/command.png | Bin 0 -> 1264 bytes data/layer/face_1.png | Bin 0 -> 1026 bytes data/layer/marisa_000.png | Bin 0 -> 1195 bytes data/layer/marisa_002.png | Bin 0 -> 1052 bytes data/layer/marisa_003.png | Bin 0 -> 882 bytes data/layer/marisa_004.png | Bin 0 -> 864 bytes data/map0.png | Bin 0 -> 6469 bytes data/marisa/face_normal.png | Bin 0 -> 1013 bytes data/marisa/face_tired.png | Bin 0 -> 1019 bytes data/marisa/hear.png | Bin 0 -> 1185 bytes data/marisa/params.json | 19 + data/object.png | Bin 0 -> 4917 bytes data/okazari.edg | Bin 0 -> 9309 bytes data/okazari.png | Bin 0 -> 1258 bytes data/shadow.png | Bin 0 -> 914 bytes data/yukkuri_base.png | Bin 0 -> 1041 bytes enchant.js | 8696 +++++++++++++++++++++++++++++++++++++++++++ init.js | 286 ++ main.js | 469 +++ mixing.enchant.js | 508 +++ net.js | 34 + siyou.txt | 92 + 26 files changed, 11704 insertions(+) create mode 100644 .tags create mode 100644 .tags_sorted_by_file create mode 100644 data/chara1.edg create mode 100644 data/chara1.png create mode 100644 data/command.png create mode 100644 data/layer/face_1.png create mode 100644 data/layer/marisa_000.png create mode 100644 data/layer/marisa_002.png create mode 100644 data/layer/marisa_003.png create mode 100644 data/layer/marisa_004.png create mode 100644 data/map0.png create mode 100644 data/marisa/face_normal.png create mode 100644 data/marisa/face_tired.png create mode 100644 data/marisa/hear.png create mode 100644 data/marisa/params.json create mode 100644 data/object.png create mode 100644 data/okazari.edg create mode 100644 data/okazari.png create mode 100644 data/shadow.png create mode 100644 data/yukkuri_base.png create mode 100644 enchant.js create mode 100644 init.js create mode 100644 main.js create mode 100644 mixing.enchant.js create mode 100644 net.js create mode 100644 siyou.txt diff --git a/.tags b/.tags new file mode 100644 index 0000000..2c3e743 --- /dev/null +++ b/.tags @@ -0,0 +1,800 @@ +! .\jkl-parsexml.js /^ if ( text.charAt(nextquote+1) != '"' ) {$/;" r +! .\jkl-parsexml.js /^ if ( typeof(key) != "string" ) continue;$/;" r +! .\jkl-parsexml.js /^ if ( typeof(key) != "string" ) continue;$/;" r +! .\jkl-parsexml.js /^ if ( typeof(this.req.overrideMimeType) != "undefined" && ! this.textmode ) {$/;" r +! .\jkl-parsexml.js /^ if ( typeof(this.req.send) != "undefined" ) {$/;" r +! .\jkl-parsexml.js /^ if ( typeof(this.req.setRequestHeader) != "undefined" ) {$/;" r +! .\jkl-parsexml.js /^ } else if ( typeof(this.req.load) != "undefined" ) {$/;" r +! .\jkl-parsexml.js /^\/\/ if ( typeof(this.req.setRequestHeader) != "undefined" ) {$/;" r +!_TAG_FILE_ENCODING cp932 // +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_JP_AUTHOR HIGASHI Hirohito /Twitter: @h_east/ +!_TAG_PROGRAM_JP_URL http://hp.vector.co.jp/authors/VA025040/ // +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.8J2 // +$/;" r +'Transform'] .\enchant.js /^ this._style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'matrix(1, 0, 0, 1, 0, 0)';$/;" r +'Transform'] .\enchant.js /^ this.style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'matrix(' +$/;" r +'Transform'] .\enchant.js /^ this._element.style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'scale(' + e.scale + ')';$/;" r +'TransformOrigin'] .\enchant.js /^ this._element.style[enchant.ENV.VENDOR_PREFIX + 'TransformOrigin'] = '0 0';$/;" r +'TransformOrigin'] .\enchant.js /^ this.style[enchant.ENV.VENDOR_PREFIX + 'TransformOrigin'] = '0px 0px';$/;" r +.ontouchstart .\ctrl.js /^ this.cmdIcons[value].ontouchstart = function(obj){$/;" r +// this.menuBg.image.context.fillStyle .\ctrl.js /^\/\/ this.menuBg.image.context.fillStyle = '#ff0000';$/;" r +10 .\enchant.js /^ * 10: function(){ 10フレーム経過した後に実行される関数 },$/;" r +20 .\enchant.js /^ * 20: function(){ 20フレーム経過した後に実行される関数 },$/;" r +30 .\enchant.js /^ * 30: function(){ 30フレーム経過した後に実行される関数 }$/;" r +ATouchEvent .\ctrl.js /^var ATouchEvent = enchant.Class.create({$/;" c +Action .\main.js /^ var Action = enchant.Class.create({$/;" c +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.Core}$/;" r +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Node}$/;" r +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene}$/;" r +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.Entity}$/;" r +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.Group}, {@link enchant.Scene}$/;" r +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.LoadingScene}$/;" r +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.Node}$/;" r +Auftretens .\enchant.js /^ * Objekt des Auftretens: {@link enchant.Scene}$/;" r +BACK_EASEIN .\enchant.js /^ BACK_EASEIN: function(t, b, c, d, s) {$/;" r +BACK_EASEINOUT .\enchant.js /^ BACK_EASEINOUT: function(t, b, c, d, s) {$/;" r +BACK_EASEOUT .\enchant.js /^ BACK_EASEOUT: function(t, b, c, d, s) {$/;" r +BOUNCE_EASEIN .\enchant.js /^ BOUNCE_EASEIN: function(t, b, c, d) {$/;" r +BOUNCE_EASEINOUT .\enchant.js /^ BOUNCE_EASEINOUT: function(t, b, c, d) {$/;" r +BOUNCE_EASEOUT .\enchant.js /^ BOUNCE_EASEOUT: function(t, b, c, d) {$/;" r +CANVAS_DRAWING_METHODS .\enchant.js /^ CANVAS_DRAWING_METHODS: [$/;" r +CIRC_EASEIN .\enchant.js /^ CIRC_EASEIN: function(t, b, c, d) {$/;" r +CIRC_EASEINOUT .\enchant.js /^ CIRC_EASEINOUT: function(t, b, c, d) {$/;" r +CIRC_EASEOUT .\enchant.js /^ CIRC_EASEOUT: function(t, b, c, d) {$/;" r +COLOR .\ctrl.js /^ var COLOR = "#ffffff";$/;" r +COLOR .\ctrl.js /^\/\/ var COLOR = "#ffffff";$/;" r +CUBIC_EASEIN .\enchant.js /^ CUBIC_EASEIN: function(t, b, c, d) {$/;" r +CUBIC_EASEINOUT .\enchant.js /^ CUBIC_EASEINOUT: function(t, b, c, d) {$/;" r +CUBIC_EASEOUT .\enchant.js /^ CUBIC_EASEOUT: function(t, b, c, d) {$/;" r +CommandIcon .\ctrl.js /^var CommandIcon = enchant.Class.create(enchant.Sprite,{$/;" c +Constructor .\enchant.js /^ var Constructor = function() {$/;" r +Constructor._collectionTarget .\enchant.js /^ Constructor._collectionTarget = [];$/;" r +Constructor.collection .\enchant.js /^ Constructor.collection = [];$/;" r +Constructor.prototype.initialize .\enchant.js /^ Constructor.prototype.initialize = function() {$/;" r +Ctrl .\ctrl.js /^var Ctrl = enchant.Class.create({$/;" c +EAction .\main.js /^var EAction = {$/;" r +ECommand .\main.js /^var ECommand = {$/;" r +EDirection .\main.js /^var EDirection = {$/;" r +EFieldPos .\main.js /^var EFieldPos = {$/;" r +ELASTIC_EASEIN .\enchant.js /^ ELASTIC_EASEIN: function(t, b, c, d, a, p) {$/;" r +ELASTIC_EASEINOUT .\enchant.js /^ ELASTIC_EASEINOUT: function(t, b, c, d, a, p) {$/;" r +ELASTIC_EASEOUT .\enchant.js /^ ELASTIC_EASEOUT: function(t, b, c, d, a, p) {$/;" r +EMenuPos .\main.js /^var EMenuPos = {$/;" r +EResPath .\main.js /^var EResPath = {$/;" r +EXPO_EASEIN .\enchant.js /^ EXPO_EASEIN: function(t, b, c, d) {$/;" r +EXPO_EASEINOUT .\enchant.js /^ EXPO_EASEINOUT: function(t, b, c, d) {$/;" r +EXPO_EASEOUT .\enchant.js /^ EXPO_EASEOUT: function(t, b, c, d) {$/;" r +FONT .\ctrl.js /^ var FONT = "18px 'Times New Roman'";$/;" r +FONT .\ctrl.js /^\/\/ var FONT = "14px 'Times New Roman'";$/;" r +Food .\main.js /^ var Food = enchant.Class.create(enchant.Sprite,{$/;" c +Function.prototype.bind .\enchant.js /^ Function.prototype.bind = function(thisObject) {$/;" r +Informationen .\mixing.enchant.js /^ * Weiterführende Informationen: {@link enchant.Class.mixClasses}, {@link enchant.Class.MixingRecipe.createFromClass}, $/;" r +JKL .\jkl-parsexml.js /^if ( typeof(JKL) == 'undefined' ) JKL = function() {};$/;" r +JKL.ParseXML .\jkl-parsexml.js /^JKL.ParseXML = function ( url, query, method ) {$/;" r +JKL.ParseXML.CSV .\jkl-parsexml.js /^JKL.ParseXML.CSV = function ( url, query, method ) {$/;" r +JKL.ParseXML.CSV.prototype.parseCSV .\jkl-parsexml.js /^JKL.ParseXML.CSV.prototype.parseCSV = function ( text ) {$/;" r +JKL.ParseXML.CSV.prototype.parseResponse .\jkl-parsexml.js /^JKL.ParseXML.CSV.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.CSVmap .\jkl-parsexml.js /^JKL.ParseXML.CSVmap = function ( url, query, method ) {$/;" r +JKL.ParseXML.CSVmap.prototype.parseResponse .\jkl-parsexml.js /^JKL.ParseXML.CSVmap.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.DOM .\jkl-parsexml.js /^JKL.ParseXML.DOM = function ( url, query, method ) {$/;" r +JKL.ParseXML.DOM.prototype.parseResponse .\jkl-parsexml.js /^JKL.ParseXML.DOM.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.HTTP .\jkl-parsexml.js /^JKL.ParseXML.HTTP = function( url, query, method, textmode ) {$/;" r +JKL.ParseXML.HTTP.ACTIVEX_XMLDOM .\jkl-parsexml.js /^JKL.ParseXML.HTTP.ACTIVEX_XMLDOM = "Microsoft.XMLDOM"; \/\/ Msxml2.DOMDocument.5.0$/;" r +JKL.ParseXML.HTTP.ACTIVEX_XMLHTTP .\jkl-parsexml.js /^JKL.ParseXML.HTTP.ACTIVEX_XMLHTTP = "Microsoft.XMLHTTP"; \/\/ Msxml2.XMLHTTP.3.0$/;" r +JKL.ParseXML.HTTP.EPOCH_TIMESTAMP .\jkl-parsexml.js /^JKL.ParseXML.HTTP.EPOCH_TIMESTAMP = "Thu, 01 Jun 1970 00:00:00 GMT"$/;" r +JKL.ParseXML.HTTP.REQUEST_TYPE .\jkl-parsexml.js /^JKL.ParseXML.HTTP.REQUEST_TYPE = "application\/x-www-form-urlencoded";$/;" r +JKL.ParseXML.HTTP.prototype.async .\jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.async = function( func ) {$/;" r +JKL.ParseXML.HTTP.prototype.checkResponse .\jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.checkResponse = function() {$/;" r +JKL.ParseXML.HTTP.prototype.documentElement .\jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.documentElement = function() {$/;" r +JKL.ParseXML.HTTP.prototype.load .\jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.load = function() {$/;" r +JKL.ParseXML.HTTP.prototype.responseText .\jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.responseText = function() {$/;" r +JKL.ParseXML.JSON .\jkl-parsexml.js /^JKL.ParseXML.JSON = function ( url, query, method ) {$/;" r +JKL.ParseXML.JSON.prototype.parseResponse .\jkl-parsexml.js /^JKL.ParseXML.JSON.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.LoadVars .\jkl-parsexml.js /^JKL.ParseXML.LoadVars = function ( url, query, method ) {$/;" r +JKL.ParseXML.LoadVars.prototype.parseResponse .\jkl-parsexml.js /^JKL.ParseXML.LoadVars.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.MAP_NODETYPE .\jkl-parsexml.js /^JKL.ParseXML.MAP_NODETYPE = [$/;" r +JKL.ParseXML.MIME_TYPE_XML .\jkl-parsexml.js /^JKL.ParseXML.MIME_TYPE_XML = "text\/xml";$/;" r +JKL.ParseXML.Text .\jkl-parsexml.js /^JKL.ParseXML.Text = function ( url, query, method ) {$/;" r +JKL.ParseXML.Text.prototype.parseResponse .\jkl-parsexml.js /^JKL.ParseXML.Text.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.VERSION .\jkl-parsexml.js /^JKL.ParseXML.VERSION = "0.22";$/;" r +JKL.ParseXML.prototype.addNode .\jkl-parsexml.js /^JKL.ParseXML.prototype.addNode = function ( hash, key, cnts, val ) {$/;" r +JKL.ParseXML.prototype.async .\jkl-parsexml.js /^JKL.ParseXML.prototype.async = function ( func, args ) {$/;" r +JKL.ParseXML.prototype.onerror .\jkl-parsexml.js /^JKL.ParseXML.prototype.onerror = function ( func, args ) {$/;" r +JKL.ParseXML.prototype.parse .\jkl-parsexml.js /^JKL.ParseXML.prototype.parse = function () {$/;" r +JKL.ParseXML.prototype.parseDocument .\jkl-parsexml.js /^JKL.ParseXML.prototype.parseDocument = function ( root ) {$/;" r +JKL.ParseXML.prototype.parseElement .\jkl-parsexml.js /^JKL.ParseXML.prototype.parseElement = function ( elem ) {$/;" r +JKL.ParseXML.prototype.parseResponse .\jkl-parsexml.js /^JKL.ParseXML.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.prototype.setOutputArray .\jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArray = function ( mode ) {$/;" r +JKL.ParseXML.prototype.setOutputArrayAll .\jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayAll = function () {$/;" r +JKL.ParseXML.prototype.setOutputArrayAuto .\jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayAuto = function () {$/;" r +JKL.ParseXML.prototype.setOutputArrayElements .\jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayElements = function ( list ) {$/;" r +JKL.ParseXML.prototype.setOutputArrayNever .\jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayNever = function () {$/;" r +KEY_BIND_TABLE .\enchant.js /^ KEY_BIND_TABLE: {$/;" r +LINEAR .\enchant.js /^ LINEAR: function(t, b, c, d) {$/;" r +MangIcon .\ctrl.js /^var MangIcon = enchant.Class.create({$/;" c +MangLabel .\ctrl.js /^\/\/ var MangLabel = enchant.Class.create({$/;" c +MangLabel .\ctrl.js /^var MangLabel = enchant.Class.create({$/;" c +MangTouch .\ctrl.js /^var MangTouch = enchant.Class.create({$/;" c +Marisa .\main.js /^ var Marisa = enchant.Class.create(Yukkuri,{$/;" c +Nop .\enchant.js /^ var Nop = function() {$/;" r +Object.create .\enchant.js /^ Object.create = function(prototype, descs) {$/;" r +Object.defineProperties .\enchant.js /^ Object.defineProperties = function(obj, descs) {$/;" r +Object.defineProperty .\enchant.js /^ Object.defineProperty = function(obj, prop, desc) {$/;" r +Object.getPrototypeOf .\enchant.js /^ Object.getPrototypeOf = function(obj) {$/;" r +Okazari .\main.js /^ var Okazari = enchant.Class.create(enchant.Sprite,{$/;" c +PREVENT_DEFAULT_KEY_CODES .\enchant.js /^ PREVENT_DEFAULT_KEY_CODES: [37, 38, 39, 40, 32],$/;" r +Player .\main.js /^ var Player = enchant.Class.create(Marisa,{$/;" c +QUAD_EASEIN .\enchant.js /^ QUAD_EASEIN: function(t, b, c, d) {$/;" r +QUAD_EASEINOUT .\enchant.js /^ QUAD_EASEINOUT: function(t, b, c, d) {$/;" r +QUAD_EASEOUT .\enchant.js /^ QUAD_EASEOUT: function(t, b, c, d) {$/;" r +QUART_EASEIN .\enchant.js /^ QUART_EASEIN: function(t, b, c, d) {$/;" r +QUART_EASEINOUT .\enchant.js /^ QUART_EASEINOUT: function(t, b, c, d) {$/;" r +QUART_EASEOUT .\enchant.js /^ QUART_EASEOUT: function(t, b, c, d) {$/;" r +QUINT_EASEIN .\enchant.js /^ QUINT_EASEIN: function(t, b, c, d) {$/;" r +QUINT_EASEINOUT .\enchant.js /^ QUINT_EASEINOUT: function(t, b, c, d) {$/;" r +QUINT_EASEOUT .\enchant.js /^ QUINT_EASEOUT: function(t, b, c, d) {$/;" r +SIN_EASEIN .\enchant.js /^ SIN_EASEIN: function(t, b, c, d) {$/;" r +SIN_EASEINOUT .\enchant.js /^ SIN_EASEINOUT: function(t, b, c, d) {$/;" r +SIN_EASEOUT .\enchant.js /^ SIN_EASEOUT: function(t, b, c, d) {$/;" r +SWING .\enchant.js /^ SWING: function(t, b, c, d) {$/;" r +TEXT .\ctrl.js /^ var TEXT = "うんうん";$/;" r +TEXT .\ctrl.js /^ var TEXT = "ゆっくり";$/;" r +TEXT .\ctrl.js /^ var TEXT = "ストレス";$/;" r +TEXT .\ctrl.js /^ var TEXT = "眠気";$/;" r +TEXT .\ctrl.js /^ var TEXT = "空腹";$/;" r +TEXT .\ctrl.js /^\/\/ var TEXT = "ゆっくり";$/;" r +TEXT .\ctrl.js /^\/\/ var TEXT = "空腹";$/;" r +TTweet .\class.js /^TTweet = enchant.Class.create(enchant.Sprite, {$/;" c +USE_DEFAULT_EVENT_TAGS .\enchant.js /^ USE_DEFAULT_EVENT_TAGS: ['input', 'textarea', 'select', 'area'],$/;" r +WorldCursorTouchEvent .\ctrl.js /^var WorldCursorTouchEvent = enchant.Class.create(ATouchEvent,{$/;" c +WorldTargetTouchEvent .\ctrl.js /^var WorldTargetTouchEvent = enchant.Class.create(ATouchEvent,{$/;" c +Yukkuri .\main.js /^ var Yukkuri = enchant.Class.create(enchant.Sprite,{$/;" c +__onchildadded .\enchant.js /^ var __onchildadded = function(e) {$/;" r +__onchildremoved .\enchant.js /^ var __onchildremoved = function(e) {$/;" r +_activateTimeline .\enchant.js /^ _activateTimeline: function() {$/;" r +_add .\enchant.js /^ _add: function(queue) {$/;" r +_addSelfToCollection .\enchant.js /^ _addSelfToCollection: function() {$/;" r +_attachEvent .\enchant.js /^ _attachEvent: function() {$/;" r +_callTick .\enchant.js /^ _callTick: function(time) {$/;" r +_callback .\enchant.js /^ var _callback = function(e) {$/;" r +_collectizeConstructor .\enchant.js /^var _collectizeConstructor = function(Constructor) {$/;" r +_collisionData .\init.js /^_collisionData = [$/;" r +_css .\enchant.js /^ _css: { value: 'url(' + src + ')' },$/;" r +_deactivateTimeline .\enchant.js /^ _deactivateTimeline: function() {$/;" r +_decodeDetectColor .\enchant.js /^ _decodeDetectColor: function(color) {$/;" r +_detachEvent .\enchant.js /^ _detachEvent: function() {$/;" r +_determineEventTarget .\enchant.js /^ _determineEventTarget: function() {$/;" r +_determineEventTarget .\enchant.js /^ _determineEventTarget: function(e) {$/;" r +_dirty .\enchant.js /^ _dirty: {$/;" r +_dispatchCoreResizeEvent .\enchant.js /^ _dispatchCoreResizeEvent: function() {$/;" r +_element .\enchant.js /^ _element: { value: this._element.cloneNode(false) },$/;" r +_element .\enchant.js /^ _element: { value: image }$/;" r +_getColor .\enchant.js /^ _getColor: function(n) {$/;" r +_getEntityByPosition .\enchant.js /^ _getEntityByPosition: function(x, y) {$/;" r +_initPosition .\enchant.js /^ _initPosition: function(pageX, pageY) {$/;" r +_intersectBetweenClassAndClass .\enchant.js /^var _intersectBetweenClassAndClass = function(Class1, Class2) {$/;" r +_intersectBetweenClassAndInstance .\enchant.js /^var _intersectBetweenClassAndInstance = function(Class, instance) {$/;" r +_intersectOne .\enchant.js /^ _intersectOne: function(other) {$/;" r +_intersectStrictBetweenClassAndClass .\enchant.js /^var _intersectStrictBetweenClassAndClass = function(Class1, Class2) {$/;" r +_intersectStrictBetweenClassAndInstance .\enchant.js /^var _intersectStrictBetweenClassAndInstance = function(Class, instance) {$/;" r +_intersectStrictOne .\enchant.js /^ _intersectStrictOne: function(other) {$/;" r +_loadArr .\main.js /^ var _loadArr = [];$/;" r +_mapData .\init.js /^_mapData = [$/;" r +_onchildadded .\enchant.js /^ _onchildadded: function(e) {$/;" r +_onchildremoved .\enchant.js /^ _onchildremoved: function(e) {$/;" r +_oncoreresize .\enchant.js /^ _oncoreresize: function(e) {$/;" r +_oncoreresize .\enchant.js /^ _oncoreresize: function(e) {$/;" r +_onenter .\enchant.js /^ _onenter: function() {$/;" r +_onerror .\enchant.js /^ var _onerror = function(e) {$/;" r +_onexit .\enchant.js /^ _onexit: function() {$/;" r +_onexitframe .\enchant.js /^ _onexitframe: function() {$/;" r +_register .\enchant.js /^ _register: function(element, nextElement) {$/;" r +_removeSelfFromCollection .\enchant.js /^ _removeSelfFromCollection: function() {$/;" r +_rendering .\enchant.js /^ _rendering: function(node, e, inheritMat) {$/;" r +_requestNextFrame .\enchant.js /^ _requestNextFrame: function(delay) {$/;" r +_requestPreload .\enchant.js /^ _requestPreload: function() {$/;" r +_setFrame .\enchant.js /^ _setFrame: function(frame) {$/;" r +_startRendering .\enchant.js /^ _startRendering: function() {$/;" r +_staticIntersect .\enchant.js /^var _staticIntersect = function(other) {$/;" r +_staticIntersectStrict .\enchant.js /^var _staticIntersectStrict = function(other) {$/;" r +_stopRendering .\enchant.js /^ _stopRendering: function() {$/;" r +_tick .\enchant.js /^ _tick: function(time) {$/;" r +_updateCoordinate .\enchant.js /^ _updateCoordinate: function() {$/;" r +a .\enchant.js /^ a = [];$/;" r +act .\main.js /^ act : function(){$/;" r +act .\main.js /^ act: function(){$/;" r +action .\enchant.js /^ action: function(params) {$/;" r +actualFps .\enchant.js /^ actualFps: {$/;" r +add .\enchant.js /^ add: function(action) {$/;" r +add .\mixing.enchant.js /^ * add : function(value) {$/;" r +addChild .\enchant.js /^ addChild: function(node) {$/;" r +addEventListener .\enchant.js /^ addEventListener: function(type, listener) {$/;" r +addLayer .\enchant.js /^ addLayer: function(type, i) {$/;" r +addManager .\enchant.js /^ addManager: function(childManager, nextManager) {$/;" r +also .\mixing.enchant.js /^ *

Both classes will not be modified.<\/p> See also: {@link enchant.Class.MixingRecipe}$/;" r +also .\mixing.enchant.js /^ * The target class is not modified directly.
See also: {@link enchant.Class.MixingRecipe}.$/;" r +and .\enchant.js /^ and: function() {$/;" r +animation .\main.js /^ animation: function(){$/;" r +attachDetectColor .\enchant.js /^ attachDetectColor: function(sprite) {$/;" r +auch .\mixing.enchant.js /^ *

Siehe auch: {@link enchant.Class.mixClasses}, {@link enchant.Class.mixClassesFromRecipe} und {@link enchant.Class.applyMixingRecipe}.<\/p>$/;" r +auch .\mixing.enchant.js /^ *

Beide Klassen werden nicht verändert.<\/p> Siehe auch: {@link enchant.Class.MixingRecipe}$/;" r +auch .\mixing.enchant.js /^ * Die Zielklasse wird nicht modifiziert.
Siehe auch: {@link enchant.Class.MixingRecipe}.$/;" r +audio.onerror .\enchant.js /^ audio.onerror = function() {$/;" r +b1 .\enchant.js /^ b1 = [ lbx1 - rbx1, lby1 - rby1 ],$/;" r +b2 .\enchant.js /^ b2 = [ lbx2 - rbx2, lby2 - rby2 ],$/;" r +backgroundColor .\enchant.js /^ backgroundColor: {$/;" r +bound .\enchant.js /^ var bound = function() {$/;" r +buf .\enchant.js /^ buf = '';$/;" r +by .\enchant.js /^ * A mouse event counts as a touch event. Issued by: {@link enchant.Node}$/;" r +by .\enchant.js /^ * Dispatched each time an image is preloaded. Issued by: {@link enchant.LoadingScene}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Core}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Core}, {@link enchant.Node}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Core}, {@link enchant.Scene}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Core}, {@link enchant.Surface}, {@link enchant.WebAudioSound}, {@link enchant.DOMSound}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Entity}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Group}, {@link enchant.Scene}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Node}$/;" r +by .\enchant.js /^ * Issued by: {@link enchant.Scene}$/;" r +call .\enchant.js /^ call: function(arg) {$/;" r +canvas.style.position .\enchant.js /^ canvas.style.position = 'absolute';$/;" r +changeFace .\main.js /^ changeFace: function(erespath){$/;" r +checkTile .\enchant.js /^ checkTile: function(x, y) {$/;" r +check_func .\jkl-parsexml.js /^ var check_func = function () {$/;" r +clear .\class.js /^ clear : function() {$/;" r +clear .\enchant.js /^ clear: function() {$/;" r +clearEventListener .\enchant.js /^ clearEventListener: function(type) {$/;" r +clone .\enchant.js /^ clone: function() {$/;" r +cnt .\jkl-parsexml.js /^ var cnt = {};$/;" r +color .\enchant.js /^ color: {$/;" r +context .\enchant.js /^ context: { value: null },$/;" r +core._touchEventTarget .\enchant.js /^ core._touchEventTarget = {};$/;" r +core.onload .\enchant.js /^ * core.onload = function() {$/;" r +core.onload .\enchant.js /^ * core.onload = function() {$/;" r +createFromPrototype .\mixing.enchant.js /^ var createFromPrototype = function(decorate,override,properties,source,onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) {$/;" r +createFromPrototypeNonRecursive .\mixing.enchant.js /^ var createFromPrototypeNonRecursive = function(decorate, override, properties, source, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) {$/;" r +ctx.textBaseline .\enchant.js /^ ctx.textBaseline = 'top';$/;" r +cue .\enchant.js /^ cue: function(cue) {$/;" r +currentTime .\enchant.js /^ currentTime: {$/;" r +currentTime .\enchant.js /^ currentTime: {$/;" r +cvsRender .\enchant.js /^ cvsRender: function(ctx) {$/;" r +data .\jkl-parsexml.js /^ var data = [];$/;" r +dead .\main.js /^ dead : function(){$/;" r +debug .\enchant.js /^ debug: function() {$/;" r +debugColor .\enchant.js /^ debugColor: {$/;" r +decorate .\mixing.enchant.js /^ var decorate = {};$/;" r +decorateFunctionFactory .\mixing.enchant.js /^ var decorateFunctionFactory = function(srcFunction, currentFunctionName) {$/;" r +delay .\enchant.js /^ delay: function(time) {$/;" r +dest .\enchant.js /^ var dest = [];$/;" r +destruct .\main.js /^ destruct: function(){$/;" r +detachDetectColor .\enchant.js /^ detachDetectColor: function(sprite) {$/;" r +detectRender .\enchant.js /^ detectRender: function(ctx) {$/;" r +detectRender .\enchant.js /^ detectRender: function(ctx, node) {$/;" r +dirs1 .\enchant.js /^ dirs1 = [ t1, r1, b1, l1 ];$/;" r +dirs2 .\enchant.js /^ dirs2 = [ t2, r2, b2, l2 ];$/;" r +disableCollection .\enchant.js /^ disableCollection: function() {$/;" r +dispatchEvent .\enchant.js /^ dispatchEvent: function(e) {$/;" r +div.style.position .\enchant.js /^ div.style.position = 'absolute';$/;" r +div.style.whiteSpace .\enchant.js /^ div.style.whiteSpace = 'noWrap';$/;" r +doAll .\enchant.js /^ doAll: function(children) {$/;" r +domRender .\enchant.js /^ domRender: function() {$/;" r +domRender .\enchant.js /^ domRender: function(element) {$/;" r +draw .\ctrl.js /^ draw: function(yukkuriObj){$/;" r +draw .\ctrl.js /^ draw: function(yukkuriObj){$/;" r +draw .\ctrl.js /^\/\/ draw: function(){$/;" r +draw .\enchant.js /^ draw: function(image) {$/;" r +dulation .\enchant.js /^ dulation: {$/;" r +duration .\enchant.js /^ duration: { value: this.duration }$/;" r +e.message .\enchant.js /^ e.message = 'Cannot load an asset: ' + audio.src;$/;" r +e.message .\enchant.js /^ e.message = 'Cannot load an asset: ' + image.src;$/;" r +e.message .\enchant.js /^ e.message = 'Cannot load an asset: ' + src;$/;" r +embed.allowscriptaccess .\enchant.js /^ embed.allowscriptaccess = 'always';$/;" r +embed.src .\enchant.js /^ embed.src = 'sound.swf?id=' + id + '&src=' + src;$/;" r +embed.style.left .\enchant.js /^ embed.style.left = '-1px';$/;" r +embed.style.position .\enchant.js /^ embed.style.position = 'absolute';$/;" r +enableCollection .\enchant.js /^ enableCollection: function() {$/;" r +enchant .\enchant.js /^var enchant = function(modules) {$/;" r +enchant.Action .\enchant.js /^enchant.Action = enchant.Class.create(enchant.ActionEventTarget, {$/;" c +enchant.ActionEventTarget .\enchant.js /^enchant.ActionEventTarget = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.CanvasLayer .\enchant.js /^enchant.CanvasLayer = enchant.Class.create(enchant.Group, {$/;" c +enchant.CanvasLayer._attachCache .\enchant.js /^enchant.CanvasLayer._attachCache = function(node, layer, onchildadded, onchildremoved) {$/;" r +enchant.CanvasLayer._detachCache .\enchant.js /^enchant.CanvasLayer._detachCache = function(node, layer, onchildadded, onchildremoved) {$/;" r +enchant.CanvasRenderer .\enchant.js /^enchant.CanvasRenderer = enchant.Class.create({$/;" c +enchant.CanvasScene .\enchant.js /^enchant.CanvasScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.Class .\enchant.js /^enchant.Class = function(superclass, definition) {$/;" r +enchant.Class.MixingRecipe .\mixing.enchant.js /^ enchant.Class.MixingRecipe = enchant.Class.create({$/;" c +enchant.Class.MixingRecipe.createFromClass .\mixing.enchant.js /^ enchant.Class.MixingRecipe.createFromClass = function(sourceClass, onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) {$/;" r +enchant.Class.applyMixingRecipe .\mixing.enchant.js /^ enchant.Class.applyMixingRecipe = function(target, source) {$/;" r +enchant.Class.create .\enchant.js /^enchant.Class.create = function(superclass, definition) {$/;" r +enchant.Class.getInheritanceTree .\enchant.js /^enchant.Class.getInheritanceTree = function(Constructor) {$/;" r +enchant.Class.mixClasses .\mixing.enchant.js /^ enchant.Class.mixClasses = function(firstClass, secondClass, useOnlyOwnPropertiesForSecondClass, initializeMethod) {$/;" r +enchant.Class.mixClassesFromRecipe .\mixing.enchant.js /^ enchant.Class.mixClassesFromRecipe = function(firstClass, secondClass, recipe, initializeMethod) {$/;" r +enchant.Core .\enchant.js /^ enchant.Core = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.Core._loadFuncs .\enchant.js /^ enchant.Core._loadFuncs = {};$/;" r +enchant.Core.findExt .\enchant.js /^ enchant.Core.findExt = function(path) {$/;" r +enchant.DOMScene .\enchant.js /^enchant.DOMScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.DOMSound .\enchant.js /^enchant.DOMSound = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.DOMSound.load .\enchant.js /^enchant.DOMSound.load = function(src, type, callback, onerror) {$/;" r +enchant.Deferred .\enchant.js /^ enchant.Deferred = enchant.Class.create({$/;" c +enchant.Deferred._insert .\enchant.js /^ enchant.Deferred._insert = function(queue, ins) {$/;" r +enchant.Deferred.next .\enchant.js /^ enchant.Deferred.next = function(func) {$/;" r +enchant.Deferred.parallel .\enchant.js /^ enchant.Deferred.parallel = function(arg) {$/;" r +enchant.DetectColorManager .\enchant.js /^enchant.DetectColorManager = enchant.Class.create({$/;" c +enchant.DomLayer .\enchant.js /^enchant.DomLayer = enchant.Class.create(enchant.Group, {$/;" c +enchant.DomLayer._attachDomManager .\enchant.js /^enchant.DomLayer._attachDomManager = function(node, onchildadded, onchildremoved) {$/;" r +enchant.DomLayer._detachDomManager .\enchant.js /^enchant.DomLayer._detachDomManager = function(node, onchildadded, onchildremoved) {$/;" r +enchant.DomManager .\enchant.js /^enchant.DomManager = enchant.Class.create({$/;" c +enchant.DomlessManager .\enchant.js /^enchant.DomlessManager = enchant.Class.create({$/;" c +enchant.ENV .\enchant.js /^enchant.ENV = {$/;" r +enchant.ENV.KEY_BIND_TABLE .\enchant.js /^ enchant.ENV.KEY_BIND_TABLE = {};$/;" r +enchant.ENV.KEY_BIND_TABLE .\enchant.js /^ * enchant.ENV.KEY_BIND_TABLE = {$/;" r +enchant.Easing .\enchant.js /^enchant.Easing = {$/;" r +enchant.Entity .\enchant.js /^enchant.Entity = enchant.Class.create(enchant.Node, {$/;" c +enchant.Entity._inherited .\enchant.js /^enchant.Entity._inherited = function(subclass) {$/;" r +enchant.Event .\enchant.js /^enchant.Event = enchant.Class.create({$/;" c +enchant.Event.ACTION_ADDED .\enchant.js /^enchant.Event.ACTION_ADDED = "actionadded";$/;" r +enchant.Event.ACTION_END .\enchant.js /^enchant.Event.ACTION_END = "actionend";$/;" r +enchant.Event.ACTION_REMOVED .\enchant.js /^enchant.Event.ACTION_REMOVED = "actionremoved";$/;" r +enchant.Event.ACTION_START .\enchant.js /^enchant.Event.ACTION_START = "actionstart";$/;" r +enchant.Event.ACTION_TICK .\enchant.js /^enchant.Event.ACTION_TICK = "actiontick";$/;" r +enchant.Event.ADDED .\enchant.js /^enchant.Event.ADDED = 'added';$/;" r +enchant.Event.ADDED_TO_SCENE .\enchant.js /^enchant.Event.ADDED_TO_SCENE = 'addedtoscene';$/;" r +enchant.Event.ADDED_TO_TIMELINE .\enchant.js /^enchant.Event.ADDED_TO_TIMELINE = "addedtotimeline";$/;" r +enchant.Event.A_BUTTON_DOWN .\enchant.js /^enchant.Event.A_BUTTON_DOWN = 'abuttondown';$/;" r +enchant.Event.A_BUTTON_UP .\enchant.js /^enchant.Event.A_BUTTON_UP = 'abuttonup';$/;" r +enchant.Event.B_BUTTON_DOWN .\enchant.js /^enchant.Event.B_BUTTON_DOWN = 'bbuttondown';$/;" r +enchant.Event.B_BUTTON_UP .\enchant.js /^enchant.Event.B_BUTTON_UP = 'bbuttonup';$/;" r +enchant.Event.CHILD_ADDED .\enchant.js /^enchant.Event.CHILD_ADDED = 'childadded';$/;" r +enchant.Event.CHILD_REMOVED .\enchant.js /^enchant.Event.CHILD_REMOVED = 'childremoved';$/;" r +enchant.Event.CORE_RESIZE .\enchant.js /^enchant.Event.CORE_RESIZE = 'coreresize';$/;" r +enchant.Event.DOWN_BUTTON_DOWN .\enchant.js /^enchant.Event.DOWN_BUTTON_DOWN = 'downbuttondown';$/;" r +enchant.Event.DOWN_BUTTON_UP .\enchant.js /^enchant.Event.DOWN_BUTTON_UP = 'downbuttonup';$/;" r +enchant.Event.ENTER .\enchant.js /^enchant.Event.ENTER = 'enter';$/;" r +enchant.Event.ENTER_FRAME .\enchant.js /^enchant.Event.ENTER_FRAME = 'enterframe';$/;" r +enchant.Event.ERROR .\enchant.js /^enchant.Event.ERROR = 'error';$/;" r +enchant.Event.EXIT .\enchant.js /^enchant.Event.EXIT = 'exit';$/;" r +enchant.Event.EXIT_FRAME .\enchant.js /^enchant.Event.EXIT_FRAME = 'exitframe';$/;" r +enchant.Event.INPUT_CHANGE .\enchant.js /^enchant.Event.INPUT_CHANGE = 'inputchange';$/;" r +enchant.Event.INPUT_END .\enchant.js /^enchant.Event.INPUT_END = 'inputend';$/;" r +enchant.Event.INPUT_START .\enchant.js /^enchant.Event.INPUT_START = 'inputstart';$/;" r +enchant.Event.LEFT_BUTTON_DOWN .\enchant.js /^enchant.Event.LEFT_BUTTON_DOWN = 'leftbuttondown';$/;" r +enchant.Event.LEFT_BUTTON_UP .\enchant.js /^enchant.Event.LEFT_BUTTON_UP = 'leftbuttonup';$/;" r +enchant.Event.LOAD .\enchant.js /^enchant.Event.LOAD = 'load';$/;" r +enchant.Event.PROGRESS .\enchant.js /^enchant.Event.PROGRESS = 'progress';$/;" r +enchant.Event.REMOVED .\enchant.js /^enchant.Event.REMOVED = 'removed';$/;" r +enchant.Event.REMOVED_FROM_SCENE .\enchant.js /^enchant.Event.REMOVED_FROM_SCENE = 'removedfromscene';$/;" r +enchant.Event.REMOVED_FROM_TIMELINE .\enchant.js /^enchant.Event.REMOVED_FROM_TIMELINE = "removedfromtimeline";$/;" r +enchant.Event.RENDER .\enchant.js /^enchant.Event.RENDER = 'render';$/;" r +enchant.Event.RIGHT_BUTTON_DOWN .\enchant.js /^enchant.Event.RIGHT_BUTTON_DOWN = 'rightbuttondown';$/;" r +enchant.Event.RIGHT_BUTTON_UP .\enchant.js /^enchant.Event.RIGHT_BUTTON_UP = 'rightbuttonup';$/;" r +enchant.Event.TOUCH_END .\enchant.js /^enchant.Event.TOUCH_END = 'touchend';$/;" r +enchant.Event.TOUCH_MOVE .\enchant.js /^enchant.Event.TOUCH_MOVE = 'touchmove';$/;" r +enchant.Event.TOUCH_START .\enchant.js /^enchant.Event.TOUCH_START = 'touchstart';$/;" r +enchant.Event.UP_BUTTON_DOWN .\enchant.js /^enchant.Event.UP_BUTTON_DOWN = 'upbuttondown';$/;" r +enchant.Event.UP_BUTTON_UP .\enchant.js /^enchant.Event.UP_BUTTON_UP = 'upbuttonup';$/;" r +enchant.EventTarget .\enchant.js /^enchant.EventTarget = enchant.Class.create({$/;" c +enchant.Group .\enchant.js /^enchant.Group = enchant.Class.create(enchant.Node, {$/;" c +enchant.Label .\enchant.js /^enchant.Label = enchant.Class.create(enchant.Entity, {$/;" c +enchant.LoadingScene .\enchant.js /^ * enchant.LoadingScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.LoadingScene .\enchant.js /^enchant.LoadingScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.Map .\enchant.js /^enchant.Map = enchant.Class.create(enchant.Entity, {$/;" c +enchant.Matrix .\enchant.js /^enchant.Matrix = enchant.Class.create({$/;" c +enchant.Node .\enchant.js /^enchant.Node = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.ParallelAction .\enchant.js /^enchant.ParallelAction = enchant.Class.create(enchant.Action, {$/;" c +enchant.Scene .\enchant.js /^enchant.Scene = enchant.Class.create(enchant.Group, {$/;" c +enchant.Sprite .\enchant.js /^enchant.Sprite = enchant.Class.create(enchant.Entity, {$/;" c +enchant.Surface .\enchant.js /^enchant.Surface = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.Surface._getPattern .\enchant.js /^enchant.Surface._getPattern = function(surface, force) {$/;" r +enchant.Surface.load .\enchant.js /^enchant.Surface.load = function(src, callback, onerror) {$/;" r +enchant.Timeline .\enchant.js /^enchant.Timeline = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.Tween .\enchant.js /^enchant.Tween = enchant.Class.create(enchant.Action, {$/;" c +enchant.WebAudioSound .\enchant.js /^enchant.WebAudioSound = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.WebAudioSound.load .\enchant.js /^enchant.WebAudioSound.load = function(src, type, callback, onerror) {$/;" r +error .\enchant.js /^ error: function(func) {$/;" r +excepted .\enchant.js /^ var excepted = ["frame", "time", "callback", "onactiontick", "onactionstart", "onactionend"];$/;" r +exec .\enchant.js /^ exec: function(func) {$/;" r +fadeIn .\enchant.js /^ fadeIn: function(time, easing) {$/;" r +fadeOut .\enchant.js /^ fadeOut: function(time, easing) {$/;" r +fadeTo .\enchant.js /^ fadeTo: function(opacity, time, easing) {$/;" r +fail .\enchant.js /^ fail: function(arg) {$/;" r +fall .\enchant.js /^ * fall: function() { ... }$/;" r +fieldBg.image.context.fillStyle .\main.js /^ \/\/ fieldBg.image.context.fillStyle = '#ff0000';$/;" r +fillStyle .\class.js /^ fillStyle = 'black';$/;" r +fillStyle .\class.js /^ fillStyle = 'white';$/;" r +fillStyle .\class.js /^ fillStyle = 'black';$/;" r +fillTextLine .\class.js /^ fillTextLine : function(text, x, y) {$/;" r +firstChild .\enchant.js /^ firstChild: {$/;" r +font .\enchant.js /^ font: {$/;" r +frame .\enchant.js /^ frame: {$/;" r +game.onload .\main.js /^ game.onload = function(){$/;" r +get .\ctrl.js /^ get: function(commandIndex){$/;" r +get .\ctrl.js /^ get: function(ecmd){$/;" r +get .\enchant.js /^ get: function() {$/;" r +get .\enchant.js /^ get: function() {$/;" r +get .\enchant.js /^ get: function() {$/;" r +get .\mixing.enchant.js /^ * get: function() {$/;" r +get .\mixing.enchant.js /^ * get: function() {$/;" r +getBoundingRect .\enchant.js /^ getBoundingRect: function() {$/;" r +getConstructor .\enchant.js /^ getConstructor: function() {$/;" r +getCurrentCommand .\ctrl.js /^ getCurrentCommand: function(){$/;" r +getDomElement .\enchant.js /^ getDomElement: function() {$/;" r +getDomElementAsNext .\enchant.js /^ getDomElementAsNext: function() {$/;" r +getElapsedTime .\enchant.js /^ getElapsedTime: function() {$/;" r +getFunctionParams .\mixing.enchant.js /^ var getFunctionParams = function(methodString) {$/;" r +getMetrics .\enchant.js /^ getMetrics: function(text) {$/;" r +getNextManager .\enchant.js /^ getNextManager: function(manager) {$/;" r +getOrientedBoundingRect .\enchant.js /^ getOrientedBoundingRect: function() {$/;" r +getPixel .\enchant.js /^ getPixel: function(x, y) {$/;" r +getSpriteByColor .\enchant.js /^ getSpriteByColor: function(color) {$/;" r +getTime .\enchant.js /^ getTime: function() {$/;" r +hash .\jkl-parsexml.js /^ var hash = {};$/;" r +hash .\jkl-parsexml.js /^ var hash = {};$/;" r +hash .\jkl-parsexml.js /^ var hash = {};$/;" r +hash[list[i]] .\jkl-parsexml.js /^ hash[list[i]] = "";$/;" r +height .\enchant.js /^ height: {$/;" r +height .\enchant.js /^ height: {$/;" r +hide .\enchant.js /^ hide: function() {$/;" r +hitTest .\enchant.js /^ hitTest: function(x, y) {$/;" r +id .\enchant.js /^ var id = 'enchant-audio' + enchant.Core.instance._soundID++;$/;" r +id .\enchant.js /^ var id = 'enchant-surface' + core._surfaceID++;$/;" r +image .\enchant.js /^ image: {$/;" r +image.context.fillStyle .\enchant.js /^ image.context.fillStyle = '#fff';$/;" r +image.context.fillStyle .\enchant.js /^ image.context.fillStyle = '#000';$/;" r +image.context.fillStyle .\enchant.js /^ image.context.fillStyle = '#fff';$/;" r +image.onerror .\enchant.js /^ image.onerror = function() {$/;" r +image.onload .\enchant.js /^ image.onload = function() {$/;" r +info.color .\main.js /^ \/\/ info.color = "#ffffff";$/;" r +info.font .\main.js /^ \/\/ info.font = "14px 'Times New Roman'";$/;" r +inheritMat .\enchant.js /^ inheritMat = [ 1, 0, 0, 1, 0, 0 ];$/;" r +init .\ctrl.js /^ init: function(){$/;" r +init .\ctrl.js /^ init : function (game){$/;" r +initialize .\class.js /^ initialize : function(w, h) {$/;" r +initialize .\ctrl.js /^ \/\/ initialize: function (ctl){$/;" r +initialize .\ctrl.js /^ initialize: function (){$/;" r +initialize .\ctrl.js /^ initialize: function (ctl){$/;" r +initialize .\ctrl.js /^ initialize: function (ctl, menuBg){$/;" r +initialize .\ctrl.js /^ initialize: function (x, y, ecmd, index){$/;" r +initialize .\ctrl.js /^\/\/ initialize: function (ctl, menuBg){$/;" r +initialize .\enchant.js /^ initialize: function() {$/;" r +initialize .\enchant.js /^ initialize: function(width, height) {$/;" r +initialize .\enchant.js /^ * initialize: function(){$/;" r +initialize .\enchant.js /^ initialize: function() {$/;" r +initialize .\enchant.js /^ initialize: function(node) {$/;" r +initialize .\enchant.js /^ initialize: function(node, elementDefinition) {$/;" r +initialize .\enchant.js /^ initialize: function(param) {$/;" r +initialize .\enchant.js /^ initialize: function(params) {$/;" r +initialize .\enchant.js /^ initialize: function(reso, max) {$/;" r +initialize .\enchant.js /^ initialize: function(text) {$/;" r +initialize .\enchant.js /^ initialize: function(tileWidth, tileHeight) {$/;" r +initialize .\enchant.js /^ initialize: function(type) {$/;" r +initialize .\enchant.js /^ initialize: function(width, height) {$/;" r +initialize .\enchant.js /^ * initialize: function(radius) { ... }, \/\/ Method definition.$/;" r +initialize .\enchant.js /^ * initialize: function(radius) { ... }, \/\/ Methodendefinitionen$/;" r +initialize .\enchant.js /^ * initialize: function(radius) { ... }, \/\/ メソッド定義$/;" r +initialize .\enchant.js /^ * initialize: function(radius) { \/\/ Overwrites constructor$/;" r +initialize .\enchant.js /^ * initialize: function(radius) { \/\/ überschreibt den Standardkonstruktor.$/;" r +initialize .\enchant.js /^ * initialize: function(radius) { \/\/ コンストラクタを上書きする +initialize .\main.js /^ initialize: function (type, x, y){$/;" r +initialize .\main.js /^ initialize: function (yukkuri){$/;" r +initialize .\main.js /^ initialize: function(){$/;" r +initialize .\main.js /^ initialize: function(x, y){$/;" r +initialize .\mixing.enchant.js /^ initialize : function(decorateMethods, overrideMethods, properties) {$/;" r +initializeMethod .\mixing.enchant.js /^ initializeMethod = function() {$/;" r +insertBefore .\enchant.js /^ insertBefore: function(node, reference) {$/;" r +intersect .\enchant.js /^ intersect: function(other) {$/;" r +intersectStrict .\enchant.js /^ intersectStrict: function(other) {$/;" r +isCurrent .\ctrl.js /^ isCurrent: function(){$/;" r +isDead .\main.js /^ isDead: function(){$/;" r +json .\jkl-parsexml.js /^ var json = {};$/;" r +keybind .\enchant.js /^ keybind: function(key, button) {$/;" r +keyunbind .\enchant.js /^ keyunbind: function(key) {$/;" r +l1 .\enchant.js /^ l1 = [ ltx1 - lbx1, lty1 - lby1 ],$/;" r +l2 .\enchant.js /^ l2 = [ ltx2 - lbx2, lty2 - lby2 ],$/;" r +lastChild .\enchant.js /^ lastChild: {$/;" r +ld .\class.js /^ ld : {x: 0+s, y:h+t-s}$/;" r +ld .\class.js /^ ld : {x: 0, y:h+t}$/;" r +leftBottom .\enchant.js /^ leftBottom: [ m21h + mdx, m22h + mdy ],$/;" r +leftTop .\enchant.js /^ leftTop: [ mdx, mdy ],$/;" r +line .\jkl-parsexml.js /^ var line = [];$/;" r +load .\enchant.js /^ load: function(src, alias, callback, onerror) {$/;" r +loadData .\enchant.js /^ loadData: function(data) {$/;" r +loadFunc .\enchant.js /^ loadFunc = function() {$/;" r +loadParamsXML .\main.js /^ loadParamsXML: function(url){$/;" r +loop .\enchant.js /^ loop: function() {$/;" r +lt .\class.js /^ lt : {x: 0+s, y: t+s},$/;" r +lt .\class.js /^ lt : {x: 0, y: t},$/;" r +makeTransformMatrix .\enchant.js /^ makeTransformMatrix: function(node, dest) {$/;" r +mat .\enchant.js /^ var mat = [];$/;" r +matrix .\enchant.js /^ matrix: [1, 0, 0, 1, 0, 0],$/;" r +menuSurface.context.fillStyle .\main.js /^ menuSurface.context.fillStyle = '#000';$/;" r +mode .\jkl-parsexml.js /^ mode = [ mode ]; \/\/ string into array$/;" r +moveBy .\enchant.js /^ moveBy: function(x, y) {$/;" r +moveBy .\enchant.js /^ moveBy: function(x, y, time, easing) {$/;" r +moveBy .\main.js /^ moveBy:function(x, y, time){$/;" r +moveTo .\enchant.js /^ moveTo: function(x, y) {$/;" r +moveTo .\enchant.js /^ moveTo: function(x, y, time, easing) {$/;" r +moveTo .\main.js /^ moveTo:function(x, y, time){$/;" r +moveX .\enchant.js /^ moveX: function(x, time, easing) {$/;" r +moveX .\main.js /^ moveX: function(x){$/;" r +moveY .\enchant.js /^ moveY: function(y, time, easing) {$/;" r +moveY .\main.js /^ moveY: function(y){$/;" r +mult .\mixing.enchant.js /^ * mult : function(value) {$/;" r +multipleMixingCombinationFunctionFactory .\mixing.enchant.js /^ var multipleMixingCombinationFunctionFactory = function(oldFunc,newFunc, key) {$/;" r +multiply .\enchant.js /^ multiply: function(m1, m2, dest) {$/;" r +multiplyVec .\enchant.js /^ multiplyVec: function(mat, vec, dest) {$/;" r +myProperty .\mixing.enchant.js /^ * myProperty : {$/;" r +newmat .\enchant.js /^ newmat = [];$/;" r +next .\enchant.js /^ next: function(remaining) {$/;" r +next .\enchant.js /^ next: function(func) {$/;" r +next .\enchant.js /^ next: function(remainingTime) {$/;" r +node.__styleStatus .\enchant.js /^ node.__styleStatus = {};$/;" r +node._cvsCache .\enchant.js /^ node._cvsCache = {};$/;" r +node._cvsCache.detectColor .\enchant.js /^ node._cvsCache.detectColor = 'rgba(' + layer._colorManager.attachDetectColor(node) + ')';$/;" r +node._cvsCache.matrix .\enchant.js /^ node._cvsCache.matrix = [ 1, 0, 0, 1, 0, 0 ];$/;" r +node._style .\enchant.js /^ node._style = {};$/;" r +o .\enchant.js /^ var o = {};$/;" r +on .\enchant.js /^ on: function() {$/;" r +onactiontick .\enchant.js /^ onactiontick: function(evt) {$/;" r +onloadTimeSetter .\enchant.js /^ var onloadTimeSetter = function() {$/;" r +onxbuttondown .\enchant.js /^ var onxbuttondown = function(e) {$/;" r +onxbuttonup .\enchant.js /^ var onxbuttonup = function(e) {$/;" r +opacity .\enchant.js /^ opacity: {$/;" r +or .\enchant.js /^ or: function() {$/;" r +origin .\enchant.js /^ var origin = {};$/;" r +originX .\enchant.js /^ originX: {$/;" r +originY .\enchant.js /^ originY: {$/;" r +override .\mixing.enchant.js /^ var override = {};$/;" r +pause .\enchant.js /^ pause: function() {$/;" r +pause .\enchant.js /^ pause: function() {$/;" r +play .\enchant.js /^ play: function() {$/;" r +play .\enchant.js /^ play: function(dup) {$/;" r +popScene .\enchant.js /^ popScene: function() {$/;" r +poss1 .\enchant.js /^ poss1 = [ lt1, rt1, rb1, lb1 ];$/;" r +poss2 .\enchant.js /^ poss2 = [ lt2, rt2, rb2, lb2 ];$/;" r +preload .\enchant.js /^ preload: function(assets) {$/;" r +proc .\jkl-parsexml.js /^ var proc = function() {$/;" r +properties .\mixing.enchant.js /^ var properties = {};$/;" r +pushScene .\enchant.js /^ pushScene: function(scene) {$/;" r +r1 .\enchant.js /^ r1 = [ rbx1 - rtx1, rby1 - rty1 ],$/;" r +r2 .\enchant.js /^ r2 = [ rbx2 - rtx2, rby2 - rty2 ],$/;" r +rd .\class.js /^ rd : {x: w, y:h+t},$/;" r +rd .\class.js /^ rd : {x: w-s, y:h+t-s},$/;" r +reDraw .\class.js /^ reDraw : function() {$/;" r +redraw .\enchant.js /^ redraw: function(x, y, width, height) {$/;" r +remove .\enchant.js /^ remove: function() {$/;" r +removeChild .\enchant.js /^ removeChild: function(node) {$/;" r +removeCurrent .\ctrl.js /^ removeCurrent: function(){$/;" r +removeEventListener .\enchant.js /^ removeEventListener: function(type, listener) {$/;" r +removeFromScene .\enchant.js /^ removeFromScene: function() {$/;" r +removeManager .\enchant.js /^ removeManager: function(childManager) {$/;" r +removeScene .\enchant.js /^ removeScene: function(scene) {$/;" r +render .\enchant.js /^ render: function(ctx, node, e) {$/;" r +render .\enchant.js /^ render: function(inheritMat) {$/;" r +repeat .\enchant.js /^ repeat: function(func, time) {$/;" r +replaceScene .\enchant.js /^ replaceScene: function(scene) {$/;" r +req.onreadystatechange .\enchant.js /^ req.onreadystatechange = function() {$/;" r +reset .\enchant.js /^ reset: function() {$/;" r +result .\mixing.enchant.js /^ var result = enchant.Class.create(target,{});$/;" c +resume .\enchant.js /^ resume: function() {$/;" r +resume .\enchant.js /^ resume: function() {$/;" r +ret .\enchant.js /^ var ret = [];$/;" r +ret .\enchant.js /^ var ret = {};$/;" r +ret .\enchant.js /^ var ret = [];$/;" r +ret .\jkl-parsexml.js /^ ret = [ ret ];$/;" r +retval .\jkl-parsexml.js /^ if ( ! retval ) retval = "";$/;" r +retval .\jkl-parsexml.js /^ if ( ! retval ) retval = {};$/;" r +retval .\jkl-parsexml.js /^ retval = {};$/;" r +reverse .\main.js /^ reverse:function(){$/;" r +rightBottom .\enchant.js /^ rightBottom: [ m11w + m21h + mdx, m12w + m22h + mdy ]$/;" r +rightTop .\enchant.js /^ rightTop: [ m11w + mdx, m12w + mdy ],$/;" r +rotate .\enchant.js /^ rotate: function(deg) {$/;" r +rotateBy .\enchant.js /^ rotateBy: function(deg, time, easing) {$/;" r +rotateTo .\enchant.js /^ rotateTo: function(deg, time, easing) {$/;" r +rotation .\enchant.js /^ rotation: function() {$/;" r +rotation .\enchant.js /^ rotation: {$/;" r +rt .\class.js /^ rt : {x: w, y: t},$/;" r +rt .\class.js /^ rt : {x: w-s, y: t+s},$/;" r +runEnterframe .\main.js /^ runEnterframe:function(){$/;" r +runHungry .\main.js /^ runHungry: function(){$/;" r +runYukkuri .\main.js /^ runYukkuri: function(){$/;" r +scale .\enchant.js /^ scale: {$/;" r +scale .\enchant.js /^ scale: function(x, y) {$/;" r +scaleBy .\enchant.js /^ scaleBy: function(scale, time, easing) {$/;" r +scaleTo .\enchant.js /^ scaleTo: function(scale, time, easing) {$/;" r +scaleX .\enchant.js /^ scaleX: function() {$/;" r +scaleX .\enchant.js /^ scaleX: function() {$/;" r +scaleX .\enchant.js /^ scaleX: {$/;" r +scaleY .\enchant.js /^ scaleY: function() {$/;" r +scaleY .\enchant.js /^ scaleY: function() {$/;" r +scaleY .\enchant.js /^ scaleY: {$/;" r +scene.backgroundColor .\enchant.js /^ scene.backgroundColor = '#000';$/;" r +search .\main.js /^ search : function(){$/;" r +self.menuBg.image.context.fillStyle .\ctrl.js /^ self.menuBg.image.context.fillStyle = "#bb7777";$/;" r +self.menuBg.image.context.fillStyle .\ctrl.js /^ self.menuBg.image.context.fillStyle = "#ff0000";$/;" r +self.menuBg.image.context.fillStyle .\ctrl.js /^ self.menuBg.image.context.fillStyle = "#ffffff";$/;" r +set .\enchant.js /^ set: function(time) {$/;" r +set .\enchant.js /^ set: function(volume) {$/;" r +set .\enchant.js /^ set: function(h) {$/;" r +set .\enchant.js /^ set: function(s) {$/;" r +set .\enchant.js /^ set: function(w) {$/;" r +set .\enchant.js /^ set: function(color) {$/;" r +set .\enchant.js /^ set: function(dirty) {$/;" r +set .\enchant.js /^ set: function(enabled) {$/;" r +set .\enchant.js /^ set: function(font) {$/;" r +set .\enchant.js /^ set: function(frame) {$/;" r +set .\enchant.js /^ set: function(height) {$/;" r +set .\enchant.js /^ set: function(image) {$/;" r +set .\enchant.js /^ set: function(opacity) {$/;" r +set .\enchant.js /^ set: function(originX) {$/;" r +set .\enchant.js /^ set: function(originY) {$/;" r +set .\enchant.js /^ set: function(rotation) {$/;" r +set .\enchant.js /^ set: function(scale) {$/;" r +set .\enchant.js /^ set: function(scaleX) {$/;" r +set .\enchant.js /^ set: function(scaleY) {$/;" r +set .\enchant.js /^ set: function(text) {$/;" r +set .\enchant.js /^ set: function(textAlign) {$/;" r +set .\enchant.js /^ set: function(tileHeight) {$/;" r +set .\enchant.js /^ set: function(tileWidth) {$/;" r +set .\enchant.js /^ set: function(time) {$/;" r +set .\enchant.js /^ set: function(visible) {$/;" r +set .\enchant.js /^ set: function(volume) {$/;" r +set .\enchant.js /^ set: function(width) {$/;" r +set .\enchant.js /^ set: function(x) {$/;" r +set .\enchant.js /^ set: function(y) {$/;" r +set .\mixing.enchant.js /^ * set : function(val) {$/;" r +set .\mixing.enchant.js /^ * set : function(val) {$/;" r +setBackgroundMap .\ctrl.js /^ setBackgroundMap: function(backgroundMap){$/;" r +setCurrent .\ctrl.js /^ setCurrent: function(){$/;" r +setCurrentCommand .\ctrl.js /^ setCurrentCommand: function(cmd){$/;" r +setFrameBased .\enchant.js /^ setFrameBased: function() {$/;" r +setLayer .\enchant.js /^ setLayer: function(layer) {$/;" r +setMenuBg .\ctrl.js /^ setMenuBg: function (menuBg){$/;" r +setPixel .\enchant.js /^ setPixel: function(x, y, r, g, b, a) {$/;" r +setPlayer .\ctrl.js /^ setPlayer: function(player){$/;" r +setTimeBased .\enchant.js /^ setTimeBased: function() {$/;" r +show .\enchant.js /^ show: function() {$/;" r +skip .\enchant.js /^ skip: function(frames) {$/;" r +sprite.frame .\enchant.js /^ * sprite.frame = [0, 1, 0, 2, null]$/;" r +sprite.frame .\enchant.js /^ * sprite.frame = [0, 1, 0, 2]$/;" r +sprite.image.context.fillStyle .\enchant.js /^ sprite.image.context.fillStyle = '#fff';$/;" r +stage.id .\enchant.js /^ stage.id = 'enchant-stage';$/;" r +stage.style.fontSize .\enchant.js /^ stage.style.fontSize = '12px';$/;" r +stage.style.position .\enchant.js /^ stage.style.position = 'absolute';$/;" r +stage.style.position .\enchant.js /^ stage.style.position = 'relative';$/;" r +stage.style.webkitTapHighlightColor .\enchant.js /^ stage.style.webkitTapHighlightColor = 'rgba(0, 0, 0, 0)';$/;" r +stage.style.webkitTextSizeAdjust .\enchant.js /^ stage.style.webkitTextSizeAdjust = 'none';$/;" r +start .\enchant.js /^ start: function(deferred) {$/;" r +stop .\enchant.js /^ stop: function() {$/;" r +stop .\enchant.js /^ stop: function() {$/;" r +strokeStyle .\class.js /^ strokeStyle = 'black';$/;" r +sub .\mixing.enchant.js /^ * sub : function(value) {$/;" r +submodules .\enchant.js /^ var submodules = [],$/;" r +t1 .\enchant.js /^ t1 = [ rtx1 - ltx1, rty1 - lty1 ],$/;" r +t2 .\enchant.js /^ t2 = [ rtx2 - ltx2, rty2 - lty2 ],$/;" r +table .\jkl-parsexml.js /^ var table = [];$/;" r +target .\enchant.js /^ target = 'Canvas';$/;" r +target .\enchant.js /^ target = 'Dom';$/;" r +target .\enchant.js /^ var target = {};$/;" r +text .\class.js /^ text : function(text, x, y) {$/;" r +text .\enchant.js /^ text = '' + text;$/;" r +text .\enchant.js /^ text: {$/;" r +textAlign .\class.js /^ textAlign = 'center';$/;" r +textAlign .\enchant.js /^ textAlign: {$/;" r +textBaseline .\class.js /^ textBaseline = 'middle';$/;" r +then .\enchant.js /^ then: function(func) {$/;" r +this.__styleStatus .\enchant.js /^ this.__styleStatus = {};$/;" r +this._assets .\enchant.js /^ var assets = this._assets = [];$/;" r +this._css .\enchant.js /^ this._css = '-moz-element(#' + id + ')';$/;" r +this._css .\enchant.js /^ this._css = '-webkit-canvas(' + id + ')';$/;" r +this._cvsCache .\enchant.js /^ this._cvsCache = {$/;" r +this._data .\enchant.js /^ this._data = [$/;" r +this._debugColor .\enchant.js /^ this._debugColor = '#0000ff';$/;" r +this._debugColor .\enchant.js /^ this._debugColor = '#ff0000';$/;" r +this._detect.style.position .\enchant.js /^ this._detect.style.position = 'absolute';$/;" r +this._dispatchExitframe .\enchant.js /^ this._dispatchExitframe = function() {$/;" r +this._domRef .\enchant.js /^ this._domRef = [];$/;" r +this._element.style.overflow .\enchant.js /^ this._element.style.overflow = 'hidden';$/;" r +this._element.style.position .\enchant.js /^ this._element.style.position = 'absolute';$/;" r +this._element.style.position .\enchant.js /^ this._element.style.position = 'absolute';$/;" r +this._element.style.top .\enchant.js /^ this._element.style.left = this._element.style.top = '0px';$/;" r +this._frameSequence .\enchant.js /^ this._frameSequence = [];$/;" r +this._frameSequence .\enchant.js /^ this._frameSequence = [];$/;" r +this._frameSequence .\enchant.js /^ this._frameSequence = [];$/;" r +this._internalButtondownListeners .\enchant.js /^ this._internalButtondownListeners = {};$/;" r +this._internalButtonupListeners .\enchant.js /^ this._internalButtonupListeners = {};$/;" r +this._layerPriority .\enchant.js /^ this._layerPriority = [];$/;" r +this._layers .\enchant.js /^ this._layers = {};$/;" r +this._listeners .\enchant.js /^ this._listeners = {};$/;" r +this._listeners .\enchant.js /^ this._listeners = {};$/;" r +this._matrix .\enchant.js /^ this._matrix = [ 1, 0, 0, 1, 0, 0 ];$/;" r +this._nodeEventListener .\enchant.js /^ this._nodeEventListener = function(e) {$/;" r +this._scenes .\enchant.js /^ this._scenes = [];$/;" r +this._setDomTarget .\enchant.js /^ this._setDomTarget = function() {$/;" r +this._style .\enchant.js /^ this._style = {};$/;" r +this._style.pointerEvents .\enchant.js /^ this._style.pointerEvents = 'all';$/;" r +this._style.pointerEvents .\enchant.js /^ this._style.pointerEvents = 'none';$/;" r +this._style.webkitTransform .\enchant.js /^ this._style.webkitTransform = 'scale(0.5)';$/;" r +this._style.webkitTransformOrigin .\enchant.js /^ this._style.webkitTransformOrigin = '0 0';$/;" r +this.actions .\enchant.js /^ this.actions = [];$/;" r +this.assets .\enchant.js /^ this.assets = {};$/;" r +this.backgroundColor .\enchant.js /^ this.backgroundColor = '#000';$/;" r +this.backgroundColor .\enchant.js /^ * this.backgroundColor = 'red';$/;" r +this.childNodes .\enchant.js /^ this.childNodes = [];$/;" r +this.cmdIcons .\ctrl.js /^ this.cmdIcons = [];$/;" r +this.easing .\enchant.js /^ this.easing = function(t, b, c, d) {$/;" r +this.endedActions .\enchant.js /^ this.endedActions = [];$/;" r +this.endedActions .\enchant.js /^ this.endedActions = [];$/;" r +this.font .\enchant.js /^ this.font = '14px serif';$/;" r +this.image.context.font .\class.js /^ this.image.context.font = "12px 'Times New Roman'";$/;" r +this.inCurve .\class.js /^ this.inCurve = {$/;" r +this.input .\enchant.js /^ this.input = {};$/;" r +this.labelParams .\ctrl.js /^ this.labelParams = {$/;" r +this.labels .\ctrl.js /^ \/\/ this.labels = {};$/;" r +this.labels .\ctrl.js /^\/\/ this.labels = {$/;" r +this.mang .\ctrl.js /^ this.mang = {};$/;" r +this.menuBg.image.context.fillStyle .\ctrl.js /^ this.menuBg.image.context.fillStyle = '#ff0000';$/;" r +this.menuBg.image.context.fillStyle .\ctrl.js /^\/\/ \/\/ this.menuBg.image.context.fillStyle = '#ff0000';$/;" r +this.method .\jkl-parsexml.js /^ this.method = "GET";$/;" r +this.method .\jkl-parsexml.js /^ this.method = "POST";$/;" r +this.outCurve .\class.js /^ this.outCurve = {$/;" r +this.query .\jkl-parsexml.js /^ this.query = "";$/;" r +this.queue .\enchant.js /^ this.queue = [];$/;" r +this.reference .\enchant.js /^ this.reference = [];$/;" r +this.runEnterframe .\main.js /^ \/\/ this.runEnterframe = function(){$/;" r +this.stack .\enchant.js /^ this.stack = [];$/;" r +this.style.border .\enchant.js /^ this.style.border = '1px solid blue';$/;" r +this.style.margin .\enchant.js /^ this.style.margin = '-1px';$/;" r +this.style.position .\enchant.js /^ this.style.position = 'absolute';$/;" r +this.textAlign .\enchant.js /^ this.textAlign = 'left';$/;" r +this.widthArr .\ctrl.js /^ this.widthArr = [];$/;" r +this.widthArr .\ctrl.js /^\/\/ this.widthArr = [];$/;" r +tick .\enchant.js /^ tick: function(enterFrameEvent) {$/;" r +tileHeight .\enchant.js /^ tileHeight: {$/;" r +tileWidth .\enchant.js /^ tileWidth: {$/;" r +timeline .\enchant.js /^ var i, len, timeline = {$/;" r +toDataURL .\enchant.js /^ toDataURL: function() {$/;" r +touch .\enchant.js /^ var touch = [$/;" r +touchEnabled .\enchant.js /^ touchEnabled: {$/;" r +touchend .\ctrl.js /^ touchend : function(e){$/;" r +touchend .\ctrl.js /^ touchend: function(e){$/;" r +touchmove .\ctrl.js /^ touchmove : function(e){$/;" r +touchmove .\ctrl.js /^ touchmove: function(e){$/;" r +touchstart .\ctrl.js /^ touchstart : function(e){$/;" r +touchstart .\ctrl.js /^ touchstart :function(e){$/;" r +touchstart .\ctrl.js /^ touchstart: function(e){$/;" r +transform .\enchant.js /^ transform: function(ctx, node) {$/;" r +tree .\enchant.js /^ var tree = [ node ];$/;" r +tween .\enchant.js /^ tween: function(params) {$/;" r +tweet .\main.js /^ tweet:function(text){$/;" r +type .\enchant.js /^ type = '';$/;" r +type .\enchant.js /^ type = 'audio\/' + ext;$/;" r +unloop .\enchant.js /^ unloop: function() {$/;" r +updateBoundArea .\enchant.js /^ updateBoundArea: function() {$/;" r +vec .\enchant.js /^ var vec = [ ox, oy ];$/;" r +vec .\enchant.js /^ vec = [ ox, oy ];$/;" r +vec .\enchant.js /^ var vec = [ ox, oy ];$/;" r +visible .\enchant.js /^ visible: {$/;" r +voidFunction .\mixing.enchant.js /^ var voidFunction = function(){};$/;" r +volume .\enchant.js /^ volume: {$/;" r +volume .\enchant.js /^ volume: {$/;" r +wait .\enchant.js /^ wait: function(time) {$/;" r +waitAll .\enchant.js /^ waitAll: function() {$/;" r +waitUntil .\enchant.js /^ waitUntil: function(func) {$/;" r +walk .\main.js /^ walk : function(retryCounter){$/;" r +width .\enchant.js /^ width: {$/;" r +width .\enchant.js /^ width: {$/;" r +window.onload .\main.js /^window.onload = function(){$/;" r +within .\enchant.js /^ within: function(other, distance) {$/;" r +x .\enchant.js /^ x: function() {$/;" r +x .\enchant.js /^ x: {$/;" r +xhr.onload .\enchant.js /^ xhr.onload = function() {$/;" r +xhr.responseType .\enchant.js /^ xhr.responseType = 'arraybuffer';$/;" r +xw .\enchant.js /^ var xw = [ mdx, m11w + mdx, m21h + mdx, m11w + m21h + mdx ].sort(function(a, b) { return a - b; });$/;" r +y .\enchant.js /^ y: function() {$/;" r +y .\enchant.js /^ y: {$/;" r +yh .\enchant.js /^ var yh = [ mdy, m12w + mdy, m22h + mdy, m12w + m22h + mdy ].sort(function(a, b) { return a - b; });$/;" r +  script.type .\init.js /^  script.type = 'text\/javascript';$/;" r diff --git a/.tags_sorted_by_file b/.tags_sorted_by_file new file mode 100644 index 0000000..ceba5b4 --- /dev/null +++ b/.tags_sorted_by_file @@ -0,0 +1,800 @@ +// this.menuBg.image.context.fillStyle .\ctrl.js /^\/\/ this.menuBg.image.context.fillStyle = '#ff0000';$/;" r +TTweet class.js /^TTweet = enchant.Class.create(enchant.Sprite, {$/;" c +clear class.js /^ clear : function() {$/;" r +fillStyle class.js /^ fillStyle = 'black';$/;" r +fillStyle class.js /^ fillStyle = 'white';$/;" r +fillStyle class.js /^ fillStyle = 'black';$/;" r +fillTextLine class.js /^ fillTextLine : function(text, x, y) {$/;" r +initialize class.js /^ initialize : function(w, h) {$/;" r +ld class.js /^ ld : {x: 0+s, y:h+t-s}$/;" r +ld class.js /^ ld : {x: 0, y:h+t}$/;" r +lt class.js /^ lt : {x: 0+s, y: t+s},$/;" r +lt class.js /^ lt : {x: 0, y: t},$/;" r +rd class.js /^ rd : {x: w, y:h+t},$/;" r +rd class.js /^ rd : {x: w-s, y:h+t-s},$/;" r +reDraw class.js /^ reDraw : function() {$/;" r +rt class.js /^ rt : {x: w, y: t},$/;" r +rt class.js /^ rt : {x: w-s, y: t+s},$/;" r +strokeStyle class.js /^ strokeStyle = 'black';$/;" r +text class.js /^ text : function(text, x, y) {$/;" r +textAlign class.js /^ textAlign = 'center';$/;" r +textBaseline class.js /^ textBaseline = 'middle';$/;" r +this.image.context.font class.js /^ this.image.context.font = "12px 'Times New Roman'";$/;" r +this.inCurve class.js /^ this.inCurve = {$/;" r +this.outCurve class.js /^ this.outCurve = {$/;" r +.ontouchstart ctrl.js /^ this.cmdIcons[value].ontouchstart = function(obj){$/;" r +ATouchEvent ctrl.js /^var ATouchEvent = enchant.Class.create({$/;" c +COLOR ctrl.js /^ var COLOR = "#ffffff";$/;" r +COLOR ctrl.js /^\/\/ var COLOR = "#ffffff";$/;" r +CommandIcon ctrl.js /^var CommandIcon = enchant.Class.create(enchant.Sprite,{$/;" c +Ctrl ctrl.js /^var Ctrl = enchant.Class.create({$/;" c +FONT ctrl.js /^ var FONT = "18px 'Times New Roman'";$/;" r +FONT ctrl.js /^\/\/ var FONT = "14px 'Times New Roman'";$/;" r +MangIcon ctrl.js /^var MangIcon = enchant.Class.create({$/;" c +MangLabel ctrl.js /^\/\/ var MangLabel = enchant.Class.create({$/;" c +MangLabel ctrl.js /^var MangLabel = enchant.Class.create({$/;" c +MangTouch ctrl.js /^var MangTouch = enchant.Class.create({$/;" c +TEXT ctrl.js /^ var TEXT = "うんうん";$/;" r +TEXT ctrl.js /^ var TEXT = "ゆっくり";$/;" r +TEXT ctrl.js /^ var TEXT = "ストレス";$/;" r +TEXT ctrl.js /^ var TEXT = "眠気";$/;" r +TEXT ctrl.js /^ var TEXT = "空腹";$/;" r +TEXT ctrl.js /^\/\/ var TEXT = "ゆっくり";$/;" r +TEXT ctrl.js /^\/\/ var TEXT = "空腹";$/;" r +WorldCursorTouchEvent ctrl.js /^var WorldCursorTouchEvent = enchant.Class.create(ATouchEvent,{$/;" c +WorldTargetTouchEvent ctrl.js /^var WorldTargetTouchEvent = enchant.Class.create(ATouchEvent,{$/;" c +draw ctrl.js /^ draw: function(yukkuriObj){$/;" r +draw ctrl.js /^ draw: function(yukkuriObj){$/;" r +draw ctrl.js /^\/\/ draw: function(){$/;" r +get ctrl.js /^ get: function(commandIndex){$/;" r +get ctrl.js /^ get: function(ecmd){$/;" r +getCurrentCommand ctrl.js /^ getCurrentCommand: function(){$/;" r +init ctrl.js /^ init: function(){$/;" r +init ctrl.js /^ init : function (game){$/;" r +initialize ctrl.js /^ \/\/ initialize: function (ctl){$/;" r +initialize ctrl.js /^ initialize: function (){$/;" r +initialize ctrl.js /^ initialize: function (ctl){$/;" r +initialize ctrl.js /^ initialize: function (ctl, menuBg){$/;" r +initialize ctrl.js /^ initialize: function (x, y, ecmd, index){$/;" r +initialize ctrl.js /^\/\/ initialize: function (ctl, menuBg){$/;" r +isCurrent ctrl.js /^ isCurrent: function(){$/;" r +removeCurrent ctrl.js /^ removeCurrent: function(){$/;" r +self.menuBg.image.context.fillStyle ctrl.js /^ self.menuBg.image.context.fillStyle = "#bb7777";$/;" r +self.menuBg.image.context.fillStyle ctrl.js /^ self.menuBg.image.context.fillStyle = "#ff0000";$/;" r +self.menuBg.image.context.fillStyle ctrl.js /^ self.menuBg.image.context.fillStyle = "#ffffff";$/;" r +setBackgroundMap ctrl.js /^ setBackgroundMap: function(backgroundMap){$/;" r +setCurrent ctrl.js /^ setCurrent: function(){$/;" r +setCurrentCommand ctrl.js /^ setCurrentCommand: function(cmd){$/;" r +setMenuBg ctrl.js /^ setMenuBg: function (menuBg){$/;" r +setPlayer ctrl.js /^ setPlayer: function(player){$/;" r +this.cmdIcons ctrl.js /^ this.cmdIcons = [];$/;" r +this.labelParams ctrl.js /^ this.labelParams = {$/;" r +this.labels ctrl.js /^ \/\/ this.labels = {};$/;" r +this.labels ctrl.js /^\/\/ this.labels = {$/;" r +this.mang ctrl.js /^ this.mang = {};$/;" r +this.menuBg.image.context.fillStyle ctrl.js /^ this.menuBg.image.context.fillStyle = '#ff0000';$/;" r +this.menuBg.image.context.fillStyle ctrl.js /^\/\/ \/\/ this.menuBg.image.context.fillStyle = '#ff0000';$/;" r +this.widthArr ctrl.js /^ this.widthArr = [];$/;" r +this.widthArr ctrl.js /^\/\/ this.widthArr = [];$/;" r +touchend ctrl.js /^ touchend : function(e){$/;" r +touchend ctrl.js /^ touchend: function(e){$/;" r +touchmove ctrl.js /^ touchmove : function(e){$/;" r +touchmove ctrl.js /^ touchmove: function(e){$/;" r +touchstart ctrl.js /^ touchstart : function(e){$/;" r +touchstart ctrl.js /^ touchstart :function(e){$/;" r +touchstart ctrl.js /^ touchstart: function(e){$/;" r +'Transform'] enchant.js /^ this._style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'matrix(1, 0, 0, 1, 0, 0)';$/;" r +'Transform'] enchant.js /^ this.style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'matrix(' +$/;" r +'Transform'] enchant.js /^ this._element.style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'scale(' + e.scale + ')';$/;" r +'TransformOrigin'] enchant.js /^ this._element.style[enchant.ENV.VENDOR_PREFIX + 'TransformOrigin'] = '0 0';$/;" r +'TransformOrigin'] enchant.js /^ this.style[enchant.ENV.VENDOR_PREFIX + 'TransformOrigin'] = '0px 0px';$/;" r +10 enchant.js /^ * 10: function(){ 10フレーム経過した後に実行される関数 },$/;" r +20 enchant.js /^ * 20: function(){ 20フレーム経過した後に実行される関数 },$/;" r +30 enchant.js /^ * 30: function(){ 30フレーム経過した後に実行される関数 }$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.Core}$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Node}$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene}$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.Entity}$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.Group}, {@link enchant.Scene}$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.LoadingScene}$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.Node}$/;" r +Auftretens enchant.js /^ * Objekt des Auftretens: {@link enchant.Scene}$/;" r +BACK_EASEIN enchant.js /^ BACK_EASEIN: function(t, b, c, d, s) {$/;" r +BACK_EASEINOUT enchant.js /^ BACK_EASEINOUT: function(t, b, c, d, s) {$/;" r +BACK_EASEOUT enchant.js /^ BACK_EASEOUT: function(t, b, c, d, s) {$/;" r +BOUNCE_EASEIN enchant.js /^ BOUNCE_EASEIN: function(t, b, c, d) {$/;" r +BOUNCE_EASEINOUT enchant.js /^ BOUNCE_EASEINOUT: function(t, b, c, d) {$/;" r +BOUNCE_EASEOUT enchant.js /^ BOUNCE_EASEOUT: function(t, b, c, d) {$/;" r +CANVAS_DRAWING_METHODS enchant.js /^ CANVAS_DRAWING_METHODS: [$/;" r +CIRC_EASEIN enchant.js /^ CIRC_EASEIN: function(t, b, c, d) {$/;" r +CIRC_EASEINOUT enchant.js /^ CIRC_EASEINOUT: function(t, b, c, d) {$/;" r +CIRC_EASEOUT enchant.js /^ CIRC_EASEOUT: function(t, b, c, d) {$/;" r +CUBIC_EASEIN enchant.js /^ CUBIC_EASEIN: function(t, b, c, d) {$/;" r +CUBIC_EASEINOUT enchant.js /^ CUBIC_EASEINOUT: function(t, b, c, d) {$/;" r +CUBIC_EASEOUT enchant.js /^ CUBIC_EASEOUT: function(t, b, c, d) {$/;" r +Constructor enchant.js /^ var Constructor = function() {$/;" r +Constructor._collectionTarget enchant.js /^ Constructor._collectionTarget = [];$/;" r +Constructor.collection enchant.js /^ Constructor.collection = [];$/;" r +Constructor.prototype.initialize enchant.js /^ Constructor.prototype.initialize = function() {$/;" r +ELASTIC_EASEIN enchant.js /^ ELASTIC_EASEIN: function(t, b, c, d, a, p) {$/;" r +ELASTIC_EASEINOUT enchant.js /^ ELASTIC_EASEINOUT: function(t, b, c, d, a, p) {$/;" r +ELASTIC_EASEOUT enchant.js /^ ELASTIC_EASEOUT: function(t, b, c, d, a, p) {$/;" r +EXPO_EASEIN enchant.js /^ EXPO_EASEIN: function(t, b, c, d) {$/;" r +EXPO_EASEINOUT enchant.js /^ EXPO_EASEINOUT: function(t, b, c, d) {$/;" r +EXPO_EASEOUT enchant.js /^ EXPO_EASEOUT: function(t, b, c, d) {$/;" r +Function.prototype.bind enchant.js /^ Function.prototype.bind = function(thisObject) {$/;" r +KEY_BIND_TABLE enchant.js /^ KEY_BIND_TABLE: {$/;" r +LINEAR enchant.js /^ LINEAR: function(t, b, c, d) {$/;" r +Nop enchant.js /^ var Nop = function() {$/;" r +Object.create enchant.js /^ Object.create = function(prototype, descs) {$/;" r +Object.defineProperties enchant.js /^ Object.defineProperties = function(obj, descs) {$/;" r +Object.defineProperty enchant.js /^ Object.defineProperty = function(obj, prop, desc) {$/;" r +Object.getPrototypeOf enchant.js /^ Object.getPrototypeOf = function(obj) {$/;" r +PREVENT_DEFAULT_KEY_CODES enchant.js /^ PREVENT_DEFAULT_KEY_CODES: [37, 38, 39, 40, 32],$/;" r +QUAD_EASEIN enchant.js /^ QUAD_EASEIN: function(t, b, c, d) {$/;" r +QUAD_EASEINOUT enchant.js /^ QUAD_EASEINOUT: function(t, b, c, d) {$/;" r +QUAD_EASEOUT enchant.js /^ QUAD_EASEOUT: function(t, b, c, d) {$/;" r +QUART_EASEIN enchant.js /^ QUART_EASEIN: function(t, b, c, d) {$/;" r +QUART_EASEINOUT enchant.js /^ QUART_EASEINOUT: function(t, b, c, d) {$/;" r +QUART_EASEOUT enchant.js /^ QUART_EASEOUT: function(t, b, c, d) {$/;" r +QUINT_EASEIN enchant.js /^ QUINT_EASEIN: function(t, b, c, d) {$/;" r +QUINT_EASEINOUT enchant.js /^ QUINT_EASEINOUT: function(t, b, c, d) {$/;" r +QUINT_EASEOUT enchant.js /^ QUINT_EASEOUT: function(t, b, c, d) {$/;" r +SIN_EASEIN enchant.js /^ SIN_EASEIN: function(t, b, c, d) {$/;" r +SIN_EASEINOUT enchant.js /^ SIN_EASEINOUT: function(t, b, c, d) {$/;" r +SIN_EASEOUT enchant.js /^ SIN_EASEOUT: function(t, b, c, d) {$/;" r +SWING enchant.js /^ SWING: function(t, b, c, d) {$/;" r +USE_DEFAULT_EVENT_TAGS enchant.js /^ USE_DEFAULT_EVENT_TAGS: ['input', 'textarea', 'select', 'area'],$/;" r +__onchildadded enchant.js /^ var __onchildadded = function(e) {$/;" r +__onchildremoved enchant.js /^ var __onchildremoved = function(e) {$/;" r +_activateTimeline enchant.js /^ _activateTimeline: function() {$/;" r +_add enchant.js /^ _add: function(queue) {$/;" r +_addSelfToCollection enchant.js /^ _addSelfToCollection: function() {$/;" r +_attachEvent enchant.js /^ _attachEvent: function() {$/;" r +_callTick enchant.js /^ _callTick: function(time) {$/;" r +_callback enchant.js /^ var _callback = function(e) {$/;" r +_collectizeConstructor enchant.js /^var _collectizeConstructor = function(Constructor) {$/;" r +_css enchant.js /^ _css: { value: 'url(' + src + ')' },$/;" r +_deactivateTimeline enchant.js /^ _deactivateTimeline: function() {$/;" r +_decodeDetectColor enchant.js /^ _decodeDetectColor: function(color) {$/;" r +_detachEvent enchant.js /^ _detachEvent: function() {$/;" r +_determineEventTarget enchant.js /^ _determineEventTarget: function() {$/;" r +_determineEventTarget enchant.js /^ _determineEventTarget: function(e) {$/;" r +_dirty enchant.js /^ _dirty: {$/;" r +_dispatchCoreResizeEvent enchant.js /^ _dispatchCoreResizeEvent: function() {$/;" r +_element enchant.js /^ _element: { value: this._element.cloneNode(false) },$/;" r +_element enchant.js /^ _element: { value: image }$/;" r +_getColor enchant.js /^ _getColor: function(n) {$/;" r +_getEntityByPosition enchant.js /^ _getEntityByPosition: function(x, y) {$/;" r +_initPosition enchant.js /^ _initPosition: function(pageX, pageY) {$/;" r +_intersectBetweenClassAndClass enchant.js /^var _intersectBetweenClassAndClass = function(Class1, Class2) {$/;" r +_intersectBetweenClassAndInstance enchant.js /^var _intersectBetweenClassAndInstance = function(Class, instance) {$/;" r +_intersectOne enchant.js /^ _intersectOne: function(other) {$/;" r +_intersectStrictBetweenClassAndClass enchant.js /^var _intersectStrictBetweenClassAndClass = function(Class1, Class2) {$/;" r +_intersectStrictBetweenClassAndInstance enchant.js /^var _intersectStrictBetweenClassAndInstance = function(Class, instance) {$/;" r +_intersectStrictOne enchant.js /^ _intersectStrictOne: function(other) {$/;" r +_onchildadded enchant.js /^ _onchildadded: function(e) {$/;" r +_onchildremoved enchant.js /^ _onchildremoved: function(e) {$/;" r +_oncoreresize enchant.js /^ _oncoreresize: function(e) {$/;" r +_oncoreresize enchant.js /^ _oncoreresize: function(e) {$/;" r +_onenter enchant.js /^ _onenter: function() {$/;" r +_onerror enchant.js /^ var _onerror = function(e) {$/;" r +_onexit enchant.js /^ _onexit: function() {$/;" r +_onexitframe enchant.js /^ _onexitframe: function() {$/;" r +_register enchant.js /^ _register: function(element, nextElement) {$/;" r +_removeSelfFromCollection enchant.js /^ _removeSelfFromCollection: function() {$/;" r +_rendering enchant.js /^ _rendering: function(node, e, inheritMat) {$/;" r +_requestNextFrame enchant.js /^ _requestNextFrame: function(delay) {$/;" r +_requestPreload enchant.js /^ _requestPreload: function() {$/;" r +_setFrame enchant.js /^ _setFrame: function(frame) {$/;" r +_startRendering enchant.js /^ _startRendering: function() {$/;" r +_staticIntersect enchant.js /^var _staticIntersect = function(other) {$/;" r +_staticIntersectStrict enchant.js /^var _staticIntersectStrict = function(other) {$/;" r +_stopRendering enchant.js /^ _stopRendering: function() {$/;" r +_tick enchant.js /^ _tick: function(time) {$/;" r +_updateCoordinate enchant.js /^ _updateCoordinate: function() {$/;" r +a enchant.js /^ a = [];$/;" r +action enchant.js /^ action: function(params) {$/;" r +actualFps enchant.js /^ actualFps: {$/;" r +add enchant.js /^ add: function(action) {$/;" r +addChild enchant.js /^ addChild: function(node) {$/;" r +addEventListener enchant.js /^ addEventListener: function(type, listener) {$/;" r +addLayer enchant.js /^ addLayer: function(type, i) {$/;" r +addManager enchant.js /^ addManager: function(childManager, nextManager) {$/;" r +and enchant.js /^ and: function() {$/;" r +attachDetectColor enchant.js /^ attachDetectColor: function(sprite) {$/;" r +audio.onerror enchant.js /^ audio.onerror = function() {$/;" r +b1 enchant.js /^ b1 = [ lbx1 - rbx1, lby1 - rby1 ],$/;" r +b2 enchant.js /^ b2 = [ lbx2 - rbx2, lby2 - rby2 ],$/;" r +backgroundColor enchant.js /^ backgroundColor: {$/;" r +bound enchant.js /^ var bound = function() {$/;" r +buf enchant.js /^ buf = '';$/;" r +by enchant.js /^ * A mouse event counts as a touch event. Issued by: {@link enchant.Node}$/;" r +by enchant.js /^ * Dispatched each time an image is preloaded. Issued by: {@link enchant.LoadingScene}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Core}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Core}, {@link enchant.Node}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Core}, {@link enchant.Scene}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Core}, {@link enchant.Surface}, {@link enchant.WebAudioSound}, {@link enchant.DOMSound}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Entity}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Group}, {@link enchant.Scene}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Node}$/;" r +by enchant.js /^ * Issued by: {@link enchant.Scene}$/;" r +call enchant.js /^ call: function(arg) {$/;" r +canvas.style.position enchant.js /^ canvas.style.position = 'absolute';$/;" r +checkTile enchant.js /^ checkTile: function(x, y) {$/;" r +clear enchant.js /^ clear: function() {$/;" r +clearEventListener enchant.js /^ clearEventListener: function(type) {$/;" r +clone enchant.js /^ clone: function() {$/;" r +color enchant.js /^ color: {$/;" r +context enchant.js /^ context: { value: null },$/;" r +core._touchEventTarget enchant.js /^ core._touchEventTarget = {};$/;" r +core.onload enchant.js /^ * core.onload = function() {$/;" r +core.onload enchant.js /^ * core.onload = function() {$/;" r +ctx.textBaseline enchant.js /^ ctx.textBaseline = 'top';$/;" r +cue enchant.js /^ cue: function(cue) {$/;" r +currentTime enchant.js /^ currentTime: {$/;" r +currentTime enchant.js /^ currentTime: {$/;" r +cvsRender enchant.js /^ cvsRender: function(ctx) {$/;" r +debug enchant.js /^ debug: function() {$/;" r +debugColor enchant.js /^ debugColor: {$/;" r +delay enchant.js /^ delay: function(time) {$/;" r +dest enchant.js /^ var dest = [];$/;" r +detachDetectColor enchant.js /^ detachDetectColor: function(sprite) {$/;" r +detectRender enchant.js /^ detectRender: function(ctx) {$/;" r +detectRender enchant.js /^ detectRender: function(ctx, node) {$/;" r +dirs1 enchant.js /^ dirs1 = [ t1, r1, b1, l1 ];$/;" r +dirs2 enchant.js /^ dirs2 = [ t2, r2, b2, l2 ];$/;" r +disableCollection enchant.js /^ disableCollection: function() {$/;" r +dispatchEvent enchant.js /^ dispatchEvent: function(e) {$/;" r +div.style.position enchant.js /^ div.style.position = 'absolute';$/;" r +div.style.whiteSpace enchant.js /^ div.style.whiteSpace = 'noWrap';$/;" r +doAll enchant.js /^ doAll: function(children) {$/;" r +domRender enchant.js /^ domRender: function() {$/;" r +domRender enchant.js /^ domRender: function(element) {$/;" r +draw enchant.js /^ draw: function(image) {$/;" r +dulation enchant.js /^ dulation: {$/;" r +duration enchant.js /^ duration: { value: this.duration }$/;" r +e.message enchant.js /^ e.message = 'Cannot load an asset: ' + audio.src;$/;" r +e.message enchant.js /^ e.message = 'Cannot load an asset: ' + image.src;$/;" r +e.message enchant.js /^ e.message = 'Cannot load an asset: ' + src;$/;" r +embed.allowscriptaccess enchant.js /^ embed.allowscriptaccess = 'always';$/;" r +embed.src enchant.js /^ embed.src = 'sound.swf?id=' + id + '&src=' + src;$/;" r +embed.style.left enchant.js /^ embed.style.left = '-1px';$/;" r +embed.style.position enchant.js /^ embed.style.position = 'absolute';$/;" r +enableCollection enchant.js /^ enableCollection: function() {$/;" r +enchant enchant.js /^var enchant = function(modules) {$/;" r +enchant.Action enchant.js /^enchant.Action = enchant.Class.create(enchant.ActionEventTarget, {$/;" c +enchant.ActionEventTarget enchant.js /^enchant.ActionEventTarget = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.CanvasLayer enchant.js /^enchant.CanvasLayer = enchant.Class.create(enchant.Group, {$/;" c +enchant.CanvasLayer._attachCache enchant.js /^enchant.CanvasLayer._attachCache = function(node, layer, onchildadded, onchildremoved) {$/;" r +enchant.CanvasLayer._detachCache enchant.js /^enchant.CanvasLayer._detachCache = function(node, layer, onchildadded, onchildremoved) {$/;" r +enchant.CanvasRenderer enchant.js /^enchant.CanvasRenderer = enchant.Class.create({$/;" c +enchant.CanvasScene enchant.js /^enchant.CanvasScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.Class enchant.js /^enchant.Class = function(superclass, definition) {$/;" r +enchant.Class.create enchant.js /^enchant.Class.create = function(superclass, definition) {$/;" r +enchant.Class.getInheritanceTree enchant.js /^enchant.Class.getInheritanceTree = function(Constructor) {$/;" r +enchant.Core enchant.js /^ enchant.Core = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.Core._loadFuncs enchant.js /^ enchant.Core._loadFuncs = {};$/;" r +enchant.Core.findExt enchant.js /^ enchant.Core.findExt = function(path) {$/;" r +enchant.DOMScene enchant.js /^enchant.DOMScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.DOMSound enchant.js /^enchant.DOMSound = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.DOMSound.load enchant.js /^enchant.DOMSound.load = function(src, type, callback, onerror) {$/;" r +enchant.Deferred enchant.js /^ enchant.Deferred = enchant.Class.create({$/;" c +enchant.Deferred._insert enchant.js /^ enchant.Deferred._insert = function(queue, ins) {$/;" r +enchant.Deferred.next enchant.js /^ enchant.Deferred.next = function(func) {$/;" r +enchant.Deferred.parallel enchant.js /^ enchant.Deferred.parallel = function(arg) {$/;" r +enchant.DetectColorManager enchant.js /^enchant.DetectColorManager = enchant.Class.create({$/;" c +enchant.DomLayer enchant.js /^enchant.DomLayer = enchant.Class.create(enchant.Group, {$/;" c +enchant.DomLayer._attachDomManager enchant.js /^enchant.DomLayer._attachDomManager = function(node, onchildadded, onchildremoved) {$/;" r +enchant.DomLayer._detachDomManager enchant.js /^enchant.DomLayer._detachDomManager = function(node, onchildadded, onchildremoved) {$/;" r +enchant.DomManager enchant.js /^enchant.DomManager = enchant.Class.create({$/;" c +enchant.DomlessManager enchant.js /^enchant.DomlessManager = enchant.Class.create({$/;" c +enchant.ENV enchant.js /^enchant.ENV = {$/;" r +enchant.ENV.KEY_BIND_TABLE enchant.js /^ enchant.ENV.KEY_BIND_TABLE = {};$/;" r +enchant.ENV.KEY_BIND_TABLE enchant.js /^ * enchant.ENV.KEY_BIND_TABLE = {$/;" r +enchant.Easing enchant.js /^enchant.Easing = {$/;" r +enchant.Entity enchant.js /^enchant.Entity = enchant.Class.create(enchant.Node, {$/;" c +enchant.Entity._inherited enchant.js /^enchant.Entity._inherited = function(subclass) {$/;" r +enchant.Event enchant.js /^enchant.Event = enchant.Class.create({$/;" c +enchant.Event.ACTION_ADDED enchant.js /^enchant.Event.ACTION_ADDED = "actionadded";$/;" r +enchant.Event.ACTION_END enchant.js /^enchant.Event.ACTION_END = "actionend";$/;" r +enchant.Event.ACTION_REMOVED enchant.js /^enchant.Event.ACTION_REMOVED = "actionremoved";$/;" r +enchant.Event.ACTION_START enchant.js /^enchant.Event.ACTION_START = "actionstart";$/;" r +enchant.Event.ACTION_TICK enchant.js /^enchant.Event.ACTION_TICK = "actiontick";$/;" r +enchant.Event.ADDED enchant.js /^enchant.Event.ADDED = 'added';$/;" r +enchant.Event.ADDED_TO_SCENE enchant.js /^enchant.Event.ADDED_TO_SCENE = 'addedtoscene';$/;" r +enchant.Event.ADDED_TO_TIMELINE enchant.js /^enchant.Event.ADDED_TO_TIMELINE = "addedtotimeline";$/;" r +enchant.Event.A_BUTTON_DOWN enchant.js /^enchant.Event.A_BUTTON_DOWN = 'abuttondown';$/;" r +enchant.Event.A_BUTTON_UP enchant.js /^enchant.Event.A_BUTTON_UP = 'abuttonup';$/;" r +enchant.Event.B_BUTTON_DOWN enchant.js /^enchant.Event.B_BUTTON_DOWN = 'bbuttondown';$/;" r +enchant.Event.B_BUTTON_UP enchant.js /^enchant.Event.B_BUTTON_UP = 'bbuttonup';$/;" r +enchant.Event.CHILD_ADDED enchant.js /^enchant.Event.CHILD_ADDED = 'childadded';$/;" r +enchant.Event.CHILD_REMOVED enchant.js /^enchant.Event.CHILD_REMOVED = 'childremoved';$/;" r +enchant.Event.CORE_RESIZE enchant.js /^enchant.Event.CORE_RESIZE = 'coreresize';$/;" r +enchant.Event.DOWN_BUTTON_DOWN enchant.js /^enchant.Event.DOWN_BUTTON_DOWN = 'downbuttondown';$/;" r +enchant.Event.DOWN_BUTTON_UP enchant.js /^enchant.Event.DOWN_BUTTON_UP = 'downbuttonup';$/;" r +enchant.Event.ENTER enchant.js /^enchant.Event.ENTER = 'enter';$/;" r +enchant.Event.ENTER_FRAME enchant.js /^enchant.Event.ENTER_FRAME = 'enterframe';$/;" r +enchant.Event.ERROR enchant.js /^enchant.Event.ERROR = 'error';$/;" r +enchant.Event.EXIT enchant.js /^enchant.Event.EXIT = 'exit';$/;" r +enchant.Event.EXIT_FRAME enchant.js /^enchant.Event.EXIT_FRAME = 'exitframe';$/;" r +enchant.Event.INPUT_CHANGE enchant.js /^enchant.Event.INPUT_CHANGE = 'inputchange';$/;" r +enchant.Event.INPUT_END enchant.js /^enchant.Event.INPUT_END = 'inputend';$/;" r +enchant.Event.INPUT_START enchant.js /^enchant.Event.INPUT_START = 'inputstart';$/;" r +enchant.Event.LEFT_BUTTON_DOWN enchant.js /^enchant.Event.LEFT_BUTTON_DOWN = 'leftbuttondown';$/;" r +enchant.Event.LEFT_BUTTON_UP enchant.js /^enchant.Event.LEFT_BUTTON_UP = 'leftbuttonup';$/;" r +enchant.Event.LOAD enchant.js /^enchant.Event.LOAD = 'load';$/;" r +enchant.Event.PROGRESS enchant.js /^enchant.Event.PROGRESS = 'progress';$/;" r +enchant.Event.REMOVED enchant.js /^enchant.Event.REMOVED = 'removed';$/;" r +enchant.Event.REMOVED_FROM_SCENE enchant.js /^enchant.Event.REMOVED_FROM_SCENE = 'removedfromscene';$/;" r +enchant.Event.REMOVED_FROM_TIMELINE enchant.js /^enchant.Event.REMOVED_FROM_TIMELINE = "removedfromtimeline";$/;" r +enchant.Event.RENDER enchant.js /^enchant.Event.RENDER = 'render';$/;" r +enchant.Event.RIGHT_BUTTON_DOWN enchant.js /^enchant.Event.RIGHT_BUTTON_DOWN = 'rightbuttondown';$/;" r +enchant.Event.RIGHT_BUTTON_UP enchant.js /^enchant.Event.RIGHT_BUTTON_UP = 'rightbuttonup';$/;" r +enchant.Event.TOUCH_END enchant.js /^enchant.Event.TOUCH_END = 'touchend';$/;" r +enchant.Event.TOUCH_MOVE enchant.js /^enchant.Event.TOUCH_MOVE = 'touchmove';$/;" r +enchant.Event.TOUCH_START enchant.js /^enchant.Event.TOUCH_START = 'touchstart';$/;" r +enchant.Event.UP_BUTTON_DOWN enchant.js /^enchant.Event.UP_BUTTON_DOWN = 'upbuttondown';$/;" r +enchant.Event.UP_BUTTON_UP enchant.js /^enchant.Event.UP_BUTTON_UP = 'upbuttonup';$/;" r +enchant.EventTarget enchant.js /^enchant.EventTarget = enchant.Class.create({$/;" c +enchant.Group enchant.js /^enchant.Group = enchant.Class.create(enchant.Node, {$/;" c +enchant.Label enchant.js /^enchant.Label = enchant.Class.create(enchant.Entity, {$/;" c +enchant.LoadingScene enchant.js /^ * enchant.LoadingScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.LoadingScene enchant.js /^enchant.LoadingScene = enchant.Class.create(enchant.Scene, {$/;" c +enchant.Map enchant.js /^enchant.Map = enchant.Class.create(enchant.Entity, {$/;" c +enchant.Matrix enchant.js /^enchant.Matrix = enchant.Class.create({$/;" c +enchant.Node enchant.js /^enchant.Node = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.ParallelAction enchant.js /^enchant.ParallelAction = enchant.Class.create(enchant.Action, {$/;" c +enchant.Scene enchant.js /^enchant.Scene = enchant.Class.create(enchant.Group, {$/;" c +enchant.Sprite enchant.js /^enchant.Sprite = enchant.Class.create(enchant.Entity, {$/;" c +enchant.Surface enchant.js /^enchant.Surface = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.Surface._getPattern enchant.js /^enchant.Surface._getPattern = function(surface, force) {$/;" r +enchant.Surface.load enchant.js /^enchant.Surface.load = function(src, callback, onerror) {$/;" r +enchant.Timeline enchant.js /^enchant.Timeline = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.Tween enchant.js /^enchant.Tween = enchant.Class.create(enchant.Action, {$/;" c +enchant.WebAudioSound enchant.js /^enchant.WebAudioSound = enchant.Class.create(enchant.EventTarget, {$/;" c +enchant.WebAudioSound.load enchant.js /^enchant.WebAudioSound.load = function(src, type, callback, onerror) {$/;" r +error enchant.js /^ error: function(func) {$/;" r +excepted enchant.js /^ var excepted = ["frame", "time", "callback", "onactiontick", "onactionstart", "onactionend"];$/;" r +exec enchant.js /^ exec: function(func) {$/;" r +fadeIn enchant.js /^ fadeIn: function(time, easing) {$/;" r +fadeOut enchant.js /^ fadeOut: function(time, easing) {$/;" r +fadeTo enchant.js /^ fadeTo: function(opacity, time, easing) {$/;" r +fail enchant.js /^ fail: function(arg) {$/;" r +fall enchant.js /^ * fall: function() { ... }$/;" r +firstChild enchant.js /^ firstChild: {$/;" r +font enchant.js /^ font: {$/;" r +frame enchant.js /^ frame: {$/;" r +get enchant.js /^ get: function() {$/;" r +get enchant.js /^ get: function() {$/;" r +get enchant.js /^ get: function() {$/;" r +getBoundingRect enchant.js /^ getBoundingRect: function() {$/;" r +getConstructor enchant.js /^ getConstructor: function() {$/;" r +getDomElement enchant.js /^ getDomElement: function() {$/;" r +getDomElementAsNext enchant.js /^ getDomElementAsNext: function() {$/;" r +getElapsedTime enchant.js /^ getElapsedTime: function() {$/;" r +getMetrics enchant.js /^ getMetrics: function(text) {$/;" r +getNextManager enchant.js /^ getNextManager: function(manager) {$/;" r +getOrientedBoundingRect enchant.js /^ getOrientedBoundingRect: function() {$/;" r +getPixel enchant.js /^ getPixel: function(x, y) {$/;" r +getSpriteByColor enchant.js /^ getSpriteByColor: function(color) {$/;" r +getTime enchant.js /^ getTime: function() {$/;" r +height enchant.js /^ height: {$/;" r +height enchant.js /^ height: {$/;" r +hide enchant.js /^ hide: function() {$/;" r +hitTest enchant.js /^ hitTest: function(x, y) {$/;" r +id enchant.js /^ var id = 'enchant-audio' + enchant.Core.instance._soundID++;$/;" r +id enchant.js /^ var id = 'enchant-surface' + core._surfaceID++;$/;" r +image enchant.js /^ image: {$/;" r +image.context.fillStyle enchant.js /^ image.context.fillStyle = '#fff';$/;" r +image.context.fillStyle enchant.js /^ image.context.fillStyle = '#000';$/;" r +image.context.fillStyle enchant.js /^ image.context.fillStyle = '#fff';$/;" r +image.onerror enchant.js /^ image.onerror = function() {$/;" r +image.onload enchant.js /^ image.onload = function() {$/;" r +inheritMat enchant.js /^ inheritMat = [ 1, 0, 0, 1, 0, 0 ];$/;" r +initialize enchant.js /^ initialize: function() {$/;" r +initialize enchant.js /^ initialize: function(width, height) {$/;" r +initialize enchant.js /^ * initialize: function(){$/;" r +initialize enchant.js /^ initialize: function() {$/;" r +initialize enchant.js /^ initialize: function(node) {$/;" r +initialize enchant.js /^ initialize: function(node, elementDefinition) {$/;" r +initialize enchant.js /^ initialize: function(param) {$/;" r +initialize enchant.js /^ initialize: function(params) {$/;" r +initialize enchant.js /^ initialize: function(reso, max) {$/;" r +initialize enchant.js /^ initialize: function(text) {$/;" r +initialize enchant.js /^ initialize: function(tileWidth, tileHeight) {$/;" r +initialize enchant.js /^ initialize: function(type) {$/;" r +initialize enchant.js /^ initialize: function(width, height) {$/;" r +initialize enchant.js /^ * initialize: function(radius) { ... }, \/\/ Method definition.$/;" r +initialize enchant.js /^ * initialize: function(radius) { ... }, \/\/ Methodendefinitionen$/;" r +initialize enchant.js /^ * initialize: function(radius) { ... }, \/\/ メソッド定義$/;" r +initialize enchant.js /^ * initialize: function(radius) { \/\/ Overwrites constructor$/;" r +initialize enchant.js /^ * initialize: function(radius) { \/\/ überschreibt den Standardkonstruktor.$/;" r +initialize enchant.js /^ * initialize: function(radius) { \/\/ コンストラクタを上書きする +insertBefore enchant.js /^ insertBefore: function(node, reference) {$/;" r +intersect enchant.js /^ intersect: function(other) {$/;" r +intersectStrict enchant.js /^ intersectStrict: function(other) {$/;" r +keybind enchant.js /^ keybind: function(key, button) {$/;" r +keyunbind enchant.js /^ keyunbind: function(key) {$/;" r +l1 enchant.js /^ l1 = [ ltx1 - lbx1, lty1 - lby1 ],$/;" r +l2 enchant.js /^ l2 = [ ltx2 - lbx2, lty2 - lby2 ],$/;" r +lastChild enchant.js /^ lastChild: {$/;" r +leftBottom enchant.js /^ leftBottom: [ m21h + mdx, m22h + mdy ],$/;" r +leftTop enchant.js /^ leftTop: [ mdx, mdy ],$/;" r +load enchant.js /^ load: function(src, alias, callback, onerror) {$/;" r +loadData enchant.js /^ loadData: function(data) {$/;" r +loadFunc enchant.js /^ loadFunc = function() {$/;" r +loop enchant.js /^ loop: function() {$/;" r +makeTransformMatrix enchant.js /^ makeTransformMatrix: function(node, dest) {$/;" r +mat enchant.js /^ var mat = [];$/;" r +matrix enchant.js /^ matrix: [1, 0, 0, 1, 0, 0],$/;" r +moveBy enchant.js /^ moveBy: function(x, y) {$/;" r +moveBy enchant.js /^ moveBy: function(x, y, time, easing) {$/;" r +moveTo enchant.js /^ moveTo: function(x, y) {$/;" r +moveTo enchant.js /^ moveTo: function(x, y, time, easing) {$/;" r +moveX enchant.js /^ moveX: function(x, time, easing) {$/;" r +moveY enchant.js /^ moveY: function(y, time, easing) {$/;" r +multiply enchant.js /^ multiply: function(m1, m2, dest) {$/;" r +multiplyVec enchant.js /^ multiplyVec: function(mat, vec, dest) {$/;" r +newmat enchant.js /^ newmat = [];$/;" r +next enchant.js /^ next: function(remaining) {$/;" r +next enchant.js /^ next: function(func) {$/;" r +next enchant.js /^ next: function(remainingTime) {$/;" r +node.__styleStatus enchant.js /^ node.__styleStatus = {};$/;" r +node._cvsCache enchant.js /^ node._cvsCache = {};$/;" r +node._cvsCache.detectColor enchant.js /^ node._cvsCache.detectColor = 'rgba(' + layer._colorManager.attachDetectColor(node) + ')';$/;" r +node._cvsCache.matrix enchant.js /^ node._cvsCache.matrix = [ 1, 0, 0, 1, 0, 0 ];$/;" r +node._style enchant.js /^ node._style = {};$/;" r +o enchant.js /^ var o = {};$/;" r +on enchant.js /^ on: function() {$/;" r +onactiontick enchant.js /^ onactiontick: function(evt) {$/;" r +onloadTimeSetter enchant.js /^ var onloadTimeSetter = function() {$/;" r +onxbuttondown enchant.js /^ var onxbuttondown = function(e) {$/;" r +onxbuttonup enchant.js /^ var onxbuttonup = function(e) {$/;" r +opacity enchant.js /^ opacity: {$/;" r +or enchant.js /^ or: function() {$/;" r +origin enchant.js /^ var origin = {};$/;" r +originX enchant.js /^ originX: {$/;" r +originY enchant.js /^ originY: {$/;" r +pause enchant.js /^ pause: function() {$/;" r +pause enchant.js /^ pause: function() {$/;" r +play enchant.js /^ play: function() {$/;" r +play enchant.js /^ play: function(dup) {$/;" r +popScene enchant.js /^ popScene: function() {$/;" r +poss1 enchant.js /^ poss1 = [ lt1, rt1, rb1, lb1 ];$/;" r +poss2 enchant.js /^ poss2 = [ lt2, rt2, rb2, lb2 ];$/;" r +preload enchant.js /^ preload: function(assets) {$/;" r +pushScene enchant.js /^ pushScene: function(scene) {$/;" r +r1 enchant.js /^ r1 = [ rbx1 - rtx1, rby1 - rty1 ],$/;" r +r2 enchant.js /^ r2 = [ rbx2 - rtx2, rby2 - rty2 ],$/;" r +redraw enchant.js /^ redraw: function(x, y, width, height) {$/;" r +remove enchant.js /^ remove: function() {$/;" r +removeChild enchant.js /^ removeChild: function(node) {$/;" r +removeEventListener enchant.js /^ removeEventListener: function(type, listener) {$/;" r +removeFromScene enchant.js /^ removeFromScene: function() {$/;" r +removeManager enchant.js /^ removeManager: function(childManager) {$/;" r +removeScene enchant.js /^ removeScene: function(scene) {$/;" r +render enchant.js /^ render: function(ctx, node, e) {$/;" r +render enchant.js /^ render: function(inheritMat) {$/;" r +repeat enchant.js /^ repeat: function(func, time) {$/;" r +replaceScene enchant.js /^ replaceScene: function(scene) {$/;" r +req.onreadystatechange enchant.js /^ req.onreadystatechange = function() {$/;" r +reset enchant.js /^ reset: function() {$/;" r +resume enchant.js /^ resume: function() {$/;" r +resume enchant.js /^ resume: function() {$/;" r +ret enchant.js /^ var ret = [];$/;" r +ret enchant.js /^ var ret = {};$/;" r +ret enchant.js /^ var ret = [];$/;" r +rightBottom enchant.js /^ rightBottom: [ m11w + m21h + mdx, m12w + m22h + mdy ]$/;" r +rightTop enchant.js /^ rightTop: [ m11w + mdx, m12w + mdy ],$/;" r +rotate enchant.js /^ rotate: function(deg) {$/;" r +rotateBy enchant.js /^ rotateBy: function(deg, time, easing) {$/;" r +rotateTo enchant.js /^ rotateTo: function(deg, time, easing) {$/;" r +rotation enchant.js /^ rotation: function() {$/;" r +rotation enchant.js /^ rotation: {$/;" r +scale enchant.js /^ scale: {$/;" r +scale enchant.js /^ scale: function(x, y) {$/;" r +scaleBy enchant.js /^ scaleBy: function(scale, time, easing) {$/;" r +scaleTo enchant.js /^ scaleTo: function(scale, time, easing) {$/;" r +scaleX enchant.js /^ scaleX: function() {$/;" r +scaleX enchant.js /^ scaleX: function() {$/;" r +scaleX enchant.js /^ scaleX: {$/;" r +scaleY enchant.js /^ scaleY: function() {$/;" r +scaleY enchant.js /^ scaleY: function() {$/;" r +scaleY enchant.js /^ scaleY: {$/;" r +scene.backgroundColor enchant.js /^ scene.backgroundColor = '#000';$/;" r +set enchant.js /^ set: function(time) {$/;" r +set enchant.js /^ set: function(volume) {$/;" r +set enchant.js /^ set: function(h) {$/;" r +set enchant.js /^ set: function(s) {$/;" r +set enchant.js /^ set: function(w) {$/;" r +set enchant.js /^ set: function(color) {$/;" r +set enchant.js /^ set: function(dirty) {$/;" r +set enchant.js /^ set: function(enabled) {$/;" r +set enchant.js /^ set: function(font) {$/;" r +set enchant.js /^ set: function(frame) {$/;" r +set enchant.js /^ set: function(height) {$/;" r +set enchant.js /^ set: function(image) {$/;" r +set enchant.js /^ set: function(opacity) {$/;" r +set enchant.js /^ set: function(originX) {$/;" r +set enchant.js /^ set: function(originY) {$/;" r +set enchant.js /^ set: function(rotation) {$/;" r +set enchant.js /^ set: function(scale) {$/;" r +set enchant.js /^ set: function(scaleX) {$/;" r +set enchant.js /^ set: function(scaleY) {$/;" r +set enchant.js /^ set: function(text) {$/;" r +set enchant.js /^ set: function(textAlign) {$/;" r +set enchant.js /^ set: function(tileHeight) {$/;" r +set enchant.js /^ set: function(tileWidth) {$/;" r +set enchant.js /^ set: function(time) {$/;" r +set enchant.js /^ set: function(visible) {$/;" r +set enchant.js /^ set: function(volume) {$/;" r +set enchant.js /^ set: function(width) {$/;" r +set enchant.js /^ set: function(x) {$/;" r +set enchant.js /^ set: function(y) {$/;" r +setFrameBased enchant.js /^ setFrameBased: function() {$/;" r +setLayer enchant.js /^ setLayer: function(layer) {$/;" r +setPixel enchant.js /^ setPixel: function(x, y, r, g, b, a) {$/;" r +setTimeBased enchant.js /^ setTimeBased: function() {$/;" r +show enchant.js /^ show: function() {$/;" r +skip enchant.js /^ skip: function(frames) {$/;" r +sprite.frame enchant.js /^ * sprite.frame = [0, 1, 0, 2, null]$/;" r +sprite.frame enchant.js /^ * sprite.frame = [0, 1, 0, 2]$/;" r +sprite.image.context.fillStyle enchant.js /^ sprite.image.context.fillStyle = '#fff';$/;" r +stage.id enchant.js /^ stage.id = 'enchant-stage';$/;" r +stage.style.fontSize enchant.js /^ stage.style.fontSize = '12px';$/;" r +stage.style.position enchant.js /^ stage.style.position = 'absolute';$/;" r +stage.style.position enchant.js /^ stage.style.position = 'relative';$/;" r +stage.style.webkitTapHighlightColor enchant.js /^ stage.style.webkitTapHighlightColor = 'rgba(0, 0, 0, 0)';$/;" r +stage.style.webkitTextSizeAdjust enchant.js /^ stage.style.webkitTextSizeAdjust = 'none';$/;" r +start enchant.js /^ start: function(deferred) {$/;" r +stop enchant.js /^ stop: function() {$/;" r +stop enchant.js /^ stop: function() {$/;" r +submodules enchant.js /^ var submodules = [],$/;" r +t1 enchant.js /^ t1 = [ rtx1 - ltx1, rty1 - lty1 ],$/;" r +t2 enchant.js /^ t2 = [ rtx2 - ltx2, rty2 - lty2 ],$/;" r +target enchant.js /^ target = 'Canvas';$/;" r +target enchant.js /^ target = 'Dom';$/;" r +target enchant.js /^ var target = {};$/;" r +text enchant.js /^ text = '' + text;$/;" r +text enchant.js /^ text: {$/;" r +textAlign enchant.js /^ textAlign: {$/;" r +then enchant.js /^ then: function(func) {$/;" r +this.__styleStatus enchant.js /^ this.__styleStatus = {};$/;" r +this._assets enchant.js /^ var assets = this._assets = [];$/;" r +this._css enchant.js /^ this._css = '-moz-element(#' + id + ')';$/;" r +this._css enchant.js /^ this._css = '-webkit-canvas(' + id + ')';$/;" r +this._cvsCache enchant.js /^ this._cvsCache = {$/;" r +this._data enchant.js /^ this._data = [$/;" r +this._debugColor enchant.js /^ this._debugColor = '#0000ff';$/;" r +this._debugColor enchant.js /^ this._debugColor = '#ff0000';$/;" r +this._detect.style.position enchant.js /^ this._detect.style.position = 'absolute';$/;" r +this._dispatchExitframe enchant.js /^ this._dispatchExitframe = function() {$/;" r +this._domRef enchant.js /^ this._domRef = [];$/;" r +this._element.style.overflow enchant.js /^ this._element.style.overflow = 'hidden';$/;" r +this._element.style.position enchant.js /^ this._element.style.position = 'absolute';$/;" r +this._element.style.position enchant.js /^ this._element.style.position = 'absolute';$/;" r +this._element.style.top enchant.js /^ this._element.style.left = this._element.style.top = '0px';$/;" r +this._frameSequence enchant.js /^ this._frameSequence = [];$/;" r +this._frameSequence enchant.js /^ this._frameSequence = [];$/;" r +this._frameSequence enchant.js /^ this._frameSequence = [];$/;" r +this._internalButtondownListeners enchant.js /^ this._internalButtondownListeners = {};$/;" r +this._internalButtonupListeners enchant.js /^ this._internalButtonupListeners = {};$/;" r +this._layerPriority enchant.js /^ this._layerPriority = [];$/;" r +this._layers enchant.js /^ this._layers = {};$/;" r +this._listeners enchant.js /^ this._listeners = {};$/;" r +this._listeners enchant.js /^ this._listeners = {};$/;" r +this._matrix enchant.js /^ this._matrix = [ 1, 0, 0, 1, 0, 0 ];$/;" r +this._nodeEventListener enchant.js /^ this._nodeEventListener = function(e) {$/;" r +this._scenes enchant.js /^ this._scenes = [];$/;" r +this._setDomTarget enchant.js /^ this._setDomTarget = function() {$/;" r +this._style enchant.js /^ this._style = {};$/;" r +this._style.pointerEvents enchant.js /^ this._style.pointerEvents = 'all';$/;" r +this._style.pointerEvents enchant.js /^ this._style.pointerEvents = 'none';$/;" r +this._style.webkitTransform enchant.js /^ this._style.webkitTransform = 'scale(0.5)';$/;" r +this._style.webkitTransformOrigin enchant.js /^ this._style.webkitTransformOrigin = '0 0';$/;" r +this.actions enchant.js /^ this.actions = [];$/;" r +this.assets enchant.js /^ this.assets = {};$/;" r +this.backgroundColor enchant.js /^ this.backgroundColor = '#000';$/;" r +this.backgroundColor enchant.js /^ * this.backgroundColor = 'red';$/;" r +this.childNodes enchant.js /^ this.childNodes = [];$/;" r +this.easing enchant.js /^ this.easing = function(t, b, c, d) {$/;" r +this.endedActions enchant.js /^ this.endedActions = [];$/;" r +this.endedActions enchant.js /^ this.endedActions = [];$/;" r +this.font enchant.js /^ this.font = '14px serif';$/;" r +this.input enchant.js /^ this.input = {};$/;" r +this.queue enchant.js /^ this.queue = [];$/;" r +this.reference enchant.js /^ this.reference = [];$/;" r +this.stack enchant.js /^ this.stack = [];$/;" r +this.style.border enchant.js /^ this.style.border = '1px solid blue';$/;" r +this.style.margin enchant.js /^ this.style.margin = '-1px';$/;" r +this.style.position enchant.js /^ this.style.position = 'absolute';$/;" r +this.textAlign enchant.js /^ this.textAlign = 'left';$/;" r +tick enchant.js /^ tick: function(enterFrameEvent) {$/;" r +tileHeight enchant.js /^ tileHeight: {$/;" r +tileWidth enchant.js /^ tileWidth: {$/;" r +timeline enchant.js /^ var i, len, timeline = {$/;" r +toDataURL enchant.js /^ toDataURL: function() {$/;" r +touch enchant.js /^ var touch = [$/;" r +touchEnabled enchant.js /^ touchEnabled: {$/;" r +transform enchant.js /^ transform: function(ctx, node) {$/;" r +tree enchant.js /^ var tree = [ node ];$/;" r +tween enchant.js /^ tween: function(params) {$/;" r +type enchant.js /^ type = '';$/;" r +type enchant.js /^ type = 'audio\/' + ext;$/;" r +unloop enchant.js /^ unloop: function() {$/;" r +updateBoundArea enchant.js /^ updateBoundArea: function() {$/;" r +vec enchant.js /^ var vec = [ ox, oy ];$/;" r +vec enchant.js /^ vec = [ ox, oy ];$/;" r +vec enchant.js /^ var vec = [ ox, oy ];$/;" r +visible enchant.js /^ visible: {$/;" r +volume enchant.js /^ volume: {$/;" r +volume enchant.js /^ volume: {$/;" r +wait enchant.js /^ wait: function(time) {$/;" r +waitAll enchant.js /^ waitAll: function() {$/;" r +waitUntil enchant.js /^ waitUntil: function(func) {$/;" r +width enchant.js /^ width: {$/;" r +width enchant.js /^ width: {$/;" r +within enchant.js /^ within: function(other, distance) {$/;" r +x enchant.js /^ x: function() {$/;" r +x enchant.js /^ x: {$/;" r +xhr.onload enchant.js /^ xhr.onload = function() {$/;" r +xhr.responseType enchant.js /^ xhr.responseType = 'arraybuffer';$/;" r +xw enchant.js /^ var xw = [ mdx, m11w + mdx, m21h + mdx, m11w + m21h + mdx ].sort(function(a, b) { return a - b; });$/;" r +y enchant.js /^ y: function() {$/;" r +y enchant.js /^ y: {$/;" r +yh enchant.js /^ var yh = [ mdy, m12w + mdy, m22h + mdy, m12w + m22h + mdy ].sort(function(a, b) { return a - b; });$/;" r +_collisionData init.js /^_collisionData = [$/;" r +_mapData init.js /^_mapData = [$/;" r +  script.type init.js /^  script.type = 'text\/javascript';$/;" r +! jkl-parsexml.js /^ if ( text.charAt(nextquote+1) != '"' ) {$/;" r +! jkl-parsexml.js /^ if ( typeof(key) != "string" ) continue;$/;" r +! jkl-parsexml.js /^ if ( typeof(key) != "string" ) continue;$/;" r +! jkl-parsexml.js /^ if ( typeof(this.req.overrideMimeType) != "undefined" && ! this.textmode ) {$/;" r +! jkl-parsexml.js /^ if ( typeof(this.req.send) != "undefined" ) {$/;" r +! jkl-parsexml.js /^ if ( typeof(this.req.setRequestHeader) != "undefined" ) {$/;" r +! jkl-parsexml.js /^ } else if ( typeof(this.req.load) != "undefined" ) {$/;" r +! jkl-parsexml.js /^\/\/ if ( typeof(this.req.setRequestHeader) != "undefined" ) {$/;" r +JKL jkl-parsexml.js /^if ( typeof(JKL) == 'undefined' ) JKL = function() {};$/;" r +JKL.ParseXML jkl-parsexml.js /^JKL.ParseXML = function ( url, query, method ) {$/;" r +JKL.ParseXML.CSV jkl-parsexml.js /^JKL.ParseXML.CSV = function ( url, query, method ) {$/;" r +JKL.ParseXML.CSV.prototype.parseCSV jkl-parsexml.js /^JKL.ParseXML.CSV.prototype.parseCSV = function ( text ) {$/;" r +JKL.ParseXML.CSV.prototype.parseResponse jkl-parsexml.js /^JKL.ParseXML.CSV.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.CSVmap jkl-parsexml.js /^JKL.ParseXML.CSVmap = function ( url, query, method ) {$/;" r +JKL.ParseXML.CSVmap.prototype.parseResponse jkl-parsexml.js /^JKL.ParseXML.CSVmap.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.DOM jkl-parsexml.js /^JKL.ParseXML.DOM = function ( url, query, method ) {$/;" r +JKL.ParseXML.DOM.prototype.parseResponse jkl-parsexml.js /^JKL.ParseXML.DOM.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.HTTP jkl-parsexml.js /^JKL.ParseXML.HTTP = function( url, query, method, textmode ) {$/;" r +JKL.ParseXML.HTTP.ACTIVEX_XMLDOM jkl-parsexml.js /^JKL.ParseXML.HTTP.ACTIVEX_XMLDOM = "Microsoft.XMLDOM"; \/\/ Msxml2.DOMDocument.5.0$/;" r +JKL.ParseXML.HTTP.ACTIVEX_XMLHTTP jkl-parsexml.js /^JKL.ParseXML.HTTP.ACTIVEX_XMLHTTP = "Microsoft.XMLHTTP"; \/\/ Msxml2.XMLHTTP.3.0$/;" r +JKL.ParseXML.HTTP.EPOCH_TIMESTAMP jkl-parsexml.js /^JKL.ParseXML.HTTP.EPOCH_TIMESTAMP = "Thu, 01 Jun 1970 00:00:00 GMT"$/;" r +JKL.ParseXML.HTTP.REQUEST_TYPE jkl-parsexml.js /^JKL.ParseXML.HTTP.REQUEST_TYPE = "application\/x-www-form-urlencoded";$/;" r +JKL.ParseXML.HTTP.prototype.async jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.async = function( func ) {$/;" r +JKL.ParseXML.HTTP.prototype.checkResponse jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.checkResponse = function() {$/;" r +JKL.ParseXML.HTTP.prototype.documentElement jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.documentElement = function() {$/;" r +JKL.ParseXML.HTTP.prototype.load jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.load = function() {$/;" r +JKL.ParseXML.HTTP.prototype.responseText jkl-parsexml.js /^JKL.ParseXML.HTTP.prototype.responseText = function() {$/;" r +JKL.ParseXML.JSON jkl-parsexml.js /^JKL.ParseXML.JSON = function ( url, query, method ) {$/;" r +JKL.ParseXML.JSON.prototype.parseResponse jkl-parsexml.js /^JKL.ParseXML.JSON.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.LoadVars jkl-parsexml.js /^JKL.ParseXML.LoadVars = function ( url, query, method ) {$/;" r +JKL.ParseXML.LoadVars.prototype.parseResponse jkl-parsexml.js /^JKL.ParseXML.LoadVars.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.MAP_NODETYPE jkl-parsexml.js /^JKL.ParseXML.MAP_NODETYPE = [$/;" r +JKL.ParseXML.MIME_TYPE_XML jkl-parsexml.js /^JKL.ParseXML.MIME_TYPE_XML = "text\/xml";$/;" r +JKL.ParseXML.Text jkl-parsexml.js /^JKL.ParseXML.Text = function ( url, query, method ) {$/;" r +JKL.ParseXML.Text.prototype.parseResponse jkl-parsexml.js /^JKL.ParseXML.Text.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.VERSION jkl-parsexml.js /^JKL.ParseXML.VERSION = "0.22";$/;" r +JKL.ParseXML.prototype.addNode jkl-parsexml.js /^JKL.ParseXML.prototype.addNode = function ( hash, key, cnts, val ) {$/;" r +JKL.ParseXML.prototype.async jkl-parsexml.js /^JKL.ParseXML.prototype.async = function ( func, args ) {$/;" r +JKL.ParseXML.prototype.onerror jkl-parsexml.js /^JKL.ParseXML.prototype.onerror = function ( func, args ) {$/;" r +JKL.ParseXML.prototype.parse jkl-parsexml.js /^JKL.ParseXML.prototype.parse = function () {$/;" r +JKL.ParseXML.prototype.parseDocument jkl-parsexml.js /^JKL.ParseXML.prototype.parseDocument = function ( root ) {$/;" r +JKL.ParseXML.prototype.parseElement jkl-parsexml.js /^JKL.ParseXML.prototype.parseElement = function ( elem ) {$/;" r +JKL.ParseXML.prototype.parseResponse jkl-parsexml.js /^JKL.ParseXML.prototype.parseResponse = function () {$/;" r +JKL.ParseXML.prototype.setOutputArray jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArray = function ( mode ) {$/;" r +JKL.ParseXML.prototype.setOutputArrayAll jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayAll = function () {$/;" r +JKL.ParseXML.prototype.setOutputArrayAuto jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayAuto = function () {$/;" r +JKL.ParseXML.prototype.setOutputArrayElements jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayElements = function ( list ) {$/;" r +JKL.ParseXML.prototype.setOutputArrayNever jkl-parsexml.js /^JKL.ParseXML.prototype.setOutputArrayNever = function () {$/;" r +check_func jkl-parsexml.js /^ var check_func = function () {$/;" r +cnt jkl-parsexml.js /^ var cnt = {};$/;" r +data jkl-parsexml.js /^ var data = [];$/;" r +hash jkl-parsexml.js /^ var hash = {};$/;" r +hash jkl-parsexml.js /^ var hash = {};$/;" r +hash jkl-parsexml.js /^ var hash = {};$/;" r +hash[list[i]] jkl-parsexml.js /^ hash[list[i]] = "";$/;" r +json jkl-parsexml.js /^ var json = {};$/;" r +line jkl-parsexml.js /^ var line = [];$/;" r +mode jkl-parsexml.js /^ mode = [ mode ]; \/\/ string into array$/;" r +proc jkl-parsexml.js /^ var proc = function() {$/;" r +ret jkl-parsexml.js /^ ret = [ ret ];$/;" r +retval jkl-parsexml.js /^ if ( ! retval ) retval = "";$/;" r +retval jkl-parsexml.js /^ if ( ! retval ) retval = {};$/;" r +retval jkl-parsexml.js /^ retval = {};$/;" r +table jkl-parsexml.js /^ var table = [];$/;" r +this.method jkl-parsexml.js /^ this.method = "GET";$/;" r +this.method jkl-parsexml.js /^ this.method = "POST";$/;" r +this.query jkl-parsexml.js /^ this.query = "";$/;" r +Action main.js /^ var Action = enchant.Class.create({$/;" c +EAction main.js /^var EAction = {$/;" r +ECommand main.js /^var ECommand = {$/;" r +EDirection main.js /^var EDirection = {$/;" r +EFieldPos main.js /^var EFieldPos = {$/;" r +EMenuPos main.js /^var EMenuPos = {$/;" r +EResPath main.js /^var EResPath = {$/;" r +Food main.js /^ var Food = enchant.Class.create(enchant.Sprite,{$/;" c +Marisa main.js /^ var Marisa = enchant.Class.create(Yukkuri,{$/;" c +Okazari main.js /^ var Okazari = enchant.Class.create(enchant.Sprite,{$/;" c +Player main.js /^ var Player = enchant.Class.create(Marisa,{$/;" c +Yukkuri main.js /^ var Yukkuri = enchant.Class.create(enchant.Sprite,{$/;" c +_loadArr main.js /^ var _loadArr = [];$/;" r +act main.js /^ act : function(){$/;" r +act main.js /^ act: function(){$/;" r +animation main.js /^ animation: function(){$/;" r +changeFace main.js /^ changeFace: function(erespath){$/;" r +dead main.js /^ dead : function(){$/;" r +destruct main.js /^ destruct: function(){$/;" r +fieldBg.image.context.fillStyle main.js /^ \/\/ fieldBg.image.context.fillStyle = '#ff0000';$/;" r +game.onload main.js /^ game.onload = function(){$/;" r +info.color main.js /^ \/\/ info.color = "#ffffff";$/;" r +info.font main.js /^ \/\/ info.font = "14px 'Times New Roman'";$/;" r +initialize main.js /^ initialize: function (type, x, y){$/;" r +initialize main.js /^ initialize: function (yukkuri){$/;" r +initialize main.js /^ initialize: function(){$/;" r +initialize main.js /^ initialize: function(x, y){$/;" r +isDead main.js /^ isDead: function(){$/;" r +loadParamsXML main.js /^ loadParamsXML: function(url){$/;" r +menuSurface.context.fillStyle main.js /^ menuSurface.context.fillStyle = '#000';$/;" r +moveBy main.js /^ moveBy:function(x, y, time){$/;" r +moveTo main.js /^ moveTo:function(x, y, time){$/;" r +moveX main.js /^ moveX: function(x){$/;" r +moveY main.js /^ moveY: function(y){$/;" r +reverse main.js /^ reverse:function(){$/;" r +runEnterframe main.js /^ runEnterframe:function(){$/;" r +runHungry main.js /^ runHungry: function(){$/;" r +runYukkuri main.js /^ runYukkuri: function(){$/;" r +search main.js /^ search : function(){$/;" r +this.runEnterframe main.js /^ \/\/ this.runEnterframe = function(){$/;" r +tweet main.js /^ tweet:function(text){$/;" r +walk main.js /^ walk : function(retryCounter){$/;" r +window.onload main.js /^window.onload = function(){$/;" r +Informationen mixing.enchant.js /^ * Weiterführende Informationen: {@link enchant.Class.mixClasses}, {@link enchant.Class.MixingRecipe.createFromClass}, $/;" r +add mixing.enchant.js /^ * add : function(value) {$/;" r +also mixing.enchant.js /^ *

Both classes will not be modified.<\/p> See also: {@link enchant.Class.MixingRecipe}$/;" r +also mixing.enchant.js /^ * The target class is not modified directly.
See also: {@link enchant.Class.MixingRecipe}.$/;" r +auch mixing.enchant.js /^ *

Siehe auch: {@link enchant.Class.mixClasses}, {@link enchant.Class.mixClassesFromRecipe} und {@link enchant.Class.applyMixingRecipe}.<\/p>$/;" r +auch mixing.enchant.js /^ *

Beide Klassen werden nicht verändert.<\/p> Siehe auch: {@link enchant.Class.MixingRecipe}$/;" r +auch mixing.enchant.js /^ * Die Zielklasse wird nicht modifiziert.
Siehe auch: {@link enchant.Class.MixingRecipe}.$/;" r +createFromPrototype mixing.enchant.js /^ var createFromPrototype = function(decorate,override,properties,source,onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) {$/;" r +createFromPrototypeNonRecursive mixing.enchant.js /^ var createFromPrototypeNonRecursive = function(decorate, override, properties, source, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) {$/;" r +decorate mixing.enchant.js /^ var decorate = {};$/;" r +decorateFunctionFactory mixing.enchant.js /^ var decorateFunctionFactory = function(srcFunction, currentFunctionName) {$/;" r +enchant.Class.MixingRecipe mixing.enchant.js /^ enchant.Class.MixingRecipe = enchant.Class.create({$/;" c +enchant.Class.MixingRecipe.createFromClass mixing.enchant.js /^ enchant.Class.MixingRecipe.createFromClass = function(sourceClass, onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) {$/;" r +enchant.Class.applyMixingRecipe mixing.enchant.js /^ enchant.Class.applyMixingRecipe = function(target, source) {$/;" r +enchant.Class.mixClasses mixing.enchant.js /^ enchant.Class.mixClasses = function(firstClass, secondClass, useOnlyOwnPropertiesForSecondClass, initializeMethod) {$/;" r +enchant.Class.mixClassesFromRecipe mixing.enchant.js /^ enchant.Class.mixClassesFromRecipe = function(firstClass, secondClass, recipe, initializeMethod) {$/;" r +get mixing.enchant.js /^ * get: function() {$/;" r +get mixing.enchant.js /^ * get: function() {$/;" r +getFunctionParams mixing.enchant.js /^ var getFunctionParams = function(methodString) {$/;" r +initialize mixing.enchant.js /^ initialize : function(decorateMethods, overrideMethods, properties) {$/;" r +initializeMethod mixing.enchant.js /^ initializeMethod = function() {$/;" r +mult mixing.enchant.js /^ * mult : function(value) {$/;" r +multipleMixingCombinationFunctionFactory mixing.enchant.js /^ var multipleMixingCombinationFunctionFactory = function(oldFunc,newFunc, key) {$/;" r +myProperty mixing.enchant.js /^ * myProperty : {$/;" r +override mixing.enchant.js /^ var override = {};$/;" r +properties mixing.enchant.js /^ var properties = {};$/;" r +result mixing.enchant.js /^ var result = enchant.Class.create(target,{});$/;" c +set mixing.enchant.js /^ * set : function(val) {$/;" r +set mixing.enchant.js /^ * set : function(val) {$/;" r +sub mixing.enchant.js /^ * sub : function(value) {$/;" r +voidFunction mixing.enchant.js /^ var voidFunction = function(){};$/;" r +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_PROGRAM_VERSION 5.8J2 // +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_JP_AUTHOR HIGASHI Hirohito /Twitter: @h_east/ +!_TAG_FILE_ENCODING cp932 // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_JP_URL http://hp.vector.co.jp/authors/VA025040/ // +$/;" r diff --git a/data/chara1.edg b/data/chara1.edg new file mode 100644 index 0000000000000000000000000000000000000000..057e8d23fb3eca100c0565e9cbc305896fae8d8e GIT binary patch literal 5592 zcmeH~OKep|7{}+H+m>5;l?qq^9jG7{DUVut6y#AVMP7vqA}SiCVrzL=keAgBuEeTD zNqodev~i_|mAWvxH^ithE_7oeD}#x$F-95<_5c6ReCOOgVoWqKF-$UZe)Ipnd7N+N z%$?i5_Re;v)QXaMobztT4YdpneSNmAt!;2{@bu}nUysZmSTpCy!DZ)O=sj5~{qRN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`_eAIZV?1s6 z?aV1VRTf1?{Aad;2XMIafQFmH-xr6U8l`Z6JD1v9qhSr6SS{yx`04-`;0y{1JCMS= zg8&Cu0B$QOTyp{Umw@|Az-=YqZW3@433$i|c(w?p8`K+cTgk+4Lcq-^;64>_3k&8M zEHK~~DHFd@0gn^`KVJdAY{7Da6$X@LYBgvxSZlD(V7XTY9nV|RZ7z(Z53 literal 0 HcmV?d00001 diff --git a/data/chara1.png b/data/chara1.png new file mode 100644 index 0000000000000000000000000000000000000000..d47949c534c6debec96f4da13b6fb2b0a28eb34b GIT binary patch literal 1409 zcmeAS@N?(olHy`uVBq!ia0vp^3xGI*gBeJ!{n@#ifq|JJz$e6&;XlKFi~s*Gt#NX4 z`uX$c#EDK{i**+`Y82;Np6JPI4+wa6*67`qX+T}0U^E1VUkI?etUU_!6=O+|UoeBi zvm0p)3{3i-E{-7;bKc%OUDl$&!;>n7>l-_y71$f8xXzW%-^ zY64g1m%$Q2@f@P$4Z^;P>f?-bwxn!z@fu(v7!y`Y)n&j z6~-}Mx;2emO>M#XeyG3q?n}YOX?jK9p-h7+RvnNEdV=fcRjioi~8>HFuq}ir~J6Chz;<*NypN;s=b8=d4xHskX+*$WK`MVfyRyH%=?-KZ6 z@W7w3-=5>k<#WLeb$7&A^wziE_`Oe+cg;C(+YR>xL>m_i)h)AG)O6VJ7)#>si$8fD zupj%bD)MPBr%U47$;?c@yNfn>ZMtyX?jqN-=HD4YTFm0B6nv(83jOL*f2Mt4=Z4!H zs*MaUxBnBl@mz#0iS=Pkw8pFC1D|_dKgqiD(xuUz>0OM4YTEoaD+{Oi}(Y112n_VGkU`#HDH`FGjn z;ny99UKh4DW_@+#zSuNj_5sd02RLhlF8q4M?EFq?fj;MjMUNUR+8Z`hJ0ur5bM9o4 zFrQ*~;Z~Rj<7pYDV=En#i~0=P8y{}w-!e@==zvvwf@|F&2Z+`mS(~^zpE0B9ktpU^F)Lmq**f5{BAmJx8aoNfvGIZe(Rhx zbohMl--AO8r{^%tc&2em&_P;S+J0t1;UOuH=WL80y^}t#^%iG%G`;2AU9*GVbQh}M z*r!^j9=P||hph&U_N;B~Yx$4t)GM%M(J7mB=SRJ^Xzg1+r>7;1ch(D?cyeRz64pz~ zenZ>{49{hZKE#tvU=GUPPzcvJLpS3G^f8sv#q0DC% z7v}uASi-(x-TJz+PrXwGR(!EgxE=YF_2(T61^pVP38G30+A>^Ea}5Hk^_>h|*Y%*nsD|Nesmpj7GU>gTe~DWM4fGg|S} literal 0 HcmV?d00001 diff --git a/data/layer/face_1.png b/data/layer/face_1.png new file mode 100644 index 0000000000000000000000000000000000000000..697d7444d6eb3e3c6ffa278616465840199781c3 GIT binary patch literal 1026 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz|0Wf6XMG7pW(m7|NocPI5|1} z{P}a@M5nLCx(ggNit{Z`^yIY%1Ux%y^lr;EpsrCc8Un*F1Xx|x9tHYpucwP+NX4AD zSEKn_6nIzzCf{B)yWszA5iSj`8MkJxpZV>y*_S0YLd)MCo*`3kfRSCM;DJBGlO5By zFgPT{bq0hxRjIQvJc?rMVz`)8C;E#aC6&9wK|GNmfN7O2OM)rG!q*HcmAnPK2CExO zqAsN{O%mYMYoE9EnbfiO3o1QxpK=Bqf6pwT7RB&4-!!1~>u*tq|G%ytXj5%3Y%+2Z z={ca&c#$K@fknE2%j|)`nFE>;jrZ)I$$pUFv-lvIz+P;){_Ewx2D3rYvd$@? F2>?~sb=d#_ literal 0 HcmV?d00001 diff --git a/data/layer/marisa_000.png b/data/layer/marisa_000.png new file mode 100644 index 0000000000000000000000000000000000000000..c1032639b46445045f9d7263a216dad3588c4c3f GIT binary patch literal 1195 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz|0Wf6XMG7pW(m7|NocPI5|1} z{P}a@M5nLCx(ggNit{Z`^yIY%1Ux%y^lr;EpsrCc8Un*F1Xx|x9%W!)O!IVc45^s& z_L^tWVFdx!fNS%O3;t&>Q>pr4lECbxwQ|bMh;3K<)6}N6tJXH~e|XH0Wy$>RLXGI2 zlD3AUMKcAM6GUv)trEm^k3>5ho<2E)adq81cNM7vi*Nn-z-!#_=wi*WywoO!dTzx4 zyO*tk4C@>pKY4g8vn+sX<@)%B)!Vl`JJoEplX+HHR*j(NzxMslG$k&4nbKK2WBd8P$s9Wnw8zhf^@GHVWBIHNj20|ijQiTAvA%!DpwpAc>X6;o zxRvdLjPI8FxeReax=-%2Ph<{hvQ476g4X+3D^hTByGWT289hQ_uM?e~;z$0O@^1Xh&NyR=TC^Ys3sa+mf&iHMAU}og9ov=$+ZQv6K*8bZ>gTe~ HDWM4fDLpfZ literal 0 HcmV?d00001 diff --git a/data/layer/marisa_004.png b/data/layer/marisa_004.png new file mode 100644 index 0000000000000000000000000000000000000000..e58ac1b5d40880e36c3e7fd5b6ea01f32ab8fe52 GIT binary patch literal 864 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz|0Wf6XMG7pW(m7|NocPI5|1} z{P}a@M5nLCx(ggNit{Z`^yIY%1Ux%y^lr;EpsrCc8Un*F1Xx|x9tHYJ+SA1`q+-t7 ogN-0B9$xS>`2GWyP(~oThFQRYfzi!^R~97W>FVdQ&MBb@0Ku9pRR910 literal 0 HcmV?d00001 diff --git a/data/map0.png b/data/map0.png new file mode 100644 index 0000000000000000000000000000000000000000..3cf53fa3498cb94d8065301f03055908658f0f6c GIT binary patch literal 6469 zcmd5=X*`tO-#^!knZaO2WM?iasl?csm>F9UB2+3eh$zg&SkmA^yDTl*R5RKrN_)B~ zqatewQPwGIWKY@WneP96-~Z>u|9M_LFP`(}ET7-+`}>}AzUOzYa~*fvv_V=@MG^oY z?dV|V4ge%-LO>iXs`eFld5S7!w!IhIgBiq*@rwuq*1MVhfv{tk-=0ACK)>Aw_E!a3 z0)W;E@$_PQxj0h-m|=Q;zisql!&oA304!;-EWdz#fo#}6a8F3MmDXr+sTLfv+e&Mj zi3{0Yt8WpyTrHBB+0@;3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zhh9yaLF5euD@jC%uSTWUpqzWqkCinWr;$_5S+eLEQ(BE7@knSb`;07isf*_^%Srd|ic5y&nn{9{uW)%M13&BB_QX-r?yl<+;|;rLa8~B2 zQ-SxD=wht?x6W0Og>{%tmIjX3an*S_kb6J5QGilb!H1=_3{4Q4EMGv0F2|)aGV6gp6->x<>STFD) z;&tgDyYt-aGr5QKZ-8$vZR5Q*enbKtys{Zu@fcKoAKr2Q)wf93d!@>t9@S!#M2&iP z#do0eA~wMBff^92NVs9iY*~WOxh{?xcAr8$34XaPn+fWF&M*IR;3l9q|J174_s$G> z)dU^8c4M4FZ*7mI!eQZ-BvA8WxTK6j&pvqtXJvV9hhO(x#RQ~bYRdvIWYx#Mh(k%E zsTV?YN#vYpQikRJny?54!d04x(;d`Q|VxT^ea< zf@V303eZUCa;6Hb>%?k%(Hin=G(ANAio_OasUCEbq^2LVegcxS2dyHagd^p^hf0@) z-sdaV;B-)ei&eNL%Ppj_+8*>?xhRHaaC1o!Iott{U3$@btFw5wIY|G- zE#e|EpO}4C*NZ+&Bp*mbaz`N7iv)5^BHxute;{uvYS?vPPWGVFEnj>2`A~Vy32udA zA|jrTfRDOSCc%6!&2m4L{y{`%gy8nVeDC)~@P{w|Oi7_)n^I5CWX+s}$hxO}5@pWY x@bj2h_t7tN63(Kd(WgBD?U=O134|yq;8H>i7k;?VFZyu^9PKyR-LqjN{}(&&p2h$G literal 0 HcmV?d00001 diff --git a/data/marisa/face_normal.png b/data/marisa/face_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..288d2624a7b8b7fcb777dfc07738e8cebcc81a2c GIT binary patch literal 1013 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz|0Wf6XMG7pW(m7|NocPI5|1} z{P}a@M5nLCx(ggNit{Z`^yIY%1Ux%y^lr;EpsrCc8Un*F1Xx|x9tHY}u_VYZn8D%M zjWi%Vu9$zA9d rXyBGHV5t)P$I|9dfBYA}hW-h@nnu>tS)~t*K{4X#>gTe~DWM4fWF>TR literal 0 HcmV?d00001 diff --git a/data/marisa/face_tired.png b/data/marisa/face_tired.png new file mode 100644 index 0000000000000000000000000000000000000000..83116ae8c68e61be957960e8c0f19cc9b56b4993 GIT binary patch literal 1019 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz|0Wf6XMG7pW(m7|NocPI5|1} z{P}a@M5nLCx(ggNit{Z`^yIY%1Ux%y^lr;EpsrCc8Un*F1Xx|x9tHY}u_VYZn8D%M zjWi%7BIf=me{mp`q3SyC3kBW|c9%m9 zZ>O0}We{#t%)Y!_>@UxE%c85lc|MCDoL2JvwXr7Sa#zLOZ=J+uoQ`whyTSMAgU|v0 xjhE8Ge_o7m2yKXVtz=}I(sJCM|6k3FgnNybSaVXiSAnuQgQu&X%Q~loCICp=cK!eW literal 0 HcmV?d00001 diff --git a/data/marisa/hear.png b/data/marisa/hear.png new file mode 100644 index 0000000000000000000000000000000000000000..6bba611372db79e503861abb75230570bceec51f GIT binary patch literal 1185 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz|0Wf6XMG7pW(m7|NocPI5|1} z{P}a@M5nLCx(ggNit{Z`^yIY%1Ux%y^lr;EpsrCc8Un*F1Xx|x9tHY}u_VYZn8D%M zjWi(J-_yl0q+-t7>Aqrz6*yXA`_n)CyPmUF;emhCE!VjCnaLUteZdPZQn%JEe(63=Ing1Q0!-re58Db%YNs!uVOuNF}gcXO%LddaKmXaR3L)MyiI=|C--#^~-{`cO0JkNbypYQd(uKT*b_x*XEbcelGqQdgR z002=NYpNpv5N`?`g!p*R$Ib_2d9N)@3pb_{{U|fSJCp`Yed$MN7@J^kKbj-W+c)ZX z2h9ioK5W2#H>R7NEy;%-tnK{+qa7K{_`wB?$dL?hpFkQDbA;v>5Mqp-eb|h}1o#?b zUG?qob_{cxe}Hv#D9tH)?|z@?Kp&znmTZDCiX`y}f@w@|Ok{9SNEj*782cA5i8ue@ z#$hpkL70KY*#8veX6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lsc=2&HxnLH8!b+c(ZKJdagXTs8Lnx&Yiqv&gp1NF$aFN*C2R%QI{!37um zYRvb>$s9iKCORVvtg{Qn+4hNFPl!_XJ}?Cx&SS(H48$o{TYTy7%U31?jmH4TM>~4n zb%8Y^n6vHjz(_->Cr3Xs4g<%=TiV~0y@ag4bxCB2#+5j|yi0y;)wvC<1wmk!NaD#( zRMG8OSwcD3je2Qjt!+7$ED*z+Aa(K^)@gdE% zWVfcgFFg;Vp#6KS%y*!RG@&V~0o?zx*Fl7@?BcnGemtDr>u`KAb!2R^zUw1U-y*7S z6~7XDyiWs6nN=JR-BTF47FK9`Kvo7;P(D$Sa#5Kx-g#nS@g2C;A6^?w9}<)~ z=<{re8gnB(`& zC+AF)JX(-udp;MvnJaj^+g}@ANPdBC-M?~av`f3W0_SNP)qaXxR@g)*8b=UgMnXwb zza%cV3q-}o&MnuWLGS$TF`UtOMC$n%QPr{2(r;hB96?bgakke#evFVwC{v@-J5(JQ zBDS{m5`*WKYG80(=^HtlqzY2NgcXoUNQ{X)61Dl_^rbw0q{O#f7m!z%wimO2I%3ne zVK>cSHDscpru*$jdBewZWpY5)cje7;COOFK<$3MxTer>*D;(-r2QhsM)6>DCnAqQQ zryhjLDu5{^vGv5O`4ndOQZ{|PQ3rgAjTVOEUlq*8M9V5tl%_W}P6h{`Rg`2)L-%W- z#>i{XO8xZeBV6QsDnQ6dg6L<;bKM9wQVM9SOio?`jfLVc8Tlc309R@%4E4p|uKC_S z-@9otepTlZpD^_F(Xhopm5iAjBG7|8^!;qgn&)Id))*)hNVZ8_sLIb)@n0X-lbe&J zYi!#mQ|%HbNvV;*B0S<58edi)4Y&5wzwfM6>b_D-hN|hL&_FO}%smmEUdj6@1vVCYskhC%68{TSM1DB{ literal 0 HcmV?d00001 diff --git a/data/okazari.edg b/data/okazari.edg new file mode 100644 index 0000000000000000000000000000000000000000..a6cbda6c537eab662cd5ac44e4965a948f68fe33 GIT binary patch literal 9309 zcmeHNeXN#c9lp=|oEJ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*9!pJ zPKN-roxW<u1coX3gu#720qrXd7$?pg2?kN`eUh+D<0{XgjR|@O_24 zHJt$3PR|8Up7YJT)tYGl+B`1-&~|#6naizt7XUxDFc&~u{`oOUztu=G_3O66#mjHQTPM?V1Ci?cy2$lna%) zW)=dd*0li2v&gO$1}m-UwPqE7Hkpqb^jWhJK(z>%uprQOy2+Z`ldJxD0Ok3*!Def= zShLlx9RSL_)0*AZ{Lq?*0JNR{*qVdZ{M4FX0pPz-IfSd`{ycy(zXYK5Ibqis0ChMK zY31qyP}B?nxfYx0HSh-viKgy4%b_0BxtgHuDz%ZKwY-GXXzR zwL!q1JG%hX&pQCLFHwZiyVsW8&dglEUc+>D7q1hHx&l=iHm3Q~+4ZkTqKgCN{ZJhw>b2ekfYk}2&daF@}cm$;d zz-sWJ8DFd6c;)Ta(^|WDKPPqReYX4`;Uwhz7dn8wW3H_+$igfL1ro^$9kvG zS}`$=tU_K5@I_~qP0)b45Q*7iA&SUOAl*rAr12_T3dyntlB|KB8tJm8V3s7&w~;0F zrY5}<&J|**{V7SVl+?%3qQP>1!yJd_j#9(EJDJbHsnWJMY zRc8kmNK2G;5RS-}Bq)it#A}+vJ%dw~8uzETC;Bo;dVlPWs731scWb=JTk7 z!?8?0dQgp_ckbnhl)3CoL|P24M+)SeF%;JH+TX0N^+;0P5Rx7dn{{!Q*JJX>lG9Ak&A!O%N8RJp;f@cwW5rSY9a{b~^N#ozBjG=Guigv* literal 0 HcmV?d00001 diff --git a/data/okazari.png b/data/okazari.png new file mode 100644 index 0000000000000000000000000000000000000000..8a774d6a5f0d88587a21f9e3c62f0e0f968f87b4 GIT binary patch literal 1258 zcmeAS@N?(olHy`uVBq!ia0vp^3xN0o2Q!e|Fn|6F1_ow^0G|+7hW`xzE&l(%w8qKF z>F3X%6DK--E!JJ&s8O76d7>w;Js{xOS)+GbrU7*|rKCK2_6*1v1*0J_Y(jwZ()EQv z&oGt*`2{mLJiCzwWY6$)aSW-L^Y-S+yh8>e4uLA~C;$I{yUDmhfz#SP+$z0sh1QkZ z&u=t-`#LM`S4UsPq)VH8Afhsz3746F-z^s^DOdHLwB6nc`r60uO}}nR@86m z4_S+wBKpkfUVAv_sDCv3FjwO4G+UN$&OI|<1}9h_S#bBR{MGW-_j^p!&dz7HZ~dvZ zW1s7~!dtO1?K^XYrFN*-+@E`0lWF?q#lAkDS*A_U`ncnp8b{14&$Y)@XKs6*JxlFF zhn3a$kF4zT4&U-V6&{*#$FNwY==q~-u2;V=x~D!*I$`a+5M`ge6Alyyp4Q7W_b&d_ z^VXVa)@QxY#k+U>?e)=dk1Id&XP0yTyXc_3i~c@;dhEo3bx%Iun7a1u(wXwdM9nPS zlgs(v9W%Em$YehK#4Gy0b}!EwGbgRW)Pm{jPc|O@-M8!c4&8z~iFfzD_g)!O1Fku3v566O-4G@Vis!r{DXVW$rVI%64x#n}2GXj_(_p!g^l z4S|ss0`I%uz6Sc4u_VYZn8D%MjWi&~!PCVtq+-t7ONM+50s^j%h5wziT|LC4XU)7- z&+5gL2{#6N*!OEYIR}c{6Xtf9Cu9RCGK*f$8b$ K=d#Wzp$PyZ7&5Q` literal 0 HcmV?d00001 diff --git a/data/yukkuri_base.png b/data/yukkuri_base.png new file mode 100644 index 0000000000000000000000000000000000000000..e07028c788d54d50a491c78de7d1c0a1b80688a6 GIT binary patch literal 1041 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz|0Wf6XMG7pW(m7|NocPI5|1} z{P}a@M5nLCx(ggNit{Z`^yIY%1Ux%y^lr;EpsrCc8Un*F1Xx|x9tHY}u_VYZn8D%M zjWi%mj5?YYjnX0jq>l zM?jTY#hLFDpEB#RPL|mFsdajj$+G!d;sni%^DGk&?n!5DJ?pElU}66K^xT?%Z2zMa Ue^>9<=?BG@r>mdKI;Vst08Ng86951J literal 0 HcmV?d00001 diff --git a/enchant.js b/enchant.js new file mode 100644 index 0000000..5329acc --- /dev/null +++ b/enchant.js @@ -0,0 +1,8696 @@ +/** +* enchant.js v0.7.0 +* http://enchantjs.com +* +* Copyright Ubiquitous Entertainment Inc. +* Released under the MIT license. +*/ + +(function(window, undefined){ + +/** + * ECMA-262 5th edition Functions + */ +if (typeof Object.defineProperty !== 'function') { + Object.defineProperty = function(obj, prop, desc) { + if ('value' in desc) { + obj[prop] = desc.value; + } + if ('get' in desc) { + obj.__defineGetter__(prop, desc.get); + } + if ('set' in desc) { + obj.__defineSetter__(prop, desc.set); + } + return obj; + }; +} +if (typeof Object.defineProperties !== 'function') { + Object.defineProperties = function(obj, descs) { + for (var prop in descs) { + if (descs.hasOwnProperty(prop)) { + Object.defineProperty(obj, prop, descs[prop]); + } + } + return obj; + }; +} +if (typeof Object.create !== 'function') { + Object.create = function(prototype, descs) { + function F() { + } + + F.prototype = prototype; + var obj = new F(); + if (descs != null) { + Object.defineProperties(obj, descs); + } + return obj; + }; +} +if (typeof Object.getPrototypeOf !== 'function') { + Object.getPrototypeOf = function(obj) { + return obj.__proto__; + }; +} + +if (typeof Function.prototype.bind !== 'function') { + Function.prototype.bind = function(thisObject) { + var func = this; + var args = Array.prototype.slice.call(arguments, 1); + var Nop = function() { + }; + var bound = function() { + var a = args.concat(Array.prototype.slice.call(arguments)); + return func.apply( + this instanceof Nop ? this : thisObject || window, a); + }; + Nop.prototype = func.prototype; + bound.prototype = new Nop(); + return bound; + }; +} + +window.getTime = (function() { + var origin; + if (window.performance && window.performance.now) { + origin = Date.now(); + return function() { + return origin + window.performance.now(); + }; + } else if (window.performance && window.performance.webkitNow) { + origin = Date.now(); + return function() { + return origin + window.performance.webkitNow(); + }; + } else { + return Date.now; + } +}()); + +/** + * define requestAnimationFrame + */ +window.requestAnimationFrame = + window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame || + (function() { + var lastTime = window.getTime(); + var frame = 1000 / 60; + return function(func) { + var _id = setTimeout(function() { + lastTime = window.getTime(); + func(lastTime); + }, Math.max(0, lastTime + frame - window.getTime())); + return _id; + }; + }()); + +/** + [lang:ja] + * グローバルにライブラリのクラスをエクスポートする. + * + * 引数に何も渡さない場合enchant.jsで定義されたクラス及びプラグインで定義されたクラス + * 全てがエクスポートされる. 引数が一つ以上の場合はenchant.jsで定義されたクラスのみ + * がデフォルトでエクスポートされ, プラグインのクラスをエクスポートしたい場合は明示的に + * プラグインの識別子を引数として渡す必要がある. + * + * @example + * enchant(); // 全てのクラスがエクスポートされる + * enchant(''); // enchant.js本体のクラスのみがエクスポートされる + * enchant('ui'); // enchant.js本体のクラスとui.enchant.jsのクラスがエクスポートされる + * + * @param {...String} [modules] エクスポートするモジュール. 複数指定できる. + [/lang] + [lang:en] + * Export the library classes globally. + * + * When no arguments are given, all classes defined in enchant.js as well as all classes defined in + * plugins will be exported. When more than one argument is given, by default only classes defined + * in enchant.js will be exported. When you wish to export plugin classes you must explicitly deliver + * the plugin identifiers as arguments. + * + * @example + * enchant(); // All classes will be exported. + * enchant(''); // Only classes in enchant.js will be exported. + * enchant('ui'); // enchant.js classes and ui.enchant.js classes will be exported. + * + * @param {...String} [modules] Export module. Multiple designations possible. + [/lang] + [lang:de] + * Globaler Export der Programmbibliotheken. + * + * Wenn keine Argument übergeben werden, werden alle Klassen die in enchant.js und in den Plugins + * definiert sind exportiert. Falls mehr als ein Argument übergeben wurde, werden standardmäßig nur Klassen + * die in enchant.js selbst definiert sind exporitert. Wenn auch Plugin Klassen exportiert werden sollen, + * müssen die Plugin Bezeichner explizit als Argumente übergeben werden. + * + * @example + * enchant(); // alle Klassen werden exportiert. + * enchant(''); // nur Klassen die in enchant.js definiert sind werden exportiert. + * enchant('ui'); // enchant.js Klassen und ui.enchant.js Klassen werden exportiert. + * + * @param {...String} [modules] Module die exportiert werden sollen. + [/lang] + * @global + * @type {Object} + * @name enchant + */ +var enchant = function(modules) { + if (modules != null) { + if (!(modules instanceof Array)) { + modules = Array.prototype.slice.call(arguments); + } + modules = modules.filter(function(module) { + return [module].join(); + }); + } + (function include(module, prefix) { + var submodules = [], + i, len; + for (var prop in module) { + if (module.hasOwnProperty(prop)) { + if (typeof module[prop] === 'function') { + window[prop] = module[prop]; + } else if (typeof module[prop] === 'object' && module[prop] !== null && Object.getPrototypeOf(module[prop]) === Object.prototype) { + if (modules == null) { + submodules.push(prop); + } else { + i = modules.indexOf(prefix + prop); + if (i !== -1) { + submodules.push(prop); + modules.splice(i, 1); + } + } + } + } + } + + for (i = 0, len = submodules.length; i < len; i++) { + include(module[submodules[i]], prefix + submodules[i] + '.'); + } + }(enchant, '')); + + // issue 185 + if (enchant.Class.getInheritanceTree(window.Game).length <= enchant.Class.getInheritanceTree(window.Core).length) { + window.Game = window.Core; + } + + if (modules != null && modules.length) { + throw new Error('Cannot load module: ' + modules.join(', ')); + } +}; + +/** + * export enchant + */ +window.enchant = enchant; + +window.addEventListener("message", function(msg, origin) { + try { + var data = JSON.parse(msg.data); + if (data.type === "event") { + enchant.Core.instance.dispatchEvent(new enchant.Event(data.value)); + } else if (data.type === "debug") { + switch (data.value) { + case "start": + enchant.Core.instance.start(); + break; + case "pause": + enchant.Core.instance.pause(); + break; + case "resume": + enchant.Core.instance.resume(); + break; + case "tick": + enchant.Core.instance._tick(); + break; + default: + break; + } + } + } catch (e) { + // ignore + } +}, false); + +/** + * @name enchant.Class + * @class + [lang:ja] + * クラスのクラス. + * + * @param {Function} [superclass] 継承するクラス. + * @param {*} definition クラス定義. + [/lang] + [lang:en] + * A Class representing a class which supports inheritance. + * + * @param {Function} [superclass] The class from which the + * new class will inherit the class definition. + * @param {*} definition Class definition. + [/lang] + [lang:de] + * Eine Klasse für Klassen, die Vererbung unterstützen. + * + * @param {Function} [superclass] Die Klasse, deren Klassendefinition + * die neue Klasse erben wird. + * @param {*} definition Klassendefinition. + [/lang] + * @constructor + */ +enchant.Class = function(superclass, definition) { + return enchant.Class.create(superclass, definition); +}; + +/** + [lang:ja] + * クラスを作成する. + * + * ほかのクラスを継承したクラスを作成する場合, コンストラクタはデフォルトで + * 継承元のクラスのものが使われる. コンストラクタをオーバーライドする場合継承元の + * コンストラクタを適用するには明示的に呼び出す必要がある. + * + * @example + * var Ball = Class.create({ // 何も継承しないクラスを作成する + * initialize: function(radius) { ... }, // メソッド定義 + * fall: function() { ... } + * }); + * + * var Ball = Class.create(Sprite); // Spriteを継承したクラスを作成する + * var Ball = Class.create(Sprite, { // Spriteを継承したクラスを作成する + * initialize: function(radius) { // コンストラクタを上書きする + * Sprite.call(this, radius*2, radius*2); // 継承元のコンストラクタを適用する + * this.image = core.assets['ball.gif']; + * } + * }); + * + * @param {Function} [superclass] 継承するクラス. + * @param {*} [definition] クラス定義. + [/lang] + [lang:en] + * Create a class. + * + * When defining classes that inherit from other classes, the previous class is used as a base with + * the superclass's constructor as default. When overriding the default constructor, it is necessary + * to explicitly call the previous constructor to ensure a correct class initialization. + * + * @example + * var Ball = Class.create({ // Creates independent class. + * initialize: function(radius) { ... }, // Method definition. + * fall: function() { ... } + * }); + * + * var Ball = Class.create(Sprite); // Creates a class inheriting from "Sprite" + * var Ball = Class.create(Sprite, { // Creates a class inheriting "Sprite" + * initialize: function(radius) { // Overwrites constructor + * Sprite.call(this, radius*2, radius*2); // Applies previous constructor. + * this.image = core.assets['ball.gif']; + * } + * }); + * + * @param {Function} [superclass] The class from which the + * new class will inherit the class definition. + * @param {*} [definition] Class definition. + [/lang] + [lang:de] + * Erstellt eine neue Klasse + * + * Wenn eine Klasse definiert wird, die von einer anderen Klasse erbt, wird der Konstruktor der + * Basisklasse als Standard definiert. Sollte dieser Konstruktor in der neuen Klasse überschrieben + * werden, sollte der vorherige Konstruktor explizit aufgerufen werden, um eine korrekte + * Klasseninitialisierung sicherzustellen. + * + * @example + * var Ball = Class.create({ // definiert eine unabhängige Klasse. + * initialize: function(radius) { ... }, // Methodendefinitionen + * fall: function() { ... } + * }); + * + * var Ball = Class.create(Sprite); // definiert eine Klasse die von "Sprite" erbt. + * var Ball = Class.create(Sprite, { // definiert eine Klasse die von "Sprite" erbt. + * initialize: function(radius) { // überschreibt den Standardkonstruktor. + * Sprite.call(this, radius*2, radius*2); // Aufruf des Konstruktors der Basisklasse. + * this.image = core.assets['ball.gif']; + * } + * }); + * + * @param {Function} [superclass] The class from which the + * new class will inherit the class definition. + * @param {*} [definition] Class definition. + [/lang] + [lang:de] + * Erstellt eine neue Klasse + * + * Wenn eine Klasse definiert wird, die von einer anderen Klasse erbt, wird der Konstruktor der + * Basisklasse als Standard definiert. Sollte dieser Konstruktor in der neuen Klasse überschrieben + * werden, sollte der vorherige Konstruktor explizit aufgerufen werden, um eine korrekte + * Klasseninitialisierung sicherzustellen. + * + * @example + * var Ball = Class.create({ // definiert eine unabhängige Klasse. + * initialize: function(radius) { ... }, // Methodendefinitionen + * fall: function() { ... } + * }); + * + * var Ball = Class.create(Sprite); // definiert eine Klasse die von "Sprite" erbt. + * var Ball = Class.create(Sprite, { // definiert eine Klasse die von "Sprite" erbt. + * initialize: function(radius) { // überschreibt den Standardkonstruktor. + * Sprite.call(this, radius*2, radius*2); // Aufruf des Konstruktors der Basisklasse. + * this.image = core.assets['ball.gif']; + * } + * }); + * + * @param {Function} [superclass] Die Klasse, deren Klassendefinition + * die neue Klasse erben wird. + * @param {*} definition Klassendefinition. + [/lang] + * @static + */ +enchant.Class.create = function(superclass, definition) { + if (superclass == null && definition){ + throw new Error("superclass is undefined (enchant.Class.create)"); + }else if(superclass == null){ + throw new Error("definition is undefined (enchant.Class.create)"); + } + + if (arguments.length === 0) { + return enchant.Class.create(Object, definition); + } else if (arguments.length === 1 && typeof arguments[0] !== 'function') { + return enchant.Class.create(Object, arguments[0]); + } + + for (var prop in definition) { + if (definition.hasOwnProperty(prop)) { + if (typeof definition[prop] === 'object' && definition[prop] !== null && Object.getPrototypeOf(definition[prop]) === Object.prototype) { + if (!('enumerable' in definition[prop])) { + definition[prop].enumerable = true; + } + } else { + definition[prop] = { value: definition[prop], enumerable: true, writable: true }; + } + } + } + var Constructor = function() { + if (this instanceof Constructor) { + Constructor.prototype.initialize.apply(this, arguments); + } else { + return new Constructor(); + } + }; + Constructor.prototype = Object.create(superclass.prototype, definition); + Constructor.prototype.constructor = Constructor; + if (Constructor.prototype.initialize == null) { + Constructor.prototype.initialize = function() { + superclass.apply(this, arguments); + }; + } + + var tree = this.getInheritanceTree(superclass); + for (var i = 0, l = tree.length; i < l; i++) { + if (typeof tree[i]._inherited === 'function') { + tree[i]._inherited(Constructor); + break; + } + } + + return Constructor; +}; + +/** + [lang:ja] + * クラスの継承関係を取得する. + [/lang] + [lang:en] + * Get the inheritance tree of this class. + [/lang] + * @param {ConstructorFunction} + * @return {...ConstructorFunction} + */ +enchant.Class.getInheritanceTree = function(Constructor) { + var ret = []; + var C = Constructor; + var proto = C.prototype; + while (C !== Object) { + ret.push(C); + proto = Object.getPrototypeOf(proto); + C = proto.constructor; + } + return ret; +}; + +/** + * @namespace + [lang:ja] + * enchant.js の環境変数. + * new Core() を呼ぶ前に変更することで変更することで, 動作設定を変えることができる. + [/lang] + [lang:en] + * enchant.js environment variables. + * Execution settings can be changed by modifying these before calling new Core(). + [/lang] + [lang:de] + * Umgebungsvariable. + [/lang] + * @type {Object} + */ +enchant.ENV = { + /** + [lang:ja] + * enchant.js のバージョン. + * @type {String} + [/lang] + [lang:en] + * Version of enchant.js + * @type {String} + [/lang] + [lang:de] + * Version of enchant.js + * @type {String} + [/lang] + */ + VERSION: "0.6.1", + /** + * The CSS vendor prefix of the current browser. + * @type {String} + */ + VENDOR_PREFIX: (function() { + var ua = navigator.userAgent; + if (ua.indexOf('Opera') !== -1) { + return 'O'; + } else if (ua.indexOf('MSIE') !== -1) { + return 'ms'; + } else if (ua.indexOf('WebKit') !== -1) { + return 'webkit'; + } else if (navigator.product === 'Gecko') { + return 'Moz'; + } else { + return ''; + } + }()), + /** + * Determines if the current browser supports touch. + * @type {Boolean} True, if touch is enabled. + */ + TOUCH_ENABLED: (function() { + var div = document.createElement('div'); + div.setAttribute('ontouchstart', 'return'); + return typeof div.ontouchstart === 'function'; + }()), + /** + * Determines if the current browser is an iPhone with a retina display. + * @return {Boolean} True, if this display is a retina display + */ + RETINA_DISPLAY: (function() { + if (navigator.userAgent.indexOf('iPhone') !== -1 && window.devicePixelRatio === 2) { + var viewport = document.querySelector('meta[name="viewport"]'); + if (viewport == null) { + viewport = document.createElement('meta'); + document.head.appendChild(viewport); + } + viewport.setAttribute('content', 'width=640'); + return true; + } else { + return false; + } + }()), + /** + * Determines if Flash should be used to play sound instead of the + * native audio class, given the current browser. + * @type {Boolean} True, if flash should be used. + */ + USE_FLASH_SOUND: (function() { + var ua = navigator.userAgent; + var vendor = navigator.vendor || ""; + // non-local access, not on mobile mobile device, not on safari + return (location.href.indexOf('http') === 0 && ua.indexOf('Mobile') === -1 && vendor.indexOf('Apple') !== -1); + }()), + /** + * If click/touch event occurs for these tags the setPreventDefault() method will not be called. + */ + USE_DEFAULT_EVENT_TAGS: ['input', 'textarea', 'select', 'area'], + CANVAS_DRAWING_METHODS: [ + 'putImageData', 'drawImage', 'drawFocusRing', 'fill', 'stroke', + 'clearRect', 'fillRect', 'strokeRect', 'fillText', 'strokeText' + ], + /** + * Keybind Table. + * You can use 'left', 'up', 'right', 'down', 'a', or 'b' for preset events. + * @example + * enchant.ENV.KEY_BIND_TABLE = { + * 37: 'left', + * 38: 'up', + * 39: 'right', + * 40: 'down', + * 32: 'a', //-> use 'space' key as 'a button' + * } + * The default key bindings only bind 'left', 'up', 'right', and 'down' to the arrow keys. + */ + KEY_BIND_TABLE: { + 37: 'left', + 38: 'up', + 39: 'right', + 40: 'down' + }, + PREVENT_DEFAULT_KEY_CODES: [37, 38, 39, 40, 32], + /** + * @type {Boolean} + */ + SOUND_ENABLED_ON_MOBILE_SAFARI: false, + /** + * Determines if WebAudioAPI is enabled. + * (true: use WebAudioAPI instead of Audio element if possible) + */ + USE_WEBAUDIO: (function(){ + return location.protocol !== 'file:'; + }()), + /** + * Determines if animation feature is enabled. + * (true: Timeline instance will be generated for every new Node) + */ + USE_ANIMATION: true +}; + +/** + * @scope enchant.Event.prototype + */ +enchant.Event = enchant.Class.create({ + /** + * @name enchant.Event + * @class + [lang:ja] + * DOM Event風味の独自イベント実装を行ったクラス. + * ただしフェーズの概念はなし. + * @param {String} type Eventのタイプ + [/lang] + [lang:en] + * A class for an independent implementation of events similar to DOM Events. + * Does not include phase concepts. + * @param {String} type Event type. + [/lang] + [lang:de] + * Eine Klasse für eine unabhängige Implementierung von Ereignissen + * (Events), ähnlich wie DOM Events. + * Jedoch wird das Phasenkonzept nicht unterstützt. + * @param {String} type Event Typ. + [/lang] + * @constructs + */ + initialize: function(type) { + /** + [lang:ja] + * イベントのタイプ. + [/lang] + [lang:en] + * The type of the event. + [/lang] + [lang:de] + * Typ des Ereignis. + [/lang] + * @type {String} + */ + this.type = type; + /** + [lang:ja] + * イベントのターゲット. + [/lang] + [lang:en] + * The target of the event. + [/lang] + [lang:de] + * Ziel des Ereignis. + [/lang] + * @type {*} + */ + this.target = null; + /** + [lang:ja] + * イベント発生位置のx座標. + [/lang] + [lang:en] + * The x-coordinate of the event's occurrence. + [/lang] + [lang:de] + * X Koordinate des Auftretens des Ereignis. + [/lang] + * @type {Number} + */ + this.x = 0; + /** + [lang:ja] + * イベント発生位置のy座標. + [/lang] + [lang:en] + * The y-coordinate of the event's occurrence. + [/lang] + [lang:de] + * Y Koordinate des Auftretens des Ereignis. + [/lang] + * @type {Number} + */ + this.y = 0; + /** + [lang:ja] + * イベントを発行したオブジェクトを基準とするイベント発生位置のx座標. + [/lang] + [lang:en] + * The x-coordinate of the event's occurrence relative to the object + * which issued the event. + [/lang] + [lang:de] + * X Koordinate des lokalen Koordinatensystems des Auftretens des Ereignis. + [/lang] + * @type {Number} + */ + this.localX = 0; + /** + [lang:ja] + * イベントを発行したオブジェクトを基準とするイベント発生位置のy座標. + [/lang] + [lang:en] + * The y-coordinate of the event's occurrence relative to the object + * which issued the event. + [/lang] + [lang:de] + * Y Koordinate des lokalen Koordinatensystems des Auftretens des Ereignis. + [/lang] + * @type {Number} + */ + this.localY = 0; + }, + _initPosition: function(pageX, pageY) { + var core = enchant.Core.instance; + this.x = this.localX = (pageX - core._pageX) / core.scale; + this.y = this.localY = (pageY - core._pageY) / core.scale; + } +}); + +/** + [lang:ja] + * Coreのロード完了時に発生するイベント. + * + * 画像のプリロードを行う場合ロードが完了するのを待ってゲーム開始時の処理を行う必要がある. + * 発行するオブジェクト: {@link enchant.Core} + * + * @example + * var core = new Core(320, 320); + * core.preload('player.gif'); + * core.onload = function() { + * ... // ゲーム開始時の処理を記述 + * }; + * core.start(); + * + [/lang] + [lang:en] + * An event dispatched once the core has finished loading. + * + * When preloading images, it is necessary to wait until preloading is complete + * before starting the game. + * Issued by: {@link enchant.Core} + * + * @example + * var core = new Core(320, 320); + * core.preload('player.gif'); + * core.onload = function() { + * ... // Description of initial core processing + * }; + * core.start(); + * + [/lang] + [lang:de] + * Ereignis, dass auftritt wenn das Laden des Spieles abgeschlossen wurde. + * + * Wenn Grafiken im voraus geladen werden ist es notwendig, auf dieses Ereignis zu warten bis mit + * diesen gearbeitet werden kann. + * Objekt des Auftretens: {@link enchant.Core} + * + * @example + * var core = new Core(320, 320); + * core.preload('player.gif'); + * core.onload = function() { + * ... // initialisierung des Spieles + * }; + * core.start(); + * + [/lang] + * @type {String} + */ +enchant.Event.LOAD = 'load'; + +/** + [lang:ja] + * エラーの発生をCoreに伝える際に発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Surface}, {@link enchant.WebAudioSound}, {@link enchant.DOMSound} + [/lang] + [lang:en] + * An event dispatched when an error occurs. + * Issued by: {@link enchant.Core}, {@link enchant.Surface}, {@link enchant.WebAudioSound}, {@link enchant.DOMSound} + [/lang] + */ +enchant.Event.ERROR = 'error'; + +/** + [lang:ja] + * 表示サイズが変わったときに発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the display size is changed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + @type {String} + */ +enchant.Event.CORE_RESIZE = 'coreresize'; + +/** + [lang:ja] + * Coreのロード進行中に発生するイベント. + * プリロードする画像が一枚ロードされる度に発行される. 発行するオブジェクト: {@link enchant.LoadingScene} + [/lang] + [lang:en] + * An event dispatched while the core is loading. + * Dispatched each time an image is preloaded. Issued by: {@link enchant.LoadingScene} + [/lang] + [lang:de] + * Ereignis, welches während des Ladens des Spieles auftritt. + * Das Ereignis tritt jedesmal auf, wenn eine im voraus geladene Grafik geladen wurde. + * Objekt des Auftretens: {@link enchant.LoadingScene} + [/lang] + * @type {String} + */ +enchant.Event.PROGRESS = 'progress'; + +/** + [lang:ja] + * フレーム開始時に発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a new frame is being processed. + * Issued by: {@link enchant.Core}, {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welches auftritt wenn ein neuer Frame bearbeitet wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.ENTER_FRAME = 'enterframe'; + +/** + [lang:ja] + * フレーム終了時に発生するイベント. + * 発行するオブジェクト: {@link enchant.Core} + [/lang] + [lang:en] + * An event dispatched when frame processing is about to end. + * Issued by: {@link enchant.Core} + [/lang] + [lang:de] + * Ereignis, welches auftritt wenn ein Frame beendet wird. + * Objekt des Auftretens: {@link enchant.Core} + [/lang] + * @type {String} + */ +enchant.Event.EXIT_FRAME = 'exitframe'; + +/** + [lang:ja] + * Sceneが開始したとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when a Scene begins. + * Issued by: {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, dass auftritt wenn eine neue Szene + * ({@link enchant.Scene}) beginnt. + * Objekt des Auftretens: {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.ENTER = 'enter'; + +/** + [lang:ja] + * Sceneが終了したとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when a Scene ends. + * Issued by: {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, dass auftritt wenn eine Szene + * ({@link enchant.Scene}) endet. + * Objekt des Auftretens: {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.EXIT = 'exit'; + +/** + [lang:ja] + * Nodeに子が追加されたとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Group}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when a Child has been added to a Node. + * Issued by: {@link enchant.Group}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn ein Kindelement zu einem Node + * hinzugefügt wird. + * Objekt des Auftretens: {@link enchant.Group}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.CHILD_ADDED = 'childadded'; + +/** + [lang:ja] + * NodeがGroupに追加されたとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a Node has been added to a Group. + * Issued by: {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der Node zu einer Gruppe + * hinzugefügt wird. + * Objekt des Auftretens: {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.ADDED = 'added'; + +/** + [lang:ja] + * NodeがSceneに追加されたとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a Node has been added to a Scene. + * Issued by: {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der Node zu einer Szene + * hinzugefügt wird. + * Objekt des Auftretens: {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.ADDED_TO_SCENE = 'addedtoscene'; + +/** + [lang:ja] + * Nodeから子が削除されたとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Group}, {@link enchant.Scene} + * @type {String} + [/lang] + [lang:en] + * An event dispatched when a Child has been removed from a Node. + * Issued by: {@link enchant.Group}, {@link enchant.Scene} + * @type {String} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn ein Kindelement von einem Node + * entfernt wird. + * Objekt des Auftretens: {@link enchant.Group}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.CHILD_REMOVED = 'childremoved'; + +/** + [lang:ja] + * NodeがGroupから削除されたとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a Node has been deleted from a Group. + * Issued by: {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der Node aus einer Gruppe + * entfernt wird. + * Objekt des Auftretens: {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.REMOVED = 'removed'; + +/** + [lang:ja] + * NodeがSceneから削除されたとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a Node has been deleted from a Scene. + * Issued by: {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der Node aus einer Szene + * entfernt wird. + * Objekt des Auftretens: {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.REMOVED_FROM_SCENE = 'removedfromscene'; + +/** + [lang:ja] + * Nodeに対するタッチが始まったとき発生するイベント. + * クリックもタッチとして扱われる. 発行するオブジェクト: {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a touch event intersecting the Node has begun. + * A mouse event counts as a touch event. Issued by: {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn ein Touch auf einen Node + * beginnt. Klicks werden als Touch behandelt. + * Objekt des Auftretens: {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.TOUCH_START = 'touchstart'; + +/** + [lang:ja] + * Nodeに対するタッチが移動したとき発生するイベント. + * クリックもタッチとして扱われる. 発行するオブジェクト: {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a touch event intersecting the Node has been moved. + * A mouse event counts as a touch event. Issued by: {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn ein Touch auf einen Node + * bewegt wurde. Klicks werden als Touch behandelt. + * Objekt des Auftretens: {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.TOUCH_MOVE = 'touchmove'; + +/** + [lang:ja] + * Nodeに対するタッチが終了したとき発生するイベント. + * クリックもタッチとして扱われる. 発行するオブジェクト: {@link enchant.Node} + [/lang] + [lang:en] + * An event dispatched when a touch event intersecting the Node has ended. + * A mouse event counts as a touch event. Issued by: {@link enchant.Node} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn ein Touch auf einen Node + * endet. Klicks werden als Touch behandelt. + * Objekt des Auftretens: {@link enchant.Node} + [/lang] + * @type {String} + */ +enchant.Event.TOUCH_END = 'touchend'; + +/** + [lang:ja] + * Entityがレンダリングされるときに発生するイベント. + * 発行するオブジェクト: {@link enchant.Entity} + [/lang] + [lang:en] + * An event dispatched when an Entity has been rendered. + * Issued by: {@link enchant.Entity} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn eine Entity + * gerendert wird. + * Objekt des Auftretens: {@link enchant.Entity} + [/lang] + * @type {String} + */ +enchant.Event.RENDER = 'render'; + +/** + [lang:ja] + * ボタン入力が始まったとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when any button has been pressed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn ein Knopf gedückt wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.INPUT_START = 'inputstart'; + +/** + [lang:ja] + * ボタン入力が変化したとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when button inputs have changed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn eine Knopfeingabe verändert wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.INPUT_CHANGE = 'inputchange'; + +/** + [lang:ja] + * ボタン入力が終了したとき発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when all button inputs have ended. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn eine Knopf losgelassen wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.INPUT_END = 'inputend'; + +/** + [lang:ja] + * leftボタンが押された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'left' button is pressed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Links"-Knopf gedrückt wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.LEFT_BUTTON_DOWN = 'leftbuttondown'; + +/** + [lang:ja] + * leftボタンが離された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'left' button is released. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Links"-Knopf losgelassen wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.LEFT_BUTTON_UP = 'leftbuttonup'; + +/** + [lang:ja] + * rightボタンが押された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'right' button is pressed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Rechts"-Knopf gedrückt wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.RIGHT_BUTTON_DOWN = 'rightbuttondown'; + +/** + [lang:ja] + * rightボタンが離された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'right' button is released. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Rechts"-Knopf losgelassen wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.RIGHT_BUTTON_UP = 'rightbuttonup'; + +/** + [lang:ja] + * upボタンが押された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'up' button is pressed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Oben"-Knopf gedrückt wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.UP_BUTTON_DOWN = 'upbuttondown'; + +/** + [lang:ja] + * upボタンが離された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'up' button is released. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Oben"-Knopf losgelassen wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.UP_BUTTON_UP = 'upbuttonup'; + +/** + [lang:ja] + * downボタンが離された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'down' button is pressed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Unten"-Knopf gedrückt wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.DOWN_BUTTON_DOWN = 'downbuttondown'; + +/** + [lang:ja] + * downボタンが離された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'down' button is released. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "Nach Unten"-Knopf losgelassen wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.DOWN_BUTTON_UP = 'downbuttonup'; + +/** + [lang:ja] + * aボタンが押された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'a' button is pressed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "A"-Knopf gedrückt wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.A_BUTTON_DOWN = 'abuttondown'; + +/** + [lang:ja] + * aボタンが離された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'a' button is released. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "A"-Knopf losgelassen wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.A_BUTTON_UP = 'abuttonup'; + +/** + [lang:ja] + * bボタンが押された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'b' button is pressed. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "B"-Knopf gedrückt wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.B_BUTTON_DOWN = 'bbuttondown'; + +/** + [lang:ja] + * bボタンが離された発生するイベント. + * 発行するオブジェクト: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:en] + * An event dispatched when the 'b' button is released. + * Issued by: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + [lang:de] + * Ereignis, welchses auftritt wenn der "B"-Knopf losgelassen wird. + * Objekt des Auftretens: {@link enchant.Core}, {@link enchant.Scene} + [/lang] + * @type {String} + */ +enchant.Event.B_BUTTON_UP = 'bbuttonup'; + +/** + [lang:ja] + * アクションがタイムラインに追加された時に発行されるイベント + * looped が設定されている時も、アクションは一度タイムラインから削除されもう一度追加される + [/lang] + [lang:en] + * An event dispatched when an Action has been added to a Timeline. + * When looped, an Action is removed from the timeline and added back into it. + [/lang] + * @type {String} + * + */ +enchant.Event.ADDED_TO_TIMELINE = "addedtotimeline"; + +/** + [lang:ja] + * アクションがタイムラインから削除された時に発行されるイベント + * looped が設定されている時も、アクションは一度タイムラインから削除されもう一度追加される + [/lang] + [lang:en] + * An event dispatched when an Action has been removed from a Timeline. + * When looped, an Action is removed from the timeline and added back into it. + [/lang] + * @type {String} + */ +enchant.Event.REMOVED_FROM_TIMELINE = "removedfromtimeline"; + +/** + [lang:ja] + * アクションが開始された時に発行されるイベント + [/lang] + [lang:en] + * An event dispatched when an Action begins. + [/lang] + * @type {String} + */ +enchant.Event.ACTION_START = "actionstart"; + +/** + [lang:ja] + * アクションが終了するときに発行されるイベント + [/lang] + [lang:en] + * An event dispatched when an Action finishes. + [/lang] + * @type {String} + */ +enchant.Event.ACTION_END = "actionend"; + +/** + [lang:ja] + * アクションが1フレーム経過するときに発行されるイベント + [/lang] + [lang:en] + * An event dispatched when an Action has gone through one frame. + [/lang] + * @type {String} + */ +enchant.Event.ACTION_TICK = "actiontick"; + +/** + [lang:ja] + * アクションが追加された時に、タイムラインに対して発行されるイベント + [/lang] + [lang:en] + * An event dispatched to the Timeline when an Action is added. + [/lang] + * @type {String} + */ +enchant.Event.ACTION_ADDED = "actionadded"; + +/** + [lang:ja] + * アクションが削除された時に、タイムラインに対して発行されるイベント + [/lang] + [lang:en] + * An event dispatched to the Timeline when an Action is removed. + [/lang] + * @type {String} + */ +enchant.Event.ACTION_REMOVED = "actionremoved"; + +/** + * @scope enchant.EventTarget.prototype + */ +enchant.EventTarget = enchant.Class.create({ + /** + * @name enchant.EventTarget + * @class + [lang:ja] + * DOM Event風味の独自イベント実装を行ったクラス. + * ただしフェーズの概念はなし. + [/lang] + [lang:en] + * A class for implementation of events similar to DOM Events. + * However, it does not include the concept of phases. + [/lang] + [lang:de] + * Eine Klasse für eine unabhängige Implementierung von Ereignissen + * (Events), ähnlich wie DOM Events. + * Jedoch wird das Phasenkonzept nicht unterstützt. + [/lang] + * @extends {enchant.Event} + * @constructs + */ + initialize: function() { + this._listeners = {}; + }, + /** + [lang:ja] + * イベントリスナを追加する. + * @param {String} type イベントのタイプ. + * @param {function(e:enchant.Event)} listener 追加するイベントリスナ. + [/lang] + [lang:en] + * Add a new event listener which will be executed when the event + * is dispatched. + * @param {String} type Type of the events. + * @param {function(e:enchant.Event)} listener Event listener to be added. + [/lang] + [lang:de] + * Fügt einen neuen Ereignisbeobachter hinzu, welcher beim Auftreten des + * Events ausgeführt wird. + * @param {String} type Ereignis Typ. + * @param {function(e:enchant.Event)} listener Der Ereignisbeobachter + * der hinzugefügt wird. + [/lang] + */ + addEventListener: function(type, listener) { + var listeners = this._listeners[type]; + if (listeners == null) { + this._listeners[type] = [listener]; + } else if (listeners.indexOf(listener) === -1) { + listeners.unshift(listener); + + } + }, + /** + * Synonym for addEventListener + * @see {enchant.EventTarget#addEventListener} + * @param {String} type Type of the events. + * @param {function(e:enchant.Event)} listener Event listener to be added. + */ + on: function() { + this.addEventListener.apply(this, arguments); + }, + /** + [lang:ja] + * イベントリスナを削除する. + * @param {String} type イベントのタイプ. + * @param {function(e:enchant.Event)} listener 削除するイベントリスナ. + [/lang] + [lang:en] + * Delete an event listener. + * @param {String} type Type of the events. + * @param {function(e:enchant.Event)} listener Event listener to be deleted. + [/lang] + [lang:de] + * Entfernt einen Ereignisbeobachter. + * @param {String} type Ereignis Typ. + * @param {function(e:enchant.Event)} listener Der Ereignisbeobachter + * der entfernt wird. + [/lang] + */ + removeEventListener: function(type, listener) { + var listeners = this._listeners[type]; + if (listeners != null) { + var i = listeners.indexOf(listener); + if (i !== -1) { + listeners.splice(i, 1); + } + } + }, + /** + [lang:ja] + * すべてのイベントリスナを削除する. + * @param [String] type イベントのタイプ. + [/lang] + [lang:en] + * Clear all defined event listeners of a given type. + * If no type is given, all listeners will be removed. + * @param [String] type Type of the events. + [/lang] + [lang:de] + * Entfernt alle Ereignisbeobachter für einen Typ. + * Wenn kein Typ gegeben ist, werden alle + * Ereignisbeobachter entfernt. + * @param [String] type Ereignis Typ. + [/lang] + */ + clearEventListener: function(type) { + if (type != null) { + delete this._listeners[type]; + } else { + this._listeners = {}; + } + }, + /** + [lang:ja] + * イベントを発行する. + * @param {enchant.Event} e 発行するイベント. + [/lang] + [lang:en] + * Issue an event. + * @param {enchant.Event} e Event to be issued. + [/lang] + [lang:de] + * Löst ein Ereignis aus. + * @param {enchant.Event} e Ereignis das ausgelöst werden soll. + [/lang] + */ + dispatchEvent: function(e) { + e.target = this; + e.localX = e.x - this._offsetX; + e.localY = e.y - this._offsetY; + if (this['on' + e.type] != null){ + this['on' + e.type](e); + } + var listeners = this._listeners[e.type]; + if (listeners != null) { + listeners = listeners.slice(); + for (var i = 0, len = listeners.length; i < len; i++) { + listeners[i].call(this, e); + } + } + } +}); + +/** + * @scope enchant.Core.prototype + */ +(function() { + var core; + /** + * @scope enchant.Core.prototype + */ + enchant.Core = enchant.Class.create(enchant.EventTarget, { + /** + * @name enchant.Core + * @class + [lang:ja] + * アプリケーションのメインループ, シーンを管理するクラス. + * + * インスタンスは一つしか存在することができず, すでにインスタンスが存在する状態で + * コンストラクタを実行した場合既存のものが上書きされる. 存在するインスタンスには + * enchant.Core.instanceからアクセスできる. + * + * @param {Number} width 画面の横幅. + * @param {Number} height 画面の高さ. + [/lang] + [lang:en] + * A class for controlling the core’s main loop and scenes. + * + * There can be only one instance at a time. When the + * constructor is executed while an instance exists, the + * existing instance will be overwritten. The existing instance + * can be accessed from {@link enchant.Core.instance}. + * + * @param {Number} width The width of the core viewport. + * @param {Number} height The height of the core viewport. + [/lang] + [lang:de] + * Klasse, welche die Spielschleife und Szenen kontrolliert. + * + * Es kann immer nur eine Instanz geben und sollte der Konstruktor ausgeführt werden, + * obwohl bereits eine Instanz existiert, wird die vorherige Instanz überschrieben. + * Auf die aktuell existierende Instanz kann über die {@link enchant.Core.instance} + * Variable zugegriffen werden. + * + * @param {Number} width Die Breite des Spieles. + * @param {Number} height Die Höhe des Spieles. + [/lang] + * @constructs + * @extends enchant.EventTarget + */ + initialize: function(width, height) { + if (window.document.body === null) { + // @TODO postpone initialization after window.onload + throw new Error("document.body is null. Please excute 'new Core()' in window.onload."); + } + + enchant.EventTarget.call(this); + var initial = true; + if (core) { + initial = false; + core.stop(); + } + core = enchant.Core.instance = this; + + this._calledTime = 0; + this._mousedownID = 0; + this._surfaceID = 0; + this._soundID = 0; + + this._scenes = []; + + width = width || 320; + height = height || 320; + + var stage = document.getElementById('enchant-stage'); + var scale, sWidth, sHeight; + if (!stage) { + stage = document.createElement('div'); + stage.id = 'enchant-stage'; + stage.style.position = 'absolute'; + + if (document.body.firstChild) { + document.body.insertBefore(stage, document.body.firstChild); + } else { + document.body.appendChild(stage); + } + scale = Math.min( + window.innerWidth / width, + window.innerHeight / height + ); + this._pageX = 0; + this._pageY = 0; + } else { + var style = window.getComputedStyle(stage); + sWidth = parseInt(style.width, 10); + sHeight = parseInt(style.height, 10); + if (sWidth && sHeight) { + scale = Math.min( + sWidth / width, + sHeight / height + ); + } else { + scale = 1; + } + while (stage.firstChild) { + stage.removeChild(stage.firstChild); + } + stage.style.position = 'relative'; + + var bounding = stage.getBoundingClientRect(); + this._pageX = Math.round(window.scrollX || window.pageXOffset + bounding.left); + this._pageY = Math.round(window.scrollY || window.pageYOffset + bounding.top); + } + stage.style.fontSize = '12px'; + stage.style.webkitTextSizeAdjust = 'none'; + stage.style.webkitTapHighlightColor = 'rgba(0, 0, 0, 0)'; + this._element = stage; + + this.addEventListener('coreresize', this._oncoreresize); + + this._width = width; + this._height = height; + this.scale = scale; + + /** + [lang:ja] + * フレームレート. + [/lang] + [lang:en] + * The frame rate of the core. + [/lang] + [lang:de] + * Frame Rate des Spieles. + [/lang] + * @type {Number} + */ + this.fps = 30; + /** + [lang:ja] + * アプリの開始からのフレーム数. + [/lang] + [lang:en] + * The number of frames processed since the core was started. + [/lang] + [lang:de] + * Anzahl der Frames seit dem Spielestart. + [/lang] + * @type {Number} + */ + this.frame = 0; + /** + [lang:ja] + * アプリが実行可能な状態かどうか. + [/lang] + [lang:en] + * Indicates whether or not the core can be executed. + [/lang] + [lang:de] + * Zeigt an ob das Spiel ausgeführt werden kann. + [/lang] + * @type {Boolean} + */ + this.ready = false; + /** + [lang:ja] + * アプリが実行状態かどうか. + [/lang] + [lang:en] + * Indicates whether or not the core is currently running. + [/lang] + [lang:de] + * Zeigt an ob das Spiel derzeit ausgeführt wird. + [/lang] + * @type {Boolean} + */ + this.running = false; + /** + [lang:ja] + * ロードされた画像をパスをキーとして保存するオブジェクト. + [/lang] + [lang:en] + * Object which stores loaded assets using the path as a key. + [/lang] + [lang:de] + * Geladene Objekte werden unter dem Pfad als Schlüssel in diesem Objekt abgelegt. + [/lang] + * @type {Object.} + */ + this.assets = {}; + var assets = this._assets = []; + (function detectAssets(module) { + if (module.assets) { + enchant.Core.instance.preload(module.assets); + } + for (var prop in module) { + if (module.hasOwnProperty(prop)) { + if (typeof module[prop] === 'object' && module[prop] !== null && Object.getPrototypeOf(module[prop]) === Object.prototype) { + detectAssets(module[prop]); + } + } + } + }(enchant)); + + /** + [lang:ja] + * 現在のScene. Sceneスタック中の一番上のScene. + [/lang] + [lang:en] + * The Scene which is currently displayed. This Scene is on top of Scene stack. + [/lang] + [lang:de] + * Die aktuell dargestellte Szene. + * Diese Szene befindet sich oben auf dem Stapelspeicher. + [/lang] + * @type {enchant.Scene} + */ + this.currentScene = null; + /** + [lang:ja] + * ルートScene. Sceneスタック中の一番下のScene. + [/lang] + [lang:en] + * The root Scene. The Scene at bottom of the Scene stack. + [/lang] + [lang:de] + * Die Ursprungsszene. + * Diese Szene befindet sich unten auf dem Stapelspeicher. + [/lang] + * @type {enchant.Scene} + */ + this.rootScene = new enchant.Scene(); + this.pushScene(this.rootScene); + /** + [lang:ja] + * ローディング時に表示されるScene. + [/lang] + [lang:en] + * The Scene to be displayed during loading. + [/lang] + [lang:de] + * Die Szene, welche während des Ladevorgangs dargestellt wird. + [/lang] + * @type {enchant.Scene} + */ + this.loadingScene = new enchant.LoadingScene(); + + /** + [lang:ja] + * 一度でも game.start() が呼ばれたことがあるかどうか。 + [/lang] + [/lang:ja] + * Indicates whether or not game.start() has been called. + [/lang] + * @type {Boolean} + * @private + */ + this._activated = false; + + this._offsetX = 0; + this._offsetY = 0; + + /** + [lang:ja] + * アプリに対する入力状態を保存するオブジェクト. + [/lang] + [lang:en] + * Object that saves the current input state for the core. + [/lang] + [lang:de] + * Objekt, welches den aktuellen Eingabestatus des Spieles speichert. + [/lang] + * @type {Object.} + */ + this.input = {}; + if (!enchant.ENV.KEY_BIND_TABLE) { + enchant.ENV.KEY_BIND_TABLE = {}; + } + this._keybind = enchant.ENV.KEY_BIND_TABLE; + this.pressedKeysNum = 0; + this._internalButtondownListeners = {}; + this._internalButtonupListeners = {}; + + for (var prop in this._keybind) { + this.keybind(prop, this._keybind[prop]); + } + + if (initial) { + stage = enchant.Core.instance._element; + var evt; + document.addEventListener('keydown', function(e) { + core.dispatchEvent(new enchant.Event('keydown')); + if (enchant.ENV.PREVENT_DEFAULT_KEY_CODES.indexOf(e.keyCode) !== -1) { + e.preventDefault(); + e.stopPropagation(); + } + + if (!core.running) { + return; + } + var button = core._keybind[e.keyCode]; + if (button) { + evt = new enchant.Event(button + 'buttondown'); + core.dispatchEvent(evt); + } + }, true); + document.addEventListener('keyup', function(e) { + if (!core.running) { + return; + } + var button = core._keybind[e.keyCode]; + if (button) { + evt = new enchant.Event(button + 'buttonup'); + core.dispatchEvent(evt); + } + }, true); + + if (enchant.ENV.TOUCH_ENABLED) { + stage.addEventListener('touchstart', function(e) { + var tagName = (e.target.tagName).toLowerCase(); + if (enchant.ENV.USE_DEFAULT_EVENT_TAGS.indexOf(tagName) === -1) { + e.preventDefault(); + if (!core.running) { + e.stopPropagation(); + } + } + }, true); + stage.addEventListener('touchmove', function(e) { + var tagName = (e.target.tagName).toLowerCase(); + if (enchant.ENV.USE_DEFAULT_EVENT_TAGS.indexOf(tagName) === -1) { + e.preventDefault(); + if (!core.running) { + e.stopPropagation(); + } + } + }, true); + stage.addEventListener('touchend', function(e) { + var tagName = (e.target.tagName).toLowerCase(); + if (enchant.ENV.USE_DEFAULT_EVENT_TAGS.indexOf(tagName) === -1) { + e.preventDefault(); + if (!core.running) { + e.stopPropagation(); + } + } + }, true); + } + stage.addEventListener('mousedown', function(e) { + var tagName = (e.target.tagName).toLowerCase(); + if (enchant.ENV.USE_DEFAULT_EVENT_TAGS.indexOf(tagName) === -1) { + e.preventDefault(); + core._mousedownID++; + if (!core.running) { + e.stopPropagation(); + } + } + }, true); + stage.addEventListener('mousemove', function(e) { + var tagName = (e.target.tagName).toLowerCase(); + if (enchant.ENV.USE_DEFAULT_EVENT_TAGS.indexOf(tagName) === -1) { + e.preventDefault(); + if (!core.running) { + e.stopPropagation(); + } + } + }, true); + stage.addEventListener('mouseup', function(e) { + var tagName = (e.target.tagName).toLowerCase(); + if (enchant.ENV.USE_DEFAULT_EVENT_TAGS.indexOf(tagName) === -1) { + e.preventDefault(); + if (!core.running) { + e.stopPropagation(); + } + } + }, true); + core._touchEventTarget = {}; + if (enchant.ENV.TOUCH_ENABLED) { + stage.addEventListener('touchstart', function(e) { + var core = enchant.Core.instance; + var evt = new enchant.Event(enchant.Event.TOUCH_START); + var touches = e.changedTouches; + var touch, target; + for (var i = 0, l = touches.length; i < l; i++) { + touch = touches[i]; + evt._initPosition(touch.pageX, touch.pageY); + target = core.currentScene._determineEventTarget(evt); + core._touchEventTarget[touch.identifier] = target; + target.dispatchEvent(evt); + } + }, false); + stage.addEventListener('touchmove', function(e) { + var core = enchant.Core.instance; + var evt = new enchant.Event(enchant.Event.TOUCH_MOVE); + var touches = e.changedTouches; + var touch, target; + for (var i = 0, l = touches.length; i < l; i++) { + touch = touches[i]; + target = core._touchEventTarget[touch.identifier]; + if (target) { + evt._initPosition(touch.pageX, touch.pageY); + target.dispatchEvent(evt); + } + } + }, false); + stage.addEventListener('touchend', function(e) { + var core = enchant.Core.instance; + var evt = new enchant.Event(enchant.Event.TOUCH_END); + var touches = e.changedTouches; + var touch, target; + for (var i = 0, l = touches.length; i < l; i++) { + touch = touches[i]; + target = core._touchEventTarget[touch.identifier]; + if (target) { + evt._initPosition(touch.pageX, touch.pageY); + target.dispatchEvent(evt); + delete core._touchEventTarget[touch.identifier]; + } + } + }, false); + } + stage.addEventListener('mousedown', function(e) { + var core = enchant.Core.instance; + var evt = new enchant.Event(enchant.Event.TOUCH_START); + evt._initPosition(e.pageX, e.pageY); + var target = core.currentScene._determineEventTarget(evt); + core._touchEventTarget[core._mousedownID] = target; + target.dispatchEvent(evt); + }, false); + stage.addEventListener('mousemove', function(e) { + var core = enchant.Core.instance; + var evt = new enchant.Event(enchant.Event.TOUCH_MOVE); + evt._initPosition(e.pageX, e.pageY); + var target = core._touchEventTarget[core._mousedownID]; + if (target) { + target.dispatchEvent(evt); + } + }, false); + stage.addEventListener('mouseup', function(e) { + var core = enchant.Core.instance; + var evt = new enchant.Event(enchant.Event.TOUCH_END); + evt._initPosition(e.pageX, e.pageY); + var target = core._touchEventTarget[core._mousedownID]; + if (target) { + target.dispatchEvent(evt); + } + delete core._touchEventTarget[core._mousedownID]; + }, false); + } + }, + /** + [lang:ja] + * 画面の横幅. + [/lang] + [lang:en] + * The width of the core screen. + [/lang] + [lang:de] + * Breite des Spieles. + [/lang] + * @type {Number} + */ + width: { + get: function() { + return this._width; + }, + set: function(w) { + this._width = w; + this._dispatchCoreResizeEvent(); + } + }, + /** + [lang:ja] + * 画面の高さ. + [/lang] + [lang:en] + * The height of the core screen. + [/lang] + [lang:de] + * Höhe des Spieles. + [/lang] + * @type {Number} + */ + height: { + get: function() { + return this._height; + }, + set: function(h) { + this._height = h; + this._dispatchCoreResizeEvent(); + } + }, + /** + [lang:ja] + * 画面の表示倍率. + [/lang] + [lang:en] + * The scaling of the core rendering. + [/lang] + [lang:de] + * Skalierung der Spieldarstellung. + [/lang] + * @type {Number} + */ + scale: { + get: function() { + return this._scale; + }, + set: function(s) { + this._scale = s; + this._dispatchCoreResizeEvent(); + } + }, + _dispatchCoreResizeEvent: function() { + var e = new enchant.Event('coreresize'); + e.width = this._width; + e.height = this._height; + e.scale = this._scale; + this.dispatchEvent(e); + }, + _oncoreresize: function(e) { + this._element.style.width = Math.floor(this._width * this._scale) + 'px'; + this._element.style.height = Math.floor(this._height * this._scale) + 'px'; + var scene; + for (var i = 0, l = this._scenes.length; i < l; i++) { + scene = this._scenes[i]; + scene.dispatchEvent(e); + } + }, + /** + [lang:ja] + * ファイルのプリロードを行う. + * + * プリロードを行うよう設定されたファイルは{@link enchant.Core#start}が実行されるとき + * ロードが行われる. 全てのファイルのロードが完了したときはCoreオブジェクトからload + * イベントが発行され, Coreオブジェクトのassetsプロパティから画像ファイルの場合は + * Surfaceオブジェクトとして, 音声ファイルの場合はSoundオブジェクトとして, + * その他の場合は文字列としてアクセスできるようになる. + * + * なおこのSurfaceオブジェクトは{@link enchant.Surface.load}を使って作成されたものである + * ため直接画像操作を行うことはできない. enchant.Surface.loadの項を参照. + * + * @example + * core.preload('player.gif'); + * core.onload = function() { + * var sprite = new Sprite(32, 32); + * sprite.image = core.assets['player.gif']; // パス名でアクセス + * ... + * }; + * core.start(); + * + * @param {...String} assets プリロードするファイルのパス. 複数指定できる. + [/lang] + [lang:en] + * File preloader. + * + * Loads the files specified in the parameters when + * {@link enchant.Core#start} is called. + * When all files are loaded, a {@link enchant.Event.LOAD} + * event is dispatched from the Core object. Depending on the + * type of each file, different objects will be created and + * stored in {@link enchant.Core#assets} Variable. + * + * When an image file is loaded, a {@link enchant.Surface} is + * created. If a sound file is loaded, an {@link enchant.Sound} + * object is created. Any other file type will be accessible + * as a string. + * + * In addition, because this Surface object is created with + * {@link enchant.Surface.load}, it is not possible to + * manipulate the image directly. + * Refer to the {@link enchant.Surface.load} documentation. + * + * @example + * core.preload('player.gif'); + * core.onload = function() { + * var sprite = new Sprite(32, 32); + * sprite.image = core.assets['player.gif']; // Access via path + * ... + * }; + * core.start(); + * + * @param {...String} assets Path of images to be preloaded. + * Multiple settings possible. + [/lang] + [lang:de] + * Lässt Dateien im voraus laden. + * + * Diese Methode setzt die Dateien die im voraus geladen werden sollen. Wenn {@link enchant.Core#start} + * aufgerufen wird, findet das tatsächliche laden der Resource statt. Sollten alle Dateien vollständig + * geladen sein, wird ein {@link enchant.Event.LOAD} Ereignis auf dem Core Objekt ausgelöst. + * Abhängig von den Dateien die geladen werden sollen, werden unterschiedliche Objekte erstellt und in + * dem {@link enchant.Core#assets} Feld gespeichert. + * Falls ein Bild geladen wird, wird ein {@link enchant.Surface} Objekt erstellt. Wenn es eine Ton Datei ist, + * wird ein {@link enchant.Sound} Objekt erstellt. Ansonsten kann auf die Datei über einen String zugegriffen werden. + * + * Da die Surface Objekte mittels {@link enchant.Surface.load} erstellt werden ist zusätlich ist zu beachten, dass + * eine direkte Objektmanipulation nicht möglich ist. + * Für diesen Fall ist auf die {@link enchant.Surface.load} Dokumentation zu verweisen. + * + * @example + * core.preload('player.gif'); + * core.onload = function() { + * var sprite = new Sprite(32, 32); + * sprite.image = core.assets['player.gif']; // zugriff mittels Dateipfades + * ... + * }; + * core.start(); + * + * @param {...String} assets Pfade zu den Dateien die im voraus geladen werden sollen. + * Mehrfachangaben möglich. + [/lang] + * @return {enchant.Core} this + */ + preload: function(assets) { + var a; + if (!(assets instanceof Array)) { + if (typeof assets === 'object') { + a = []; + for (var name in assets) { + if (assets.hasOwnProperty(name)) { + a.push([ assets[name], name ]); + } + } + assets = a; + } else { + assets = Array.prototype.slice.call(arguments); + } + } + Array.prototype.push.apply(this._assets, assets); + return this; + }, + /** + [lang:ja] + * ファイルのロードを行う. + * + * @param {String} [src] asset ロードするファイルのパス. + * @param {String} [alias] ロードするファイルに設定したい名前. + * @param {Function} [callback] ファイルのロードが完了したときに呼び出される関数. + * @param {Function} [onerror] ファイルのロードに失敗したときに呼び出される関数. + [/lang] + [lang:en] + * Loads a file. + * + * @param {String} [src] File path of the resource to be loaded. + * @param {String} [asset] Name you want to designate for the resource to be loaded. + * @param {Function} [callback] Function to be called if the file loads successfully. + * @param {Function} [onerror] Function to be called if the file fails to load. + [/lang] + [lang:de] + * Laden von Dateien. + * + * @param {String} asset Pfad zu der Datei die geladen werden soll. + * @param {Function} [callback] Funktion die ausgeführt wird wenn das laden abgeschlossen wurde. + [/lang] + */ + load: function(src, alias, callback, onerror) { + var assetName, offset; + if (typeof arguments[1] === 'string') { + assetName = alias; + offset = 1; + } else { + assetName = src; + offset = 0; + } + callback = arguments[1 + offset] || function() {}; + onerror = arguments[2 + offset] || function() {}; + + var ext = enchant.Core.findExt(src); + + return enchant.Deferred.next(function() { + var d = new enchant.Deferred(); + var _callback = function(e) { + d.call(e); + callback.call(this, e); + }; + var _onerror = function(e) { + d.fail(e); + onerror.call(this, e); + }; + if (enchant.Core._loadFuncs[ext]) { + enchant.Core.instance.assets[assetName] = enchant.Core._loadFuncs[ext](src, ext, _callback, _onerror); + } else { + var req = new XMLHttpRequest(); + req.open('GET', src, true); + req.onreadystatechange = function() { + if (req.readyState === 4) { + if (req.status !== 200 && req.status !== 0) { + // throw new Error(req.status + ': ' + 'Cannot load an asset: ' + src); + var e = new enchant.Event('error'); + e.message = req.status + ': ' + 'Cannot load an asset: ' + src; + _onerror.call(enchant.Core.instance, e); + } + + var type = req.getResponseHeader('Content-Type') || ''; + if (type.match(/^image/)) { + core.assets[assetName] = enchant.Surface.load(src, _callback, _onerror); + } else if (type.match(/^audio/)) { + core.assets[assetName] = enchant.Sound.load(src, type, _callback, _onerror); + } else { + core.assets[assetName] = req.responseText; + _callback.call(enchant.Core.instance, new enchant.Event('laod')); + } + } + }; + req.send(null); + } + return d; + }); + }, + /** + [lang:ja] + * アプリを起動する. + * + * enchant.Core#fpsで設定されたフレームレートに従ってenchant.Core#currentSceneの + * フレームの更新が行われるようになる. プリロードする画像が存在する場合はロードが + * 始まりローディング画面が表示される. + [/lang] + [lang:en] + * Start the core. + * + * Sets the framerate of the {@link enchant.Core#currentScene} + * according to the value stored in {@link enchant.core#fps}. If + * there are images to preload, loading will begin and the + * loading screen will be displayed. + [/lang] + [lang:de] + * Starte das Spiel + * + * Je nach der Frame Rate definiert in {@link enchant.Core#fps}, wird der Frame in der + * {@link enchant.Core#currentScene} aktualisiert. Sollten Dateien die im voraus geladen werden + * sollen vorhanden sein, beginnt das laden dieser Dateien und der Ladebildschirm wird dargestellt. + [/lang] + * @return {enchant.Deferred} Deferred + */ + start: function(deferred) { + var onloadTimeSetter = function() { + this.frame = 0; + this.removeEventListener('load', onloadTimeSetter); + }; + this.addEventListener('load', onloadTimeSetter); + + this.currentTime = window.getTime(); + this.running = true; + this.ready = true; + + if (!this._activated) { + this._activated = true; + if (enchant.ENV.SOUND_ENABLED_ON_MOBILE_SAFARI && !core._touched && + (navigator.userAgent.indexOf('iPhone OS') !== -1 || + navigator.userAgent.indexOf('iPad') !== -1)) { + var d = new enchant.Deferred(); + var scene = new enchant.Scene(); + scene.backgroundColor = '#000'; + var size = Math.round(core.width / 10); + var sprite = new enchant.Sprite(core.width, size); + sprite.y = (core.height - size) / 2; + sprite.image = new enchant.Surface(core.width, size); + sprite.image.context.fillStyle = '#fff'; + sprite.image.context.font = (size - 1) + 'px bold Helvetica,Arial,sans-serif'; + var width = sprite.image.context.measureText('Touch to Start').width; + sprite.image.context.fillText('Touch to Start', (core.width - width) / 2, size - 1); + scene.addChild(sprite); + document.addEventListener('mousedown', function waitTouch() { + document.removeEventListener('mousedown', waitTouch); + core._touched = true; + core.removeScene(scene); + core.start(d); + }, false); + core.pushScene(scene); + return d; + } + } + + this._requestNextFrame(0); + + var ret = this._requestPreload() + .next(function() { + enchant.Core.instance.loadingScene.dispatchEvent(new enchant.Event(enchant.Event.LOAD)); + }); + + if (deferred) { + ret.next(function(arg) { + deferred.call(arg); + }) + .error(function(arg) { + deferred.fail(arg); + }); + } + + return ret; + }, + _requestPreload: function() { + var o = {}; + var loaded = 0, + len = 0, + loadFunc = function() { + var e = new enchant.Event('progress'); + e.loaded = ++loaded; + e.total = len; + core.loadingScene.dispatchEvent(e); + }; + this._assets + .reverse() + .forEach(function(asset) { + var src, name; + if (asset instanceof Array) { + src = asset[0]; + name = asset[1]; + } else { + src = name = asset; + } + if (!o[name]) { + o[name] = this.load(src, name, loadFunc); + len++; + } + }, this); + + this.pushScene(this.loadingScene); + return enchant.Deferred.parallel(o); + }, + /** + [lang:ja] + * アプリをデバッグモードで開始する. + * + * enchant.Core.instance._debug フラグを true にすることでもデバッグモードをオンにすることができる + [/lang] + [lang:en] + * Start application in debug mode. + * + * Core debug mode can be turned on even if the + * enchant.Core.instance._debug flag is already set to true. + [/lang] + [lang:de] + * Startet den Debug-Modus des Spieles. + * + * Auch wenn die enchant.Core.instance._debug Variable gesetzt ist, + * kann der Debug-Modus gestartet werden. + [/lang] + * @return {enchant.Deferred} Deferred + */ + debug: function() { + this._debug = true; + return this.start(); + }, + actualFps: { + get: function() { + return this._actualFps || this.fps; + } + }, + /** + [lang:ja] + * 次のフレームの実行を要求する. + * @param {Number} requestAnimationFrameを呼び出すまでの遅延時間. + [/lang] + [lang:en] + * Requests the next frame. + * @param {Number} Amount of time to delay before calling requestAnimationFrame. + [/lang] + * @private + */ + _requestNextFrame: function(delay) { + if (!this.ready) { + return; + } + if (this.fps >= 60 || delay <= 16) { + this._calledTime = window.getTime(); + window.requestAnimationFrame(this._callTick); + } else { + setTimeout(function() { + var core = enchant.Core.instance; + core._calledTime = window.getTime(); + window.requestAnimationFrame(core._callTick); + }, Math.max(0, delay)); + } + }, + /** + [lang:ja] + * {@link enchant.Core#_tick}を呼び出す. + [/lang] + [lang:en] + * Calls {@link enchant.Core#_tick}. + [/lang] + * @param {Number} [time] + * @private + */ + _callTick: function(time) { + enchant.Core.instance._tick(time); + }, + _tick: function(time) { + var e = new enchant.Event('enterframe'); + var now = window.getTime(); + var elapsed = e.elapsed = now - this.currentTime; + + this._actualFps = elapsed > 0 ? (1000 / elapsed) : 0; + + var nodes = this.currentScene.childNodes.slice(); + var push = Array.prototype.push; + while (nodes.length) { + var node = nodes.pop(); + node.age++; + node.dispatchEvent(e); + if (node.childNodes) { + push.apply(nodes, node.childNodes); + } + } + + this.currentScene.age++; + this.currentScene.dispatchEvent(e); + this.dispatchEvent(e); + + this.dispatchEvent(new enchant.Event('exitframe')); + this.frame++; + now = window.getTime(); + this.currentTime = now; + this._requestNextFrame(1000 / this.fps - (now - this._calledTime)); + }, + getTime: function() { + return window.getTime(); + }, + /** + [lang:ja] + * アプリを停止する. + * + * フレームは更新されず, ユーザの入力も受け付けなくなる. + * enchant.Core#startで再開できる. + [/lang] + [lang:en] + * Stops the core. + * + * The frame will not be updated, and player input will not be accepted anymore. + * Core can be restarted using {@link enchant.Core#start}. + [/lang] + [lang:de] + * Stoppt das Spiel. + * + * Der Frame wird nicht mehr aktualisiert und Spielereingaben werden nicht + * mehr akzeptiert. Das spiel kann mit der {@link enchant.Core#start} Methode + * erneut gestartet werden. + [/lang] + */ + stop: function() { + this.ready = false; + this.running = false; + }, + /** + [lang:ja] + * アプリを一時停止する. + * + * フレームは更新されず, ユーザの入力は受け付ける. + * enchant.Core#startで再開できる. + [/lang] + [lang:en] + * Stops the core. + * + * The frame will not be updated, and player input will not be accepted anymore. + * Core can be started again using {@link enchant.Core#start}. + [/lang] + [lang:de] + * Stoppt das Spiel. + * + * Der Frame wird nicht mehr aktualisiert und Spielereingaben werden nicht + * mehr akzeptiert. Das spiel kann mit der {@link enchant.Core#start} Methode + * erneut gestartet werden. + [/lang] + */ + pause: function() { + this.ready = false; + }, + /** + [lang:ja] + * アプリを再開する。 + [/lang] + [lang:en] + * Resumes the core. + [/lang] + [lang:de] + * Setzt die Ausführung des Spieles fort. + [/lang] + */ + resume: function() { + if (this.ready) { + return; + } + this.currentTime = window.getTime(); + this.ready = true; + this.running = true; + this._requestNextFrame(0); + }, + + /** + [lang:ja] + * 新しいSceneに移行する. + * + * Sceneはスタック状に管理されており, 表示順序もスタックに積み上げられた順に従う. + * enchant.Core#pushSceneを行うとSceneをスタックの一番上に積むことができる. スタックの + * 一番上のSceneに対してはフレームの更新が行われる. + * + * @param {enchant.Scene} scene 移行する新しいScene. + * @return {enchant.Scene} 新しいScene. + [/lang] + [lang:en] + * Switch to a new Scene. + * + * Scenes are controlled using a stack, and the display order also obeys that stack order. + * When {@link enchant.Core#pushScene} is executed, the Scene can be brought to the top of stack. + * Frames will be updated in the Scene which is on the top of the stack. + * + * @param {enchant.Scene} scene The new scene to be switched to. + * @return {enchant.Scene} The new Scene. + [/lang] + [lang:de] + * Wechselt zu einer neuen Szene. + * + * Szenen werden durch einen Stapelspeicher kontrolliert und die Darstellungsreihenfolge + * folgt ebenfalls der Ordnung des Stapelspeichers. + * Wenn die {@link enchant.Core#pushScene} Methode ausgeführt wird, wird die Szene auf dem + * Stapelspeicher oben abgelegt. Der Frame wird immer in der Szene ganz oben auf dem Stapelspeicher + * aktualisiert. + * + * @param {enchant.Scene} scene Die neue Szene zu der gewechselt werden soll. + * @return {enchant.Scene} Die neue Szene. + [/lang] + */ + pushScene: function(scene) { + this._element.appendChild(scene._element); + if (this.currentScene) { + this.currentScene.dispatchEvent(new enchant.Event('exit')); + } + this.currentScene = scene; + this.currentScene.dispatchEvent(new enchant.Event('enter')); + return this._scenes.push(scene); + }, + /** + [lang:ja] + * 現在のSceneを終了させ前のSceneに戻る. + * + * Sceneはスタック状に管理されており, 表示順序もスタックに積み上げられた順に従う. + * enchant.Core#popSceneを行うとスタックの一番上のSceneを取り出すことができる. + * + * @return {enchant.Scene} 終了させたScene. + [/lang] + [lang:en] + * Ends the current Scene, return to the previous Scene. + * + * Scenes are controlled using a stack, and the display order also obeys that stack order. + * When {@link enchant.Core#popScene} is executed, the Scene at the top of the stack + * will be removed and returned. + * + * @return {enchant.Scene} Ended Scene. + [/lang] + [lang:de] + * Beendet die aktuelle Szene und wechselt zu der vorherigen Szene. + * + * Szenen werden durch einen Stapelspeicher kontrolliert und die Darstellungsreihenfolge + * folgt ebenfalls der Ordnung des Stapelspeichers. + * Wenn die {@link enchant.Core#popScene} Methode ausgeführt wird, wird die Szene oben auf dem + * Stapelspeicher entfernt und liefert diese als Rückgabewert. + * + * @return {enchant.Scene} Die Szene, die beendet wurde. + [/lang] + */ + popScene: function() { + if (this.currentScene === this.rootScene) { + return this.currentScene; + } + this._element.removeChild(this.currentScene._element); + this.currentScene.dispatchEvent(new enchant.Event('exit')); + this.currentScene = this._scenes[this._scenes.length - 2]; + this.currentScene.dispatchEvent(new enchant.Event('enter')); + return this._scenes.pop(); + }, + /** + [lang:ja] + * 現在のSceneを別のSceneにおきかえる. + * + * enchant.Core#popScene, enchant.Core#pushSceneを同時に行う. + * + * @param {enchant.Scene} scene おきかえるScene. + * @return {enchant.Scene} 新しいScene. + [/lang] + [lang:en] + * Overwrites the current Scene with a new Scene. + * + * {@link enchant.Core#popScene}, {@link enchant.Core#pushScene} are executed after + * each other to replace to current scene with the new scene. + * + * @param {enchant.Scene} scene The new scene which will replace the previous scene. + * @return {enchant.Scene} The new Scene. + [/lang] + [lang:de] + * Ersetzt die aktuelle Szene durch eine neue Szene. + * + * {@link enchant.Core#popScene}, {@link enchant.Core#pushScene} werden nacheinander + * ausgeführt um die aktuelle Szene durch die neue zu ersetzen. + * + * @param {enchant.Scene} scene Die neue Szene, welche die aktuelle Szene ersetzen wird. + * @return {enchant.Scene} Die neue Szene. + [/lang] + */ + replaceScene: function(scene) { + this.popScene(); + return this.pushScene(scene); + }, + /** + [lang:ja] + * Scene削除する. + * + * Sceneスタック中からSceneを削除する. + * + * @param {enchant.Scene} scene 削除するScene. + * @return {enchant.Scene} 削除したScene. + [/lang] + [lang:en] + * Removes a Scene. + * + * Removes a Scene from the Scene stack. + * + * @param {enchant.Scene} scene Scene to be removed. + * @return {enchant.Scene} The deleted Scene. + [/lang] + [lang:de] + * Entfernt eine Szene. + * + * Entfernt eine Szene aus dem Szenen-Stapelspeicher. + * + * @param {enchant.Scene} scene Die Szene die entfernt werden soll. + * @return {enchant.Scene} Die entfernte Szene. + [/lang] + */ + removeScene: function(scene) { + if (this.currentScene === scene) { + return this.popScene(); + } else { + var i = this._scenes.indexOf(scene); + if (i !== -1) { + this._scenes.splice(i, 1); + this._element.removeChild(scene._element); + return scene; + } else { + return null; + } + } + }, + /** + [lang:ja] + * キーバインドを設定する. + * + * @param {Number} key キーバインドを設定するキーコード. + * @param {String} button 割り当てるボタン. + [/lang] + [lang:en] + * Set a key binding. + * + * @param {Number} key Key code for the button which will be bound. + * @param {String} button The enchant.js button (left, right, up, down, a, b). + [/lang] + [lang:de] + * Bindet eine Taste. + * + * @param {Number} key Der Tastencode der Taste die gebunden werden soll. + * @param {String} button Der enchant.js Knopf (left, right, up, down, a, b). + [/lang] + * @return {enchant.Core} this + */ + keybind: function(key, button) { + this._keybind[key] = button; + var onxbuttondown = function(e) { + var inputEvent; + if (!this.input[button]) { + this.input[button] = true; + inputEvent = new enchant.Event((this.pressedKeysNum++) ? 'inputchange' : 'inputstart'); + this.dispatchEvent(inputEvent); + this.currentScene.dispatchEvent(inputEvent); + } + this.currentScene.dispatchEvent(e); + }; + var onxbuttonup = function(e) { + var inputEvent; + if (this.input[button]) { + this.input[button] = false; + inputEvent = new enchant.Event((--this.pressedKeysNum) ? 'inputchange' : 'inputend'); + this.dispatchEvent(inputEvent); + this.currentScene.dispatchEvent(inputEvent); + } + this.currentScene.dispatchEvent(e); + }; + + this.addEventListener(button + 'buttondown', onxbuttondown); + this.addEventListener(button + 'buttonup', onxbuttonup); + + this._internalButtondownListeners[key] = onxbuttondown; + this._internalButtonupListeners[key] = onxbuttonup; + return this; + }, + /** + [lang:ja] + * キーバインドを削除する. + * @param {Number} key 削除するキーコード. + [/lang] + [lang:en] + * Delete a key binding. + * + * @param {Number} key Key code that want to delete. + [/lang] + [lang:de] + * Entbindet eine Taste. + * + * @param {Number} key Der Tastencode der entfernt werden soll. + [/lang] + * @return {enchant.Core} this + */ + keyunbind: function(key) { + if (!this._keybind[key]) { + return this; + } + var buttondowns = this._internalButtondownListeners; + var buttonups = this._internalButtonupListeners; + + this.removeEventListener(key + 'buttondown', buttondowns); + this.removeEventListener(key + 'buttonup', buttonups); + + delete buttondowns[key]; + delete buttonups[key]; + + delete this._keybind[key]; + + return this; + }, + /** + [lang:ja] + * Core#start が呼ばれてから経過した時間を取得する + * @return {Number} 経過した時間 (秒) + [/lang] + [lang:en] + * Get the elapsed core time (not actual) from when core.start was called. + * @return {Number} The elapsed time (seconds) + [/lang] + [lang:de] + * Liefert die vergange Spielzeit (keine reale) die seit dem Aufruf von core.start + * vergangen ist. + * @return {Number} Die vergangene Zeit (Sekunden) + [/lang] + */ + getElapsedTime: function() { + return this.frame / this.fps; + } + }); + + /** + [lang:ja] + * 拡張子に対応したアセットのロード関数. + * ロード関数はファイルのパス, 拡張子, コールバックを引数に取り, + * 対応したクラスのインスタンスを返す必要がある. + * コールバックはEvent.LOADとEvent.ERRORでハンドルする. + [/lang] + * @static + * @private + * @type {Object.} + */ + enchant.Core._loadFuncs = {}; + enchant.Core._loadFuncs['jpg'] = + enchant.Core._loadFuncs['jpeg'] = + enchant.Core._loadFuncs['gif'] = + enchant.Core._loadFuncs['png'] = + enchant.Core._loadFuncs['bmp'] = function(src, ext, callback, onerror) { + return enchant.Surface.load(src, callback, onerror); + }; + enchant.Core._loadFuncs['mp3'] = + enchant.Core._loadFuncs['aac'] = + enchant.Core._loadFuncs['m4a'] = + enchant.Core._loadFuncs['wav'] = + enchant.Core._loadFuncs['ogg'] = function(src, ext, callback, onerror) { + return enchant.Sound.load(src, 'audio/' + ext, callback, onerror); + }; + + /** + * Get the file extension from a path + * @param path + * @return {*} + */ + enchant.Core.findExt = function(path) { + var matched = path.match(/\.\w+$/); + if (matched && matched.length > 0) { + return matched[0].slice(1).toLowerCase(); + } + + // for data URI + if (path.indexOf('data:') === 0) { + return path.split(/[\/;]/)[1].toLowerCase(); + } + return null; + }; + + /** + [lang:ja] + * 現在のCoreインスタンス. + [/lang] + [lang:en] + * The Current Core instance. + [/lang] + [lang:de] + * Die aktuelle Instanz des Spieles. + [/lang] + * @type {enchant.Core} + * @static + */ + enchant.Core.instance = null; +}()); + +/** + * enchant.Core is moved to enchant.Core from v0.6 + * @type {*} + */ +enchant.Game = enchant.Core; +/** + * @scope enchant.Node.prototype + */ +enchant.Node = enchant.Class.create(enchant.EventTarget, { + /** + * @name enchant.Node + * @class + [lang:ja] + * Sceneをルートとした表示オブジェクトツリーに属するオブジェクトの基底クラス. + * 直接使用することはない. + [/lang] + [lang:en] + * Base class for objects in the display tree which is rooted at a Scene. + * Not to be used directly. + [/lang] + [lang:de] + * Basisklasse für Objekte die im Darstellungsbaum, + * dessen Wurzel eine Szene ist, enthalten sind. + * Sollte nicht direkt verwendet werden. + [/lang] + * @constructs + * @extends enchant.EventTarget + */ + initialize: function() { + enchant.EventTarget.call(this); + + this._dirty = false; + + this._matrix = [ 1, 0, 0, 1, 0, 0 ]; + + this._x = 0; + this._y = 0; + this._offsetX = 0; + this._offsetY = 0; + + /** + [lang:ja] + * Node が画面に表示されてから経過したフレーム数。 + * {@link enchant.Event.ENTER_FRAME} イベントを受け取る前にインクリメントされる。 + * (ENTER_FRAME イベントのリスナが初めて実行される時に 1 となる。) + [/lang] + [lang:en] + * The age (frames) of this node which will be increased before this node receives {@link enchant.Event.ENTER_FRAME} event. + [/lang] + [lang:de] + * Das Alter (Frames) dieses Nodes welches vor dem {@link enchant.Event.ENTER_FRAME} Ereignis erhöht wird. + [/lang] + * @type {Number} + */ + this.age = 0; + + /** + [lang:ja] + * Nodeの親Node. + [/lang] + [lang:en] + * Parent Node of this Node. + [/lang] + [lang:de] + * Der Eltern-Node dieses Node. + [/lang] + * @type {enchant.Group} + */ + this.parentNode = null; + /** + [lang:ja] + * Nodeが属しているScene. + [/lang] + [lang:en] + * Scene to which Node belongs. + [/lang] + [lang:de] + * Die Szene, zu welcher dieser Node gehört. + [/lang] + * @type {enchant.Scene} + */ + this.scene = null; + + this.addEventListener('touchstart', function(e) { + if (this.parentNode) { + this.parentNode.dispatchEvent(e); + } + }); + this.addEventListener('touchmove', function(e) { + if (this.parentNode) { + this.parentNode.dispatchEvent(e); + } + }); + this.addEventListener('touchend', function(e) { + if (this.parentNode) { + this.parentNode.dispatchEvent(e); + } + }); + + /** + [lang:ja] + * Node が生成される際に、tl プロパティに Timeline オブジェクトを追加している + [/lang] + */ + if(enchant.ENV.USE_ANIMATION){ + var tl = this.tl = new enchant.Timeline(this); + } + }, + /** + [lang:ja] + * Nodeを移動する. + * @param {Number} x 移動先のx座標. + * @param {Number} y 移動先のy座標. + [/lang] + [lang:en] + * Move the Node to the given target location. + * @param {Number} x Target x coordinates. + * @param {Number} y Target y coordinates. + [/lang] + [lang:de] + * Bewegt diesen Node zu den gegebenen Ziel Koordinaten. + * @param {Number} x Ziel x Koordinaten. + * @param {Number} y Ziel y Koordinaten. + [/lang] + */ + moveTo: function(x, y) { + this._x = x; + this._y = y; + this._dirty = true; + }, + /** + [lang:ja] + * Nodeを移動する. + * @param {Number} x 移動するx軸方向の距離. + * @param {Number} y 移動するy軸方向の距離. + [/lang] + [lang:en] + * Move the Node relative to its current position. + * @param {Number} x x axis movement distance. + * @param {Number} y y axis movement distance. + [/lang] + [lang:de] + * Bewegt diesen Node relativ zur aktuellen Position. + * @param {Number} x Distanz auf der x Achse. + * @param {Number} y Distanz auf der y Achse. + [/lang] + */ + moveBy: function(x, y) { + this._x += x; + this._y += y; + this._dirty = true; + }, + /** + [lang:ja] + * Nodeのx座標. + [/lang] + [lang:en] + * x coordinates of the Node. + [/lang] + [lang:de] + * Die x Koordinaten des Nodes. + [/lang] + * @type {Number} + */ + x: { + get: function() { + return this._x; + }, + set: function(x) { + this._x = x; + this._dirty = true; + } + }, + /** + [lang:ja] + * Nodeのy座標. + [/lang] + [lang:en] + * y coordinates of the Node. + [/lang] + [lang:de] + * Die y Koordinaten des Nodes. + [/lang] + * @type {Number} + */ + y: { + get: function() { + return this._y; + }, + set: function(y) { + this._y = y; + this._dirty = true; + } + }, + _updateCoordinate: function() { + var node = this; + var tree = [ node ]; + var parent = node.parentNode; + var scene = this.scene; + while (parent && node._dirty) { + tree.unshift(parent); + node = node.parentNode; + parent = node.parentNode; + } + var matrix = enchant.Matrix.instance; + var stack = matrix.stack; + var mat = []; + var newmat, ox, oy; + stack.push(tree[0]._matrix); + for (var i = 1, l = tree.length; i < l; i++) { + node = tree[i]; + newmat = []; + matrix.makeTransformMatrix(node, mat); + matrix.multiply(stack[stack.length - 1], mat, newmat); + node._matrix = newmat; + stack.push(newmat); + ox = (typeof node._originX === 'number') ? node._originX : node._width / 2 || 0; + oy = (typeof node._originY === 'number') ? node._originY : node._height / 2 || 0; + var vec = [ ox, oy ]; + matrix.multiplyVec(newmat, vec, vec); + node._offsetX = vec[0] - ox; + node._offsetY = vec[1] - oy; + node._dirty = false; + } + matrix.reset(); + }, + remove: function() { + if (this._listener) { + this.clearEventListener(); + } + if (this.parentNode) { + this.parentNode.removeChild(this); + } + } +}); + +var _intersectBetweenClassAndInstance = function(Class, instance) { + var ret = []; + var c; + for (var i = 0, l = Class.collection.length; i < l; i++) { + c = Class.collection[i]; + if (instance._intersectOne(c)) { + ret.push(c); + } + } + return ret; +}; + +var _intersectBetweenClassAndClass = function(Class1, Class2) { + var ret = []; + var c1, c2; + for (var i = 0, l = Class1.collection.length; i < l; i++) { + c1 = Class1.collection[i]; + for (var j = 0, ll = Class2.collection.length; j < ll; j++) { + c2 = Class2.collection[j]; + if (c1._intersectOne(c2)) { + ret.push([ c1, c2 ]); + } + } + } + return ret; +}; + +var _intersectStrictBetweenClassAndInstance = function(Class, instance) { + var ret = []; + var c; + for (var i = 0, l = Class.collection.length; i < l; i++) { + c = Class.collection[i]; + if (instance._intersectStrictOne(c)) { + ret.push(c); + } + } + return ret; +}; + +var _intersectStrictBetweenClassAndClass = function(Class1, Class2) { + var ret = []; + var c1, c2; + for (var i = 0, l = Class1.collection.length; i < l; i++) { + c1 = Class1.collection[i]; + for (var j = 0, ll = Class2.collection.length; j < ll; j++) { + c2 = Class2.collection[j]; + if (c1._intersectStrictOne(c2)) { + ret.push([ c1, c2 ]); + } + } + } + return ret; +}; + +var _staticIntersect = function(other) { + if (other instanceof enchant.Entity) { + return _intersectBetweenClassAndInstance(this, other); + } else if (typeof other === 'function' && other.collection) { + return _intersectBetweenClassAndClass(this, other); + } + return false; +}; + +var _staticIntersectStrict = function(other) { + if (other instanceof enchant.Entity) { + return _intersectStrictBetweenClassAndInstance(this, other); + } else if (typeof other === 'function' && other.collection) { + return _intersectStrictBetweenClassAndClass(this, other); + } + return false; +}; + +/** + * @scope enchant.Entity.prototype + */ +enchant.Entity = enchant.Class.create(enchant.Node, { + /** + * @name enchant.Entity + * @class + [lang:ja] + * DOM上で表示する実体を持ったクラス. 直接使用することはない. + [/lang] + [lang:en] + * A class with objects displayed as DOM elements. Not to be used directly. + [/lang] + [lang:de] + * Eine Klasse die Objekte mit Hilfe von DOM Elementen darstellt. + * Sollte nicht direkt verwendet werden. + [/lang] + * @constructs + * @extends enchant.Node + */ + initialize: function() { + var core = enchant.Core.instance; + enchant.Node.call(this); + + this._rotation = 0; + this._scaleX = 1; + this._scaleY = 1; + + this._touchEnabled = true; + this._clipping = false; + + this._originX = null; + this._originY = null; + + this._width = 0; + this._height = 0; + this._backgroundColor = null; + this._debugColor = '#0000ff'; + this._opacity = 1; + this._visible = true; + this._buttonMode = null; + + this._style = {}; + this.__styleStatus = {}; + + /** + [lang:ja] + * Entityを描画する際の合成処理を設定する. + * Canvas上に描画する際のみ有効. + * CanvasのコンテキストのglobalCompositeOperationにセットされる. + [/lang] + */ + this.compositeOperation = null; + + /** + [lang:ja] + * Entityにボタンの機能を設定する. + * Entityに対するタッチ, クリックをleft, right, up, down, a, bいずれかの + * ボタン入力として割り当てる. + [/lang] + [lang:en] + * Defines this Entity as a button. + * When touched or clicked the corresponding button event is dispatched. + * Valid buttonModes are: left, right, up, down, a, b. + [/lang] + [lang:de] + * Definiert diese Entity als Schaltfläche (Button). + * Bei einem Klick oder Touch wird das entsprechende + * Button Ereignis (Event) ausgelöst. + * Mögliche buttonModes sind: left, right, up, down, a, b. + [/lang] + * @type {String} + */ + this.buttonMode = null; + /** + [lang:ja] + * Entityが押されているかどうか. + * {@link enchant.Entity.buttonMode}が設定されているときだけ機能する. + [/lang] + [lang:en] + * Indicates if this Entity is being clicked. + * Only works when {@link enchant.Entity.buttonMode} is set. + [/lang] + [lang:de] + * Zeigt an, ob auf die Entity geklickt wurde. + * Funktioniert nur wenn {@link enchant.Entity.buttonMode} gesetzt ist. + [/lang] + * @type {Boolean} + */ + this.buttonPressed = false; + this.addEventListener('touchstart', function() { + if (!this.buttonMode) { + return; + } + this.buttonPressed = true; + var e = new enchant.Event(this.buttonMode + 'buttondown'); + this.dispatchEvent(e); + core.dispatchEvent(e); + }); + this.addEventListener('touchend', function() { + if (!this.buttonMode) { + return; + } + this.buttonPressed = false; + var e = new enchant.Event(this.buttonMode + 'buttonup'); + this.dispatchEvent(e); + core.dispatchEvent(e); + }); + + this.enableCollection(); + }, + /** + [lang:ja] + * Entityの横幅. + [/lang] + [lang:en] + * The width of the Entity. + [/lang] + [lang:de] + * Die Breite der Entity. + [/lang] + * @type {Number} + */ + width: { + get: function() { + return this._width; + }, + set: function(width) { + this._width = width; + this._dirty = true; + } + }, + /** + [lang:ja] + * Entityの高さ. + [/lang] + [lang:en] + * The height of the Entity. + [/lang] + [lang:de] + * Die Höhe der Entity. + [/lang] + * @type {Number} + */ + height: { + get: function() { + return this._height; + }, + set: function(height) { + this._height = height; + this._dirty = true; + } + }, + /** + [lang:ja] + * Entityの背景色. + * CSSの'color'プロパティと同様の形式で指定できる. + [/lang] + [lang:en] + * The Entity background color. + * Must be provided in the same format as the CSS 'color' property. + [/lang] + [lang:de] + * Die Hintergrundfarbe der Entity. + * Muss im gleichen Format definiert werden wie das CSS 'color' Attribut. + [/lang] + * @type {String} + */ + backgroundColor: { + get: function() { + return this._backgroundColor; + }, + set: function(color) { + this._backgroundColor = color; + } + }, + /** + [lang:ja] + * Entityのデバッグの枠色. + * CSSの'color'プロパティと同様の形式で指定できる. + [/lang] + [lang:en] + * The Entity debug color. + * Must be provided in the same format as the CSS 'color' property. + [/lang] + * @type {String} + */ + debugColor: { + get: function() { + return this._debugColor; + }, + set: function(color) { + this._debugColor = color; + } + }, + /** + [lang:ja] + * Entityの透明度. + * 0から1までの値を設定する(0が完全な透明, 1が完全な不透明). + [/lang] + [lang:en] + * The transparency of this entity. + * Defines the transparency level from 0 to 1 + * (0 is completely transparent, 1 is completely opaque). + [/lang] + [lang:de] + * Transparenz der Entity. + * Definiert den Level der Transparenz von 0 bis 1 + * (0 ist komplett transparent, 1 ist vollständig deckend). + [/lang] + * @type {Number} + */ + opacity: { + get: function() { + return this._opacity; + }, + set: function(opacity) { + this._opacity = parseFloat(opacity); + } + }, + /** + [lang:ja] + * Entityを表示するかどうかを指定する. + [/lang] + [lang:en] + * Indicates whether or not to display this Entity. + [/lang] + [lang:de] + * Zeigt an, ob die Entity dargestellt werden soll oder nicht. + [/lang] + * @type {Boolean} + */ + visible: { + get: function() { + return this._visible; + }, + set: function(visible) { + this._visible = visible; + } + }, + /** + [lang:ja] + * Entityのタッチを有効にするかどうかを指定する. + [/lang] + [lang:en] + * Indicates whether or not this Entity can be touched. + [/lang] + [lang:de] + * Definiert ob auf die Entity geklickt werden kann. + [/lang] + * @type {Boolean} + */ + touchEnabled: { + get: function() { + return this._touchEnabled; + }, + set: function(enabled) { + this._touchEnabled = enabled; + if (enabled) { + this._style.pointerEvents = 'all'; + } else { + this._style.pointerEvents = 'none'; + } + } + }, + /** + [lang:ja] + * Entityの矩形が交差しているかどうかにより衝突判定を行う. + * @param {*} other 衝突判定を行うEntityなどx, y, width, heightプロパティを持ったObject. + * @return {Boolean} 衝突判定の結果. + [/lang] + [lang:en] + * Performs a collision detection based on whether or not the bounding rectangles are intersecting. + * @param {*} other An object like Entity, with the properties x, y, width, height, which are used for the + * collision detection. + * @return {Boolean} True, if a collision was detected. + [/lang] + [lang:de] + * Führt eine Kollisionsdetektion durch, die überprüft ob eine Überschneidung zwischen den + * begrenzenden Rechtecken existiert. + * @param {*} other Ein Objekt wie Entity, welches x, y, width und height Variablen besitzt, + * mit dem die Kollisionsdetektion durchgeführt wird. + * @return {Boolean} True, falls eine Kollision festgestellt wurde. + [/lang] + */ + intersect: function(other) { + if (other instanceof enchant.Entity) { + return this._intersectOne(other); + } else if (typeof other === 'function' && other.collection) { + return _intersectBetweenClassAndInstance(other, this); + } + return false; + }, + _intersectOne: function(other) { + if (this._dirty) { + this._updateCoordinate(); + } if (other._dirty) { + other._updateCoordinate(); + } + return this._offsetX < other._offsetX + other.width && other._offsetX < this._offsetX + this.width && + this._offsetY < other._offsetY + other.height && other._offsetY < this._offsetY + this.height; + }, + intersectStrict: function(other) { + if (other instanceof enchant.Entity) { + return this._intersectStrictOne(other); + } else if (typeof other === 'function' && other.collection) { + return _intersectStrictBetweenClassAndInstance(other, this); + } + return false; + }, + _intersectStrictOne: function(other) { + if (this._dirty) { + this._updateCoordinate(); + } if (other._dirty) { + other._updateCoordinate(); + } + var rect1 = this.getOrientedBoundingRect(), + rect2 = other.getOrientedBoundingRect(), + lt1 = rect1.leftTop, rt1 = rect1.rightTop, + lb1 = rect1.leftBottom, rb1 = rect1.rightBottom, + lt2 = rect2.leftTop, rt2 = rect2.rightTop, + lb2 = rect2.leftBottom, rb2 = rect2.rightBottom, + ltx1 = lt1[0], lty1 = lt1[1], rtx1 = rt1[0], rty1 = rt1[1], + lbx1 = lb1[0], lby1 = lb1[1], rbx1 = rb1[0], rby1 = rb1[1], + ltx2 = lt2[0], lty2 = lt2[1], rtx2 = rt2[0], rty2 = rt2[1], + lbx2 = lb2[0], lby2 = lb2[1], rbx2 = rb2[0], rby2 = rb2[1], + t1 = [ rtx1 - ltx1, rty1 - lty1 ], + r1 = [ rbx1 - rtx1, rby1 - rty1 ], + b1 = [ lbx1 - rbx1, lby1 - rby1 ], + l1 = [ ltx1 - lbx1, lty1 - lby1 ], + t2 = [ rtx2 - ltx2, rty2 - lty2 ], + r2 = [ rbx2 - rtx2, rby2 - rty2 ], + b2 = [ lbx2 - rbx2, lby2 - rby2 ], + l2 = [ ltx2 - lbx2, lty2 - lby2 ], + cx1 = (ltx1 + rtx1 + lbx1 + rbx1) >> 2, + cy1 = (lty1 + rty1 + lby1 + rby1) >> 2, + cx2 = (ltx2 + rtx2 + lbx2 + rbx2) >> 2, + cy2 = (lty2 + rty2 + lby2 + rby2) >> 2, + i, j, poss1, poss2, dirs1, dirs2, pos1, pos2, dir1, dir2, + px1, py1, px2, py2, dx1, dy1, dx2, dy2, vx, vy, c, c1, c2; + if (t1[0] * (cy2 - lty1) - t1[1] * (cx2 - ltx1) > 0 && + r1[0] * (cy2 - rty1) - r1[1] * (cx2 - rtx1) > 0 && + b1[0] * (cy2 - rby1) - b1[1] * (cx2 - rbx1) > 0 && + l1[0] * (cy2 - lby1) - l1[1] * (cx2 - lbx1) > 0) { + return true; + } else if (t2[0] * (cy1 - lty2) - t2[1] * (cx1 - ltx2) > 0 && + r2[0] * (cy1 - rty2) - r2[1] * (cx1 - rtx2) > 0 && + b2[0] * (cy1 - rby2) - b2[1] * (cx1 - rbx2) > 0 && + l2[0] * (cy1 - lby2) - l2[1] * (cx1 - lbx2) > 0) { + return true; + } else { + poss1 = [ lt1, rt1, rb1, lb1 ]; + poss2 = [ lt2, rt2, rb2, lb2 ]; + dirs1 = [ t1, r1, b1, l1 ]; + dirs2 = [ t2, r2, b2, l2 ]; + for (i = 0; i < 4; i++) { + pos1 = poss1[i]; + px1 = pos1[0]; py1 = pos1[1]; + dir1 = dirs1[i]; + dx1 = dir1[0]; dy1 = dir1[1]; + for (j = 0; j < 4; j++) { + pos2 = poss2[j]; + px2 = pos2[0]; py2 = pos2[1]; + dir2 = dirs2[j]; + dx2 = dir2[0]; dy2 = dir2[1]; + c = dx1 * dy2 - dy1 * dx2; + if (c !== 0) { + vx = px2 - px1; + vy = py2 - py1; + c1 = (vx * dy1 - vy * dx1) / c; + c2 = (vx * dy2 - vy * dx2) / c; + if (0 < c1 && c1 < 1 && 0 < c2 && c2 < 1) { + return true; + } + } + } + } + return false; + } + }, + /** + [lang:ja] + * Entityの中心点どうしの距離により衝突判定を行う. + * @param {*} other 衝突判定を行うEntityなどx, y, width, heightプロパティを持ったObject. + * @param {Number} [distance] 衝突したと見なす最大の距離. デフォルト値は二つのEntityの横幅と高さの平均. + * @return {Boolean} 衝突判定の結果. + [/lang] + [lang:en] + * Performs a collision detection based on distance from the Entity's central point. + * @param {*} other An object like Entity, with properties x, y, width, height, which are used for the + * collision detection. + * @param {Number} [distance] The greatest distance to be considered for a collision. + * The default distance is the average of both objects width and height. + * @return {Boolean} True, if a collision was detected. + [/lang] + [lang:de] + * Führt eine Kollisionsdetektion durch, die anhand der Distanz zwischen den Objekten feststellt, + * ob eine Kollision aufgetreten ist. + * @param {*} other Ein Objekt wie Entity, welches x, y, width und height Variablen besitzt, + * mit dem die Kollisionsdetektion durchgeführt wird. + * @param {Number} [distance] Die größte Distanz die für die Kollision in betracht gezogen wird. + * Der Standardwert ist der Durchschnitt der Breite und Höhe beider Objekte. + * @return {Boolean} True, falls eine Kollision festgestellt wurde. + [/lang] + */ + within: function(other, distance) { + if (this._dirty) { + this._updateCoordinate(); + } if (other._dirty) { + other._updateCoordinate(); + } + if (distance == null) { + distance = (this.width + this.height + other.width + other.height) / 4; + } + var _; + return (_ = this._offsetX - other._offsetX + (this.width - other.width) / 2) * _ + + (_ = this._offsetY - other._offsetY + (this.height - other.height) / 2) * _ < distance * distance; + }, /** + [lang:ja] + * Spriteを拡大縮小する. + * @param {Number} x 拡大するx軸方向の倍率. + * @param {Number} [y] 拡大するy軸方向の倍率. + [/lang] + [lang:en] + * Enlarges or shrinks this Sprite. + * @param {Number} x Scaling factor on the x axis. + * @param {Number} [y] Scaling factor on the y axis. + [/lang] + [lang:de] + * Vergrößert oder verkleinert dieses Sprite. + * @param {Number} x Skalierungsfaktor auf der x-Achse. + * @param {Number} [y] Skalierungsfaktor auf der y-Achse. + [/lang] + */ + scale: function(x, y) { + this._scaleX *= x; + this._scaleY *= (y != null) ? y : x; + this._dirty = true; + }, + /** + [lang:ja] + * Spriteを回転する. + * @param {Number} deg 回転する角度 (度数法). + [/lang] + [lang:en] + * Rotate this Sprite. + * @param {Number} deg Rotation angle (degree). + [/lang] + [lang:de] + * Rotiert dieses Sprite. + * @param {Number} deg Rotationswinkel (Grad). + [/lang] + */ + rotate: function(deg) { + this._rotation += deg; + this._dirty = true; + }, + /** + [lang:ja] + * Spriteのx軸方向の倍率. + [/lang] + [lang:en] + * Scaling factor on the x axis of this Sprite. + [/lang] + [lang:de] + * Skalierungsfaktor auf der x-Achse dieses Sprites. + [/lang] + * @type {Number} + */ + scaleX: { + get: function() { + return this._scaleX; + }, + set: function(scaleX) { + this._scaleX = scaleX; + this._dirty = true; + } + }, + /** + [lang:ja] + * Spriteのy軸方向の倍率. + [/lang] + [lang:en] + * Scaling factor on the y axis of this Sprite. + [/lang] + [lang:de] + * Skalierungsfaktor auf der y-Achse dieses Sprites. + [/lang] + * @type {Number} + */ + scaleY: { + get: function() { + return this._scaleY; + }, + set: function(scaleY) { + this._scaleY = scaleY; + this._dirty = true; + } + }, + /** + [lang:ja] + * Spriteの回転角 (度数法). + [/lang] + [lang:en] + * Sprite rotation angle (degree). + [/lang] + [lang:de] + * Rotationswinkel des Sprites (Grad). + [/lang] + * @type {Number} + */ + rotation: { + get: function() { + return this._rotation; + }, + set: function(rotation) { + this._rotation = rotation; + this._dirty = true; + } + }, + /** + [lang:ja] + * 回転・拡大縮小の基準点のX座標 + [/lang] + [lang:en] + * The point of origin used for rotation and scaling. + [/lang] + [lang:de] + * Ausgangspunkt für Rotation und Skalierung. + [/lang] + * @type {Number} + */ + originX: { + get: function() { + return this._originX; + }, + set: function(originX) { + this._originX = originX; + this._dirty = true; + } + }, + /** + [lang:ja] + * 回転・拡大縮小の基準点のY座標 + [/lang] + [lang:en] + * The point of origin used for rotation and scaling. + [/lang] + [lang:de] + * Ausgangspunkt für Rotation und Skalierung. + [/lang] + * @type {Number} + */ + originY: { + get: function() { + return this._originY; + }, + set: function(originY) { + this._originY = originY; + this._dirty = true; + } + }, + /** + [lang:ja] + * インスタンスをコレクションの対象にする. + * デフォルトで呼び出される. + [/lang] + */ + enableCollection: function() { + this.addEventListener('addedtoscene', this._addSelfToCollection); + this.addEventListener('removedfromscene', this._removeSelfFromCollection); + if (this.scene) { + this._addSelfToCollection(); + } + }, + /** + [lang:ja] + * インスタンスをコレクションの対象から除外する. + [/lang] + */ + disableCollection: function() { + this.removeEventListener('addedtoscene', this._addSelfToCollection); + this.removeEventListener('removedfromscene', this._removeSelfFromCollection); + if (this.scene) { + this._removeSelfFromCollection(); + } + }, + _addSelfToCollection: function() { + var Constructor = this.getConstructor(); + Constructor._collectionTarget.forEach(function(C) { + C.collection.push(this); + }, this); + }, + _removeSelfFromCollection: function() { + var Constructor = this.getConstructor(); + Constructor._collectionTarget.forEach(function(C) { + var i = C.collection.indexOf(this); + if (i !== -1) { + C.collection.splice(i, 1); + } + }, this); + }, + getBoundingRect: function() { + var w = this.width || 0; + var h = this.height || 0; + var mat = this._matrix; + var m11w = mat[0] * w, m12w = mat[1] * w, + m21h = mat[2] * h, m22h = mat[3] * h, + mdx = mat[4], mdy = mat[5]; + var xw = [ mdx, m11w + mdx, m21h + mdx, m11w + m21h + mdx ].sort(function(a, b) { return a - b; }); + var yh = [ mdy, m12w + mdy, m22h + mdy, m12w + m22h + mdy ].sort(function(a, b) { return a - b; }); + + return { + left: xw[0], + top: yh[0], + width: xw[3] - xw[0], + height: yh[3] - yh[0] + }; + }, + getOrientedBoundingRect: function() { + var w = this.width || 0; + var h = this.height || 0; + var mat = this._matrix; + var m11w = mat[0] * w, m12w = mat[1] * w, + m21h = mat[2] * h, m22h = mat[3] * h, + mdx = mat[4], mdy = mat[5]; + + return { + leftTop: [ mdx, mdy ], + rightTop: [ m11w + mdx, m12w + mdy ], + leftBottom: [ m21h + mdx, m22h + mdy ], + rightBottom: [ m11w + m21h + mdx, m12w + m22h + mdy ] + }; + }, + getConstructor: function() { + return Object.getPrototypeOf(this).constructor; + } +}); + +var _collectizeConstructor = function(Constructor) { + if (Constructor._collective) { + return; + } + var rel = enchant.Class.getInheritanceTree(Constructor); + var i = rel.indexOf(enchant.Entity); + if (i !== -1) { + Constructor._collectionTarget = rel.splice(0, i + 1); + } else { + Constructor._collectionTarget = []; + } + Constructor.intersect = _staticIntersect; + Constructor.intersectStrict = _staticIntersectStrict; + Constructor.collection = []; + Constructor._collective = true; +}; + +_collectizeConstructor(enchant.Entity); + +enchant.Entity._inherited = function(subclass) { + _collectizeConstructor(subclass); +}; + +/** + * @scope enchant.Sprite.prototype + */ +enchant.Sprite = enchant.Class.create(enchant.Entity, { + /** + * @name enchant.Sprite + * @class + [lang:ja] + * 画像表示機能を持ったクラス. Entity を継承している. + * + * @param {Number} [width] Spriteの横幅. + * @param {Number} [height] Spriteの高さ. + [/lang] + [lang:en] + * Class which can display images. + * + * @param {Number} [width] Sprite width. + * @param {Number} [height] Sprite height. + [/lang] + [lang:de] + * Eine Klasse die Grafiken darstellen kann. + * + * @param {Number} [width] Die Breite des Sprites. + * @param {Number} [height] Die Höhe des Sprites. + [/lang] + * @example + * var bear = new Sprite(32, 32); + * bear.image = core.assets['chara1.gif']; + * + * @constructs + * @extends enchant.Entity + */ + initialize: function(width, height) { + enchant.Entity.call(this); + + this.width = width; + this.height = height; + this._image = null; + this._debugColor = '#ff0000'; + this._frameLeft = 0; + this._frameTop = 0; + this._frame = 0; + this._frameSequence = []; + /** + [lang:ja] + * frame に配列が指定されたときの処理。 + [/lang] + */ + this.addEventListener('enterframe', function() { + if (this._frameSequence.length !== 0) { + var nextFrame = this._frameSequence.shift(); + if (nextFrame === null) { + this._frameSequence = []; + } else { + this._setFrame(nextFrame); + this._frameSequence.push(nextFrame); + } + } + }); + }, + /** + [lang:ja] + * Spriteで表示する画像. + [/lang] + [lang:en] + * Image displayed in the Sprite. + [/lang] + [lang:de] + * Die Grafik die im Sprite dargestellt wird. + [/lang] + * @type {enchant.Surface} + */ + image: { + get: function() { + return this._image; + }, + set: function(image) { + if (image === undefined) { + throw new Error('Assigned value on Sprite.image is undefined. Please double-check image path, and check if the image you want to use is preload before use.'); + } + if (image === this._image) { + return; + } + this._image = image; + this._setFrame(this._frame); + } + }, + /** + [lang:ja] + * 表示するフレームのインデックス. + * Spriteと同じ横幅と高さを持ったフレームが{@link enchant.Sprite#image}プロパティの画像に左上から順に + * 配列されていると見て, 0から始まるインデックスを指定することでフレームを切り替える. + * + * 数値の配列が指定された場合、それらを毎フレーム順に切り替える。 + * ループするが、null値が含まれているとそこでループをストップする。 + [/lang] + [lang:en] + * Indizes of the frames to be displayed. + * Frames with same width and height as Sprite will be arrayed from upper left corner of the + * {@link enchant.Sprite#image} image. When a sequence of numbers is provided, the displayed frame + * will switch automatically. At the end of the array the sequence will restart. By setting + * a value within the sequence to null, the frame switching is stopped. + [/lang] + [lang:de] + * Die Indizes der darzustellenden Frames. + * Die Frames mit der selben Größe wie das Sprite werden aus der {@link enchant.Sprite#image} image Variable, + * beginnend an der oberen linken Ecke, angeordnet. Wenn eine Nummbersequenz übergeben wird, wird + * der dargestellte Frame automatisch gewechselt. Am ende des Arrays der Sequenz wird diese neugestartet. + * Wenn ein Wert in der Sequenz auf null gesetzt wird, wird das automatische Framewechseln gestoppt. + [/lang] + * @example + * var sprite = new Sprite(32, 32); + * sprite.frame = [0, 1, 0, 2] + * //-> 0, 1, 0, 2, 0, 1, 0, 2,.. + * sprite.frame = [0, 1, 0, 2, null] + * //-> 0, 1, 0, 2, (2, 2,.. :stop) + * + * @type {Number|Array} + */ + frame: { + get: function() { + return this._frame; + }, + set: function(frame) { + if(this._frame === frame) { + return; + } + if (frame instanceof Array) { + var frameSequence = frame; + var nextFrame = frameSequence.shift(); + this._setFrame(nextFrame); + frameSequence.push(nextFrame); + this._frameSequence = frameSequence; + } else { + this._setFrame(frame); + this._frameSequence = []; + this._frame = frame; + } + } + }, + /** + * 0 <= frame + [lang:ja] + * 0以下の動作は未定義. + [/lang] + * @param frame + * @private + */ + _setFrame: function(frame) { + var image = this._image; + var row, col; + if (image != null) { + this._frame = frame; + row = image.width / this._width | 0; + this._frameLeft = (frame % row | 0) * this._width; + this._frameTop = (frame / row | 0) * this._height % image.height; + } + }, + /** + * width of Sprite + * @type {Number} + */ + width: { + get: function() { + return this._width; + }, + set: function(width) { + this._width = width; + this._setFrame(this._frame); + this._dirty = true; + } + }, + /** + * height of Sprite + * @type {Number} + */ + height: { + get: function() { + return this._height; + }, + set: function(height) { + this._height = height; + this._setFrame(this._frame); + this._dirty = true; + } + }, + cvsRender: function(ctx) { + var image = this._image, + w = this._width, h = this._height, + iw, ih, elem, sx, sy, sw, sh; + if (image && w !== 0 && h !== 0) { + iw = image.width, ih = image.height; + if (iw < w || ih < h) { + ctx.fillStyle = enchant.Surface._getPattern(image); + ctx.fillRect(0, 0, w, h); + } else { + elem = image._element; + sx = this._frameLeft; + sy = Math.min(this._frameTop, ih - h); + sw = Math.min(iw - sx, w); + sh = Math.min(ih - sy, h); + ctx.drawImage(elem, sx, sy, sw, sh, 0, 0, w, h); + } + } + }, + domRender: (function() { + if (enchant.ENV.VENDOR_PREFIX === 'ms') { + return function(element) { + if (this._image) { + if (this._image._css) { + this._style['background-image'] = this._image._css; + this._style['background-position'] = + -this._frameLeft + 'px ' + + -this._frameTop + 'px'; + } else if (this._image._element) { + } + } + }; + } else { + return function(element) { + if (this._image) { + if (this._image._css) { + this._style['background-image'] = this._image._css; + this._style['background-position'] = + -this._frameLeft + 'px ' + + -this._frameTop + 'px'; + } else if (this._image._element) { + } + } + }; + } + }()) +}); + +/** + * @scope enchant.Label.prototype + */ +enchant.Label = enchant.Class.create(enchant.Entity, { + /** + * @name enchant.Label + * @class + [lang:ja] + * Label クラス。 + [/lang] + [lang:en] + * A class for Label object. + [/lang] + [lang:de] + * Erstellt ein Label Objekt. + [/lang] + * @constructs + * @extends enchant.Entity + */ + initialize: function(text) { + enchant.Entity.call(this); + + this.text = text || ''; + this.width = 300; + this.font = '14px serif'; + this.textAlign = 'left'; + + this._debugColor = '#ff0000'; + }, + width: { + get: function() { + return this._width; + }, + set: function(width) { + this._width = width; + this._dirty = true; + // issue #164 + this.updateBoundArea(); + } + }, + /** + [lang:ja] + * 表示するテキスト. + * DOM レンダラを利用している場合 (DOMScene 以下にある場合) 改行タグ (br) も利用できるが、 + * ユーザから入力したり、サーバから取得した文字列を表示する場合, XSS 脆弱性などに注意してください. + * Canvas レンダラを利用できる場合でも、改行タグ (br, BR) は改行に変換されます。 + [/lang] + [lang:en] + * Text to be displayed. + [/lang] + [lang:de] + * Darzustellender Text. + [/lang] + * @type {String} + */ + text: { + get: function() { + return this._text; + }, + set: function(text) { + text = '' + text; + if(this._text === text) { + return; + } + this._text = text; + text = text.replace(/<(br|BR) ?\/?>/g, '
'); + this._splitText = text.split('
'); + this.updateBoundArea(); + for (var i = 0, l = this._splitText.length; i < l; i++) { + text = this._splitText[i]; + var metrics = this.getMetrics(text); + this._splitText[i] = {}; + this._splitText[i].text = text; + this._splitText[i].height = metrics.height; + } + } + }, + /** + [lang:ja] + * テキストの水平位置の指定. + * CSSの'text-align'プロパティと同様の形式で指定できる. + [/lang] + [lang:en] + * Specifies horizontal alignment of text. + * Can be set according to the format of the CSS 'text-align' property. + [/lang] + [lang:de] + * Spezifiziert die horizontale Ausrichtung des Textes. + * Kann im gleichen Format wie die CSS 'text-align' Eigenschaft angegeben werden. + [/lang] + * @type {String} + */ + textAlign: { + get: function() { + return this._style['text-align']; + }, + set: function(textAlign) { + this._style['text-align'] = textAlign; + this.updateBoundArea(); + } + }, + /** + [lang:ja] + * フォントの指定. + * CSSの'font'プロパティと同様の形式で指定できる. + [/lang] + [lang:en] + * Font settings. + * Can be set according to the format of the CSS 'font' property. + [/lang] + [lang:de] + * Text Eigenschaften. + * Kann im gleichen Format wie die CSS 'font' Eigenschaft angegeben werden. + [/lang] + * @type {String} + */ + font: { + get: function() { + return this._style.font; + }, + set: function(font) { + this._style.font = font; + this.updateBoundArea(); + } + }, + /** + [lang:ja] + * 文字色の指定. + * CSSの'color'プロパティと同様の形式で指定できる. + [/lang] + [lang:en] + * Text color settings. + * Can be set according to the format of the CSS 'color' property. + [/lang] + [lang:de] + * Text Farbe. + * Kann im gleichen Format wie die CSS 'color' Eigenschaft angegeben werden. + [/lang] + * @type {String} + */ + color: { + get: function() { + return this._style.color; + }, + set: function(color) { + this._style.color = color; + } + }, + cvsRender: function(ctx) { + var x, y = 0; + var labelWidth = this.width; + var charWidth, amount, line, text, c, buf, increase, length; + var bufWidth; + if (this._splitText) { + ctx.textBaseline = 'top'; + ctx.font = this.font; + ctx.fillStyle = this.color || '#000000'; + charWidth = ctx.measureText(' ').width; + amount = labelWidth / charWidth; + for (var i = 0, l = this._splitText.length; i < l; i++) { + line = this._splitText[i]; + text = line.text; + c = 0; + while (text.length > c + amount || ctx.measureText(text.slice(c, c + amount)).width > labelWidth) { + buf = ''; + increase = amount; + length = 0; + while (increase > 0) { + if (ctx.measureText(buf).width < labelWidth) { + length += increase; + buf = text.slice(c, c + length); + } else { + length -= increase; + buf = text.slice(c, c + length); + } + increase = increase / 2 | 0; + } + ctx.fillText(buf, 0, y); + y += line.height - 1; + c += length; + } + buf = text.slice(c, c + text.length); + if (this.textAlign === 'right') { + x = labelWidth - ctx.measureText(buf).width; + } else if (this.textAlign === 'center') { + x = (labelWidth - ctx.measureText(buf).width) / 2; + } else { + x = 0; + } + ctx.fillText(buf, x, y); + y += line.height - 1; + } + } + }, + domRender: function(element) { + if (element.innerHTML !== this._text) { + element.innerHTML = this._text; + } + }, + detectRender: function(ctx) { + ctx.fillRect(this._boundOffset, 0, this._boundWidth, this._boundHeight); + }, + updateBoundArea: function() { + var metrics = this.getMetrics(); + this._boundWidth = metrics.width; + this._boundHeight = metrics.height; + if (this.textAlign === 'right') { + this._boundOffset = this.width - this._boundWidth; + } else if (this.textAlign === 'center') { + this._boundOffset = (this.width - this._boundWidth) / 2; + } else { + this._boundOffset = 0; + } + }, + getMetrics: function(text) { + var ret = {}; + var div, width, height; + if (document.body) { + div = document.createElement('div'); + for (var prop in this._style) { + if(prop !== 'width' && prop !== 'height') { + div.style[prop] = this._style[prop]; + } + } + text = text || this._text; + div.innerHTML = text.replace(/ /g, ' '); + div.style.whiteSpace = 'noWrap'; + div.style.lineHeight = 1; + document.body.appendChild(div); + ret.height = parseInt(getComputedStyle(div).height, 10) + 1; + div.style.position = 'absolute'; + ret.width = parseInt(getComputedStyle(div).width, 10) + 1; + document.body.removeChild(div); + } else { + ret.width = this.width; + ret.height = this.height; + } + return ret; + } +}); + +/** + * @scope enchant.Map.prototype + */ +enchant.Map = enchant.Class.create(enchant.Entity, { + /** + * @name enchant.Map + * @class + [lang:ja] + * タイルセットからマップを生成して表示するクラス. + * + * @param {Number} tileWidth タイルの横幅. + * @param {Number} tileHeight タイルの高さ. + [/lang] + [lang:en] + * A class to create and display maps from a tile set. + * + * @param {Number} tileWidth Tile width. + * @param {Number} tileHeight Tile height. + [/lang] + [lang:de] + * Eine Klasse mit der Karten aus Kacheln (Tiles) + * erstellt und angezeigt werden können. + * + * @param {Number} tileWidth Kachelbreite. + * @param {Number} tileHeight Kachelhöhe. + [/lang] + * @constructs + * @extends enchant.Entity + */ + initialize: function(tileWidth, tileHeight) { + var core = enchant.Core.instance; + + enchant.Entity.call(this); + + var surface = new enchant.Surface(core.width, core.height); + this._surface = surface; + var canvas = surface._element; + canvas.style.position = 'absolute'; + if (enchant.ENV.RETINA_DISPLAY && core.scale === 2) { + canvas.width = core.width * 2; + canvas.height = core.height * 2; + this._style.webkitTransformOrigin = '0 0'; + this._style.webkitTransform = 'scale(0.5)'; + } else { + canvas.width = core.width; + canvas.height = core.height; + } + this._context = canvas.getContext('2d'); + + this._tileWidth = tileWidth || 0; + this._tileHeight = tileHeight || 0; + this._image = null; + this._data = [ + [ + [] + ] + ]; + this._dirty = false; + this._tight = false; + + this.touchEnabled = false; + + /** + [lang:ja] + * タイルが衝突判定を持つかを表す値の二元配列. + [/lang] + [lang:en] + * Two dimensional array to store if collision detection should be performed for a tile. + [/lang] + [lang:de] + * Ein 2-Dimensionales Array um zu speichern, ob für eine Kachel + * Kollesionsdetektion durchgeführt werden soll. + [/lang] + * @type {Array.>} + */ + this.collisionData = null; + + this._listeners['render'] = null; + this.addEventListener('render', function() { + if (this._dirty || this._previousOffsetX == null) { + this.redraw(0, 0, core.width, core.height); + } else if (this._offsetX !== this._previousOffsetX || + this._offsetY !== this._previousOffsetY) { + if (this._tight) { + var x = -this._offsetX; + var y = -this._offsetY; + var px = -this._previousOffsetX; + var py = -this._previousOffsetY; + var w1 = x - px + core.width; + var w2 = px - x + core.width; + var h1 = y - py + core.height; + var h2 = py - y + core.height; + if (w1 > this._tileWidth && w2 > this._tileWidth && + h1 > this._tileHeight && h2 > this._tileHeight) { + var sx, sy, dx, dy, sw, sh; + if (w1 < w2) { + sx = 0; + dx = px - x; + sw = w1; + } else { + sx = x - px; + dx = 0; + sw = w2; + } + if (h1 < h2) { + sy = 0; + dy = py - y; + sh = h1; + } else { + sy = y - py; + dy = 0; + sh = h2; + } + + if (core._buffer == null) { + core._buffer = document.createElement('canvas'); + core._buffer.width = this._context.canvas.width; + core._buffer.height = this._context.canvas.height; + } + var context = core._buffer.getContext('2d'); + if (this._doubledImage) { + context.clearRect(0, 0, sw * 2, sh * 2); + context.drawImage(this._context.canvas, + sx * 2, sy * 2, sw * 2, sh * 2, 0, 0, sw * 2, sh * 2); + context = this._context; + context.clearRect(dx * 2, dy * 2, sw * 2, sh * 2); + context.drawImage(core._buffer, + 0, 0, sw * 2, sh * 2, dx * 2, dy * 2, sw * 2, sh * 2); + } else { + context.clearRect(0, 0, sw, sh); + context.drawImage(this._context.canvas, + sx, sy, sw, sh, 0, 0, sw, sh); + context = this._context; + context.clearRect(dx, dy, sw, sh); + context.drawImage(core._buffer, + 0, 0, sw, sh, dx, dy, sw, sh); + } + + if (dx === 0) { + this.redraw(sw, 0, core.width - sw, core.height); + } else { + this.redraw(0, 0, core.width - sw, core.height); + } + if (dy === 0) { + this.redraw(0, sh, core.width, core.height - sh); + } else { + this.redraw(0, 0, core.width, core.height - sh); + } + } else { + this.redraw(0, 0, core.width, core.height); + } + } else { + this.redraw(0, 0, core.width, core.height); + } + } + this._previousOffsetX = this._offsetX; + this._previousOffsetY = this._offsetY; + }); + }, + /** + [lang:ja] + * データを設定する. + * タイルががimageプロパティの画像に左上から順に配列されていると見て, 0から始まる + * インデックスの二元配列を設定する.複数指定された場合は後のものから順に表示される. + * @param {...Array>} data タイルのインデックスの二元配列. 複数指定できる. + [/lang] + [lang:en] + * Set map data. + * Sets the tile data, whereas the data (two-dimensional array with indizes starting from 0) + * is mapped on the image starting from the upper left corner. + * When more than one map data array is set, they are displayed in reverse order. + * @param {...Array>} data Two-dimensional array of tile indizes. Multiple designations possible. + [/lang] + [lang:de] + * Setzt die Kartendaten. + * Setzt die Kartendaten, wobei die Daten (ein 2-Dimensionales Array bei dem die Indizes bei 0 beginnen) + * auf das Bild, beginned bei der linken oberen Ecke) projeziert werden. + * Sollte mehr als ein Array übergeben worden sein, werden die Karten in invertierter Reihenfolge dargestellt. + * @param {...Array>} data 2-Dimensionales Array mit Kachel Indizes. Mehrfachangaben möglich. + [/lang] + */ + loadData: function(data) { + this._data = Array.prototype.slice.apply(arguments); + this._dirty = true; + + this._tight = false; + for (var i = 0, len = this._data.length; i < len; i++) { + var c = 0; + data = this._data[i]; + for (var y = 0, l = data.length; y < l; y++) { + for (var x = 0, ll = data[y].length; x < ll; x++) { + if (data[y][x] >= 0) { + c++; + } + } + } + if (c / (data.length * data[0].length) > 0.2) { + this._tight = true; + break; + } + } + }, + /** + [lang:ja] + * ある座標のタイルが何か調べる. + * @param {Number} x マップ上の点のx座標. + * @param {Number} y マップ上の点のy座標. + * @return {*} ある座標のタイルのデータ. + [/lang] + [lang:en] + * Checks what tile is present at the given position. + * @param {Number} x x coordinates of the point on the map. + * @param {Number} y y coordinates of the point on the map. + * @return {*} The tile data for the given position. + [/lang] + [lang:de] + * Überprüft welche Kachel an der gegeben Position vorhanden ist. + * @param {Number} x Die x Koordinataten des Punktes auf der Karte. + * @param {Number} y Die y Koordinataten des Punktes auf der Karte. + * @return {*} Die Kachel für die angegebene Position. + [/lang] + */ + checkTile: function(x, y) { + if (x < 0 || this.width <= x || y < 0 || this.height <= y) { + return false; + } + var width = this._image.width; + var height = this._image.height; + var tileWidth = this._tileWidth || width; + var tileHeight = this._tileHeight || height; + x = x / tileWidth | 0; + y = y / tileHeight | 0; + // return this._data[y][x]; + var data = this._data[0]; + return data[y][x]; + }, + /** + [lang:ja] + * Map上に障害物があるかどうかを判定する. + * @param {Number} x 判定を行うマップ上の点のx座標. + * @param {Number} y 判定を行うマップ上の点のy座標. + * @return {Boolean} 障害物があるかどうか. + [/lang] + [lang:en] + * Judges whether or not obstacles are on top of Map. + * @param {Number} x x coordinates of detection spot on map. + * @param {Number} y y coordinates of detection spot on map. + * @return {Boolean} True, if there are obstacles. + [/lang] + [lang:de] + * Überprüft ob auf der Karte Hindernisse vorhanden sind. + * @param {Number} x Die x Koordinataten des Punktes auf der Karte, der überprüft werden soll. + * @param {Number} y Die y Koordinataten des Punktes auf der Karte, der überprüft werden soll. + * @return {Boolean} True, falls Hindernisse vorhanden sind. + [/lang] + */ + hitTest: function(x, y) { + if (x < 0 || this.width <= x || y < 0 || this.height <= y) { + return false; + } + var width = this._image.width; + var height = this._image.height; + var tileWidth = this._tileWidth || width; + var tileHeight = this._tileHeight || height; + x = x / tileWidth | 0; + y = y / tileHeight | 0; + if (this.collisionData != null) { + return this.collisionData[y] && !!this.collisionData[y][x]; + } else { + for (var i = 0, len = this._data.length; i < len; i++) { + var data = this._data[i]; + var n; + if (data[y] != null && (n = data[y][x]) != null && + 0 <= n && n < (width / tileWidth | 0) * (height / tileHeight | 0)) { + return true; + } + } + return false; + } + }, + /** + [lang:ja] + * Mapで表示するタイルセット画像. + [/lang] + [lang:en] + * Image with which the tile set is displayed on the map. + [/lang] + [lang:de] + * Das Bild mit dem die Kacheln auf der Karte dargestellt werden. + [/lang] + * @type {enchant.Surface} + */ + image: { + get: function() { + return this._image; + }, + set: function(image) { + var core = enchant.Core.instance; + + this._image = image; + if (enchant.ENV.RETINA_DISPLAY && core.scale === 2) { + var img = new enchant.Surface(image.width * 2, image.height * 2); + var tileWidth = this._tileWidth || image.width; + var tileHeight = this._tileHeight || image.height; + var row = image.width / tileWidth | 0; + var col = image.height / tileHeight | 0; + for (var y = 0; y < col; y++) { + for (var x = 0; x < row; x++) { + img.draw(image, x * tileWidth, y * tileHeight, tileWidth, tileHeight, + x * tileWidth * 2, y * tileHeight * 2, tileWidth * 2, tileHeight * 2); + } + } + this._doubledImage = img; + } + this._dirty = true; + } + }, + /** + [lang:ja] + * Mapのタイルの横幅. + [/lang] + [lang:en] + * Map tile width. + [/lang] + [lang:de] + * Kachelbreite + [/lang] + * @type {Number} + */ + tileWidth: { + get: function() { + return this._tileWidth; + }, + set: function(tileWidth) { + this._tileWidth = tileWidth; + this._dirty = true; + } + }, + /** + [lang:ja] + * Mapのタイルの高さ. + [/lang] + [lang:en] + * Map tile height. + [/lang] + [lang:de] + * Kachelhöhe. + [/lang] + * @type {Number} + */ + tileHeight: { + get: function() { + return this._tileHeight; + }, + set: function(tileHeight) { + this._tileHeight = tileHeight; + this._dirty = true; + } + }, + /** + * @private + */ + width: { + get: function() { + return this._tileWidth * this._data[0][0].length; + } + }, + /** + * @private + */ + height: { + get: function() { + return this._tileHeight * this._data[0].length; + } + }, + /** + * @private + */ + redraw: function(x, y, width, height) { + if (this._image == null) { + return; + } + + var image, tileWidth, tileHeight, dx, dy; + if (this._doubledImage) { + image = this._doubledImage; + tileWidth = this._tileWidth * 2; + tileHeight = this._tileHeight * 2; + dx = -this._offsetX * 2; + dy = -this._offsetY * 2; + x *= 2; + y *= 2; + width *= 2; + height *= 2; + } else { + image = this._image; + tileWidth = this._tileWidth; + tileHeight = this._tileHeight; + dx = -this._offsetX; + dy = -this._offsetY; + } + var row = image.width / tileWidth | 0; + var col = image.height / tileHeight | 0; + var left = Math.max((x + dx) / tileWidth | 0, 0); + var top = Math.max((y + dy) / tileHeight | 0, 0); + var right = Math.ceil((x + dx + width) / tileWidth); + var bottom = Math.ceil((y + dy + height) / tileHeight); + + var source = image._element; + var context = this._context; + var canvas = context.canvas; + context.clearRect(x, y, width, height); + for (var i = 0, len = this._data.length; i < len; i++) { + var data = this._data[i]; + var r = Math.min(right, data[0].length); + var b = Math.min(bottom, data.length); + for (y = top; y < b; y++) { + for (x = left; x < r; x++) { + var n = data[y][x]; + if (0 <= n && n < row * col) { + var sx = (n % row) * tileWidth; + var sy = (n / row | 0) * tileHeight; + context.drawImage(source, sx, sy, tileWidth, tileHeight, + x * tileWidth - dx, y * tileHeight - dy, tileWidth, tileHeight); + } + } + } + } + }, + cvsRender: function(ctx) { + var core = enchant.Core.instance; + if (this.width !== 0 && this.height !== 0) { + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + var cvs = this._context.canvas; + ctx.drawImage(cvs, 0, 0, core.width, core.height); + ctx.restore(); + } + }, + domRender: function(element) { + if (this._image) { + this._style['background-image'] = this._surface._css; + // bad performance + this._style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'matrix(1, 0, 0, 1, 0, 0)'; + } + } +}); + + +/** + * @scope enchant.Group.prototype + */ +enchant.Group = enchant.Class.create(enchant.Node, { + /** + * @name enchant.Group + * @class + [lang:ja] + * 複数の{@link enchant.Node}を子に持つことができるクラス. + * + * @example + * var stage = new Group(); + * stage.addChild(player); + * stage.addChild(enemy); + * stage.addChild(map); + * stage.addEventListener('enterframe', function() { + * // playerの座標に従って全体をスクロールする + * if (this.x > 64 - player.x) { + * this.x = 64 - player.x; + * } + * }); + * + * @extends enchant.Node + [/lang] + [lang:en] + * A class that can hold multiple {@link enchant.Node}. + * + * @example + * var stage = new Group(); + * stage.addChild(player); + * stage.addChild(enemy); + * stage.addChild(map); + * stage.addEventListener('enterframe', function() { + * // Moves the entire frame in according to the player's coordinates. + * if (this.x > 64 - player.x) { + * this.x = 64 - player.x; + * } + * }); + * + [/lang] + [lang:de] + * Eine Klasse die mehrere {@link enchant.Node} beinhalten kann. + * + * @example + * var stage = new Group(); + * stage.addChild(player); + * stage.addChild(enemy); + * stage.addChild(map); + * stage.addEventListener('enterframe', function() { + * // Bewegt den gesamten Frame je nach der aktuelle Spielerposition. + * if (this.x > 64 - player.x) { + * this.x = 64 - player.x; + * } + * }); + * + [/lang] + * @constructs + * @extends enchant.Node + */ + initialize: function() { + /** + [lang:ja] + * 子のNode. + [/lang] + [lang:en] + * Child Nodes. + [/lang] + [lang:de] + * Kind-Nodes. + [/lang] + * @type {Array.} + */ + this.childNodes = []; + + enchant.Node.call(this); + + this._rotation = 0; + this._scaleX = 1; + this._scaleY = 1; + + this._originX = null; + this._originY = null; + + this.__dirty = false; + + [enchant.Event.ADDED_TO_SCENE, enchant.Event.REMOVED_FROM_SCENE] + .forEach(function(event) { + this.addEventListener(event, function(e) { + this.childNodes.forEach(function(child) { + child.scene = this.scene; + child.dispatchEvent(e); + }, this); + }); + }, this); + }, + /** + [lang:ja] + * GroupにNodeを追加する. + * @param {enchant.Node} node 追加するNode. + [/lang] + [lang:en] + * Adds a Node to the Group. + * @param {enchant.Node} node Node to be added. + [/lang] + [lang:de] + * Fügt einen Node zu der Gruppe hinzu. + * @param {enchant.Node} node Node der hinzugeügt werden soll. + [/lang] + */ + addChild: function(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + this.childNodes.push(node); + node.parentNode = this; + var childAdded = new enchant.Event('childadded'); + childAdded.node = node; + childAdded.next = null; + this.dispatchEvent(childAdded); + node.dispatchEvent(new enchant.Event('added')); + if (this.scene) { + node.scene = this.scene; + var addedToScene = new enchant.Event('addedtoscene'); + node.dispatchEvent(addedToScene); + } + }, + /** + [lang:ja] + * GroupにNodeを挿入する. + * @param {enchant.Node} node 挿入するNode. + * @param {enchant.Node} reference 挿入位置の前にあるNode. + [/lang] + [lang:en] + * Incorporates Node into Group. + * @param {enchant.Node} node Node to be incorporated. + * @param {enchant.Node} reference Node in position before insertion. + [/lang] + [lang:de] + * Fügt einen Node vor einen anderen Node zu dieser Gruppe hinzu. + * @param {enchant.Node} node Der Node der hinzugefügt werden soll. + * @param {enchant.Node} reference Der Node der sich vor dem einzufügendem Node befindet. + [/lang] + */ + insertBefore: function(node, reference) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + var i = this.childNodes.indexOf(reference); + if (i !== -1) { + this.childNodes.splice(i, 0, node); + node.parentNode = this; + var childAdded = new enchant.Event('childadded'); + childAdded.node = node; + childAdded.next = reference; + this.dispatchEvent(childAdded); + node.dispatchEvent(new enchant.Event('added')); + if (this.scene) { + node.scene = this.scene; + var addedToScene = new enchant.Event('addedtoscene'); + node.dispatchEvent(addedToScene); + } + } else { + this.addChild(node); + } + }, + /** + [lang:ja] + * GroupからNodeを削除する. + * @param {enchant.Node} node 削除するNode. + [/lang] + [lang:en] + * Remove a Node from the Group. + * @param {enchant.Node} node Node to be deleted. + [/lang] + [lang:de] + * Entfernt einen Node aus der Gruppe. + * @param {enchant.Node} node Der Node der entfernt werden soll. + [/lang] + */ + removeChild: function(node) { + var i; + if ((i = this.childNodes.indexOf(node)) !== -1) { + this.childNodes.splice(i, 1); + node.parentNode = null; + var childRemoved = new enchant.Event('childremoved'); + childRemoved.node = node; + this.dispatchEvent(childRemoved); + node.dispatchEvent(new enchant.Event('removed')); + if (this.scene) { + node.scene = null; + var removedFromScene = new enchant.Event('removedfromscene'); + node.dispatchEvent(removedFromScene); + } + } + }, + /** + [lang:ja] + * 最初の子Node. + [/lang] + [lang:en] + * The Node which is the first child. + [/lang] + [lang:de] + * Der Node, welcher das erste Kind der Gruppe darstellt. + [/lang] + * @type {enchant.Node} + */ + firstChild: { + get: function() { + return this.childNodes[0]; + } + }, + /** + [lang:ja] + * 最後の子Node. + [/lang] + [lang:en] + * The Node which is the last child. + [/lang] + [lang:de] + * Der Node, welcher das letzte Kind der Gruppe darstellt. + [/lang] + * @type {enchant.Node} + */ + lastChild: { + get: function() { + return this.childNodes[this.childNodes.length - 1]; + } + }, + /** + [lang:ja] + * Groupの回転角 (度数法). + [/lang] + [lang:en] + * Group rotation angle (degree). + [/lang] + [lang:de] + * Rotationswinkel der Gruppe (Grad). + [/lang] + * @type {Number} + */ + rotation: { + get: function() { + return this._rotation; + }, + set: function(rotation) { + this._rotation = rotation; + this._dirty = true; + } + }, + /** + [lang:ja] + * Groupのx軸方向の倍率. + [/lang] + [lang:en] + * Scaling factor on the x axis of the Group. + [/lang] + [lang:de] + * Skalierungsfaktor auf der x-Achse der Gruppe. + [/lang] + * @type {Number} + * @see enchant.CanvasGroup.originX + * @see enchant.CanvasGroup.originY + */ + scaleX: { + get: function() { + return this._scaleX; + }, + set: function(scale) { + this._scaleX = scale; + this._dirty = true; + } + }, + /** + [lang:ja] + * Groupのy軸方向の倍率. + [/lang] + [lang:en] + * Scaling factor on the y axis of the Group. + [/lang] + [lang:de] + * Skalierungsfaktor auf der y-Achse der Gruppe. + [/lang] + * @type {Number} + * @see enchant.CanvasGroup.originX + * @see enchant.CanvasGroup.originY + */ + scaleY: { + get: function() { + return this._scaleY; + }, + set: function(scale) { + this._scaleY = scale; + this._dirty = true; + } + }, + /** + [lang:ja] + * 回転・拡大縮小の基準点のX座標 + [/lang] + [lang:en] + * origin point of rotation, scaling + [/lang] + [lang:de] + * Ausgangspunkt für Rotation und Skalierung. + [/lang] + * @type {Number} + */ + originX: { + get: function() { + return this._originX; + }, + set: function(originX) { + this._originX = originX; + this._dirty = true; + } + }, + /** + [lang:ja] + * 回転・拡大縮小の基準点のX座標 + [/lang] + [lang:en] + * origin point of rotation, scaling + [/lang] + [lang:de] + * Ausgangspunkt für Rotation und Skalierung. + [/lang] + * @type {Number} + */ + originY: { + get: function() { + return this._originY; + }, + set: function(originY) { + this._originY = originY; + this._dirty = true; + } + }, + _dirty: { + get: function() { + return this.__dirty; + }, + set: function(dirty) { + dirty = !!dirty; + this.__dirty = dirty; + if (dirty) { + for (var i = 0, l = this.childNodes.length; i < l; i++) { + this.childNodes[i]._dirty = true; + } + } + } + } +}); + +enchant.Matrix = enchant.Class.create({ + initialize: function() { + this.reset(); + }, + reset: function() { + this.stack = []; + this.stack.push([ 1, 0, 0, 1, 0, 0 ]); + }, + makeTransformMatrix: function(node, dest) { + var x = node._x; + var y = node._y; + var width = node.width || 0; + var height = node.height || 0; + var rotation = node._rotation || 0; + var scaleX = (typeof node._scaleX === 'number') ? node._scaleX : 1; + var scaleY = (typeof node._scaleY === 'number') ? node._scaleY : 1; + var theta = rotation * Math.PI / 180; + var tmpcos = Math.cos(theta); + var tmpsin = Math.sin(theta); + var w = (typeof node._originX === 'number') ? node._originX : width / 2; + var h = (typeof node._originY === 'number') ? node._originY : height / 2; + var a = scaleX * tmpcos; + var b = scaleX * tmpsin; + var c = scaleY * tmpsin; + var d = scaleY * tmpcos; + dest[0] = a; + dest[1] = b; + dest[2] = -c; + dest[3] = d; + dest[4] = (-a * w + c * h + x + w); + dest[5] = (-b * w - d * h + y + h); + }, + multiply: function(m1, m2, dest) { + var a11 = m1[0], a21 = m1[2], adx = m1[4], + a12 = m1[1], a22 = m1[3], ady = m1[5]; + var b11 = m2[0], b21 = m2[2], bdx = m2[4], + b12 = m2[1], b22 = m2[3], bdy = m2[5]; + + dest[0] = a11 * b11 + a21 * b12; + dest[1] = a12 * b11 + a22 * b12; + dest[2] = a11 * b21 + a21 * b22; + dest[3] = a12 * b21 + a22 * b22; + dest[4] = a11 * bdx + a21 * bdy + adx; + dest[5] = a12 * bdx + a22 * bdy + ady; + }, + multiplyVec: function(mat, vec, dest) { + var x = vec[0], y = vec[1]; + var m11 = mat[0], m21 = mat[2], mdx = mat[4], + m12 = mat[1], m22 = mat[3], mdy = mat[5]; + dest[0] = m11 * x + m21 * y + mdx; + dest[1] = m12 * x + m22 * y + mdy; + } +}); +enchant.Matrix.instance = new enchant.Matrix(); + +enchant.DetectColorManager = enchant.Class.create({ + initialize: function(reso, max) { + this.reference = []; + this.colorResolution = reso || 16; + this.max = max || 1; + this.capacity = Math.pow(this.colorResolution, 3); + for (var i = 1, l = this.capacity; i < l; i++) { + this.reference[i] = null; + } + }, + attachDetectColor: function(sprite) { + var i = this.reference.indexOf(null); + if (i === -1) { + i = 1; + } + this.reference[i] = sprite; + return this._getColor(i); + }, + detachDetectColor: function(sprite) { + var i = this.reference.indexOf(sprite); + if (i !== -1) { + this.reference[i] = null; + } + }, + _getColor: function(n) { + var C = this.colorResolution; + var d = C / this.max; + return [ + parseInt((n / C / C) % C, 10) / d, + parseInt((n / C) % C, 10) / d, + parseInt(n % C, 10) / d, + 1.0 + ]; + }, + _decodeDetectColor: function(color) { + var C = this.colorResolution; + return ~~(color[0] * C * C * C / 256) + + ~~(color[1] * C * C / 256) + + ~~(color[2] * C / 256); + }, + getSpriteByColor: function(color) { + return this.reference[this._decodeDetectColor(color)]; + } +}); + +enchant.DomManager = enchant.Class.create({ + initialize: function(node, elementDefinition) { + var core = enchant.Core.instance; + this.layer = null; + this.targetNode = node; + if (typeof elementDefinition === 'string') { + this.element = document.createElement(elementDefinition); + } else if (elementDefinition instanceof HTMLElement) { + this.element = elementDefinition; + } + this.style = this.element.style; + this.style.position = 'absolute'; + this.style[enchant.ENV.VENDOR_PREFIX + 'TransformOrigin'] = '0px 0px'; + if (core._debug) { + this.style.border = '1px solid blue'; + this.style.margin = '-1px'; + } + + var manager = this; + this._setDomTarget = function() { + manager.layer._touchEventTarget = manager.targetNode; + }; + this._attachEvent(); + }, + getDomElement: function() { + return this.element; + }, + getDomElementAsNext: function() { + return this.element; + }, + getNextManager: function(manager) { + var i = this.targetNode.parentNode.childNodes.indexOf(manager.targetNode); + if (i !== this.targetNode.parentNode.childNodes.length - 1) { + return this.targetNode.parentNode.childNodes[i + 1]._domManager; + } else { + return null; + } + }, + addManager: function(childManager, nextManager) { + var nextElement; + if (nextManager) { + nextElement = nextManager.getDomElementAsNext(); + } + var element = childManager.getDomElement(); + if (element instanceof Array) { + element.forEach(function(child) { + if (nextElement) { + this.element.insertBefore(child, nextElement); + } else { + this.element.appendChild(child); + } + }, this); + } else { + if (nextElement) { + this.element.insertBefore(element, nextElement); + } else { + this.element.appendChild(element); + } + } + this.setLayer(this.layer); + }, + removeManager: function(childManager) { + if (childManager instanceof enchant.DomlessManager) { + childManager._domRef.forEach(function(element) { + this.element.removeChild(element); + }, this); + } else { + this.element.removeChild(childManager.element); + } + this.setLayer(this.layer); + }, + setLayer: function(layer) { + this.layer = layer; + var node = this.targetNode; + var manager; + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + manager = node.childNodes[i]._domManager; + if (manager) { + manager.setLayer(layer); + } + } + } + }, + render: function(inheritMat) { + var node = this.targetNode; + var matrix = enchant.Matrix.instance; + var stack = matrix.stack; + var dest = []; + matrix.makeTransformMatrix(node, dest); + matrix.multiply(stack[stack.length - 1], dest, dest); + matrix.multiply(inheritMat, dest, inheritMat); + node._matrix = inheritMat; + var ox = (typeof node._originX === 'number') ? node._originX : node.width / 2 || 0; + var oy = (typeof node._originY === 'number') ? node._originY : node.height / 2 || 0; + var vec = [ ox, oy ]; + matrix.multiplyVec(dest, vec, vec); + + node._offsetX = vec[0] - ox; + node._offsetY = vec[1] - oy; + if(node.parentNode && !(node.parentNode instanceof enchant.Group)) { + node._offsetX += node.parentNode._offsetX; + node._offsetY += node.parentNode._offsetY; + } + if (node._dirty) { + this.style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'matrix(' + + dest[0].toFixed(10) + ',' + + dest[1].toFixed(10) + ',' + + dest[2].toFixed(10) + ',' + + dest[3].toFixed(10) + ',' + + dest[4].toFixed(10) + ',' + + dest[5].toFixed(10) + + ')'; + } + this.domRender(); + }, + domRender: function() { + var node = this.targetNode; + if(!node._style) { + node._style = {}; + } + if(!node.__styleStatus) { + node.__styleStatus = {}; + } + if (node.width !== null) { + node._style.width = node.width + 'px'; + } + if (node.height !== null) { + node._style.height = node.height + 'px'; + } + node._style.opacity = node._opacity; + node._style['background-color'] = node._backgroundColor; + if (typeof node._visible !== 'undefined') { + node._style.display = node._visible ? 'block' : 'none'; + } + if (typeof node.domRender === 'function') { + node.domRender(this.element); + } + var value; + for (var prop in node._style) { + value = node._style[prop]; + if(node.__styleStatus[prop] !== value && value != null) { + this.style.setProperty(prop, '' + value); + node.__styleStatus[prop] = value; + } + } + }, + _attachEvent: function() { + if (enchant.ENV.TOUCH_ENABLED) { + this.element.addEventListener('touchstart', this._setDomTarget, true); + } + this.element.addEventListener('mousedown', this._setDomTarget, true); + }, + _detachEvent: function() { + if (enchant.ENV.TOUCH_ENABLED) { + this.element.removeEventListener('touchstart', this._setDomTarget, true); + } + this.element.removeEventListener('mousedown', this._setDomTarget, true); + }, + remove: function() { + this._detachEvent(); + this.element = this.style = this.targetNode = null; + } +}); + +enchant.DomlessManager = enchant.Class.create({ + initialize: function(node) { + this._domRef = []; + this.targetNode = node; + }, + _register: function(element, nextElement) { + var i = this._domRef.indexOf(nextElement); + var childNodes; + if (element instanceof Array) { + if (i === -1) { + Array.prototype.push.apply(this._domRef, element); + } else { + Array.prototype.splice.apply(this._domRef, [i, 0].concat(element)); + } + } else { + if (i === -1) { + this._domRef.push(element); + } else { + this._domRef.splice(i, 0, element); + } + } + }, + getNextManager: function(manager) { + var i = this.targetNode.parentNode.childNodes.indexOf(manager.targetNode); + if (i !== this.targetNode.parentNode.childNodes.length - 1) { + return this.targetNode.parentNode.childNodes[i + 1]._domManager; + } else { + return null; + } + }, + getDomElement: function() { + var ret = []; + this.targetNode.childNodes.forEach(function(child) { + ret = ret.concat(child._domManager.getDomElement()); + }); + return ret; + }, + getDomElementAsNext: function() { + if (this._domRef.length) { + return this._domRef[0]; + } else { + var nextManager = this.getNextManager(this); + if (nextManager) { + return nextManager.element; + } else { + return null; + } + } + }, + addManager: function(childManager, nextManager) { + var parentNode = this.targetNode.parentNode; + if (parentNode) { + if (nextManager === null) { + nextManager = this.getNextManager(this); + } + if (parentNode instanceof enchant.Scene) { + parentNode._layers.Dom._domManager.addManager(childManager, nextManager); + } else { + parentNode._domManager.addManager(childManager, nextManager); + } + } + var nextElement = nextManager ? nextManager.getDomElementAsNext() : null; + this._register(childManager.getDomElement(), nextElement); + this.setLayer(this.layer); + }, + removeManager: function(childManager) { + var dom; + var i = this._domRef.indexOf(childManager.element); + if (i !== -1) { + dom = this._domRef[i]; + dom.parentNode.removeChild(dom); + this._domRef.splice(i, 1); + } + this.setLayer(this.layer); + }, + setLayer: function(layer) { + this.layer = layer; + var node = this.targetNode; + var manager; + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + manager = node.childNodes[i]._domManager; + if (manager) { + manager.setLayer(layer); + } + } + } + }, + render: function(inheritMat) { + var matrix = enchant.Matrix.instance; + var stack = matrix.stack; + var node = this.targetNode; + var dest = []; + matrix.makeTransformMatrix(node, dest); + matrix.multiply(stack[stack.length - 1], dest, dest); + matrix.multiply(inheritMat, dest, inheritMat); + node._matrix = inheritMat; + var ox = (typeof node._originX === 'number') ? node._originX : node.width / 2 || 0; + var oy = (typeof node._originY === 'number') ? node._originY : node.height / 2 || 0; + var vec = [ ox, oy ]; + matrix.multiplyVec(dest, vec, vec); + node._offsetX = vec[0] - ox; + node._offsetY = vec[1] - oy; + stack.push(dest); + }, + remove: function() { + this._domRef = []; + this.targetNode = null; + } +}); + +enchant.DomLayer = enchant.Class.create(enchant.Group, { + initialize: function() { + var core = enchant.Core.instance; + enchant.Group.call(this); + + this._touchEventTarget = null; + + this._element = document.createElement('div'); + this._element.style.position = 'absolute'; + + this._domManager = new enchant.DomManager(this, this._element); + this._domManager.layer = this; + + this.width = core.width; + this.height = core.height; + + var touch = [ + enchant.Event.TOUCH_START, + enchant.Event.TOUCH_MOVE, + enchant.Event.TOUCH_END + ]; + + touch.forEach(function(type) { + this.addEventListener(type, function(e) { + if (this._scene) { + this._scene.dispatchEvent(e); + } + }); + }, this); + + var __onchildadded = function(e) { + var child = e.node; + var next = e.next; + var self = e.target; + var nextManager = next ? next._domManager : null; + enchant.DomLayer._attachDomManager(child, __onchildadded, __onchildremoved); + self._domManager.addManager(child._domManager, nextManager); + var render = new enchant.Event(enchant.Event.RENDER); + child._dirty = true; + self._domManager.layer._rendering(child, render); + }; + + var __onchildremoved = function(e) { + var child = e.node; + var self = e.target; + self._domManager.removeManager(child._domManager); + enchant.DomLayer._detachDomManager(child, __onchildadded, __onchildremoved); + }; + + this.addEventListener('childremoved', __onchildremoved); + this.addEventListener('childadded', __onchildadded); + + }, + width: { + get: function() { + return this._width; + }, + set: function(width) { + this._width = width; + this._element.style.width = width + 'px'; + } + }, + height: { + get: function() { + return this._height; + }, + set: function(height) { + this._height = height; + this._element.style.height = height + 'px'; + } + }, + addChild: function(node) { + this.childNodes.push(node); + node.parentNode = this; + var childAdded = new enchant.Event('childadded'); + childAdded.node = node; + childAdded.next = null; + this.dispatchEvent(childAdded); + node.dispatchEvent(new enchant.Event('added')); + if (this.scene) { + node.scene = this.scene; + var addedToScene = new enchant.Event('addedtoscene'); + node.dispatchEvent(addedToScene); + } + }, + insertBefore: function(node, reference) { + var i = this.childNodes.indexOf(reference); + if (i !== -1) { + this.childNodes.splice(i, 0, node); + node.parentNode = this; + var childAdded = new enchant.Event('childadded'); + childAdded.node = node; + childAdded.next = reference; + this.dispatchEvent(childAdded); + node.dispatchEvent(new enchant.Event('added')); + if (this.scene) { + node.scene = this.scene; + var addedToScene = new enchant.Event('addedtoscene'); + node.dispatchEvent(addedToScene); + } + } else { + this.addChild(node); + } + }, + _startRendering: function() { + this.addEventListener('exitframe', this._onexitframe); + this._onexitframe(); + }, + _stopRendering: function() { + this.removeEventListener('exitframe', this._onexitframe); + this._onexitframe(); + }, + _onexitframe: function() { + this._rendering(this, new enchant.Event(enchant.Event.RENDER)); + }, + _rendering: function(node, e, inheritMat) { + var child; + if (!inheritMat) { + inheritMat = [ 1, 0, 0, 1, 0, 0 ]; + } + node.dispatchEvent(e); + node._domManager.render(inheritMat); + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + child = node.childNodes[i]; + this._rendering(child, e, inheritMat.slice()); + } + } + if (node._domManager instanceof enchant.DomlessManager) { + enchant.Matrix.instance.stack.pop(); + } + node._dirty = false; + }, + _determineEventTarget: function() { + var target = this._touchEventTarget; + this._touchEventTarget = null; + return (target === this) ? null : target; + } +}); + +enchant.DomLayer._attachDomManager = function(node, onchildadded, onchildremoved) { + var child; + if (!node._domManager) { + node.addEventListener('childadded', onchildadded); + node.addEventListener('childremoved', onchildremoved); + if (node instanceof enchant.Group) { + node._domManager = new enchant.DomlessManager(node); + } else { + if (node._element) { + node._domManager = new enchant.DomManager(node, node._element); + } else { + node._domManager = new enchant.DomManager(node, 'div'); + } + } + } + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + child = node.childNodes[i]; + enchant.DomLayer._attachDomManager(child, onchildadded, onchildremoved); + node._domManager.addManager(child._domManager, null); + } + } +}; + +enchant.DomLayer._detachDomManager = function(node, onchildadded, onchildremoved) { + var child; + node.removeEventListener('childadded', onchildadded); + node.removeEventListener('childremoved', onchildremoved); + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + child = node.childNodes[i]; + node._domManager.removeManager(child._domManager, null); + enchant.DomLayer._detachDomManager(child, onchildadded, onchildremoved); + } + } + node._domManager.remove(); + delete node._domManager; +}; + +/** + * @scope enchant.CanvasLayer.prototype + */ +enchant.CanvasLayer = enchant.Class.create(enchant.Group, { + /** + * @name enchant.CanvasLayer + * @class + [lang:ja] + * Canvas を用いた描画を行うクラス. + * 子を Canvas を用いた描画に切り替えるクラス + [/lang] + [lang:en] + * A class which is using HTML Canvas for the rendering. + * The rendering of children will be replaced by the Canvas rendering. + [/lang] + [lang:de] + * Eine Klasse die HTML Canvas für das Rendern nutzt. + * Das Rendern der Kinder wird durch das Canvas Rendering ersetzt. + [/lang] + * @constructs + */ + initialize: function() { + var core = enchant.Core.instance; + + enchant.Group.call(this); + + this._cvsCache = { + matrix: [1, 0, 0, 1, 0, 0], + detectColor: '#000000' + }; + this._cvsCache.layer = this; + + this._element = document.createElement('canvas'); + this._element.style.position = 'absolute'; + // issue 179 + this._element.style.left = this._element.style.top = '0px'; + + this._detect = document.createElement('canvas'); + this._detect.style.position = 'absolute'; + this._lastDetected = 0; + + this.context = this._element.getContext('2d'); + this._dctx = this._detect.getContext('2d'); + + this._colorManager = new enchant.DetectColorManager(16, 256); + + this.width = core.width; + this.height = core.height; + + var touch = [ + enchant.Event.TOUCH_START, + enchant.Event.TOUCH_MOVE, + enchant.Event.TOUCH_END + ]; + + touch.forEach(function(type) { + this.addEventListener(type, function(e) { + if (this._scene) { + this._scene.dispatchEvent(e); + } + }); + }, this); + + var __onchildadded = function(e) { + var child = e.node; + var self = e.target; + var layer; + if (self instanceof enchant.CanvasLayer) { + layer = self._scene._layers.Canvas; + } else { + layer = self.scene._layers.Canvas; + } + enchant.CanvasLayer._attachCache(child, layer, __onchildadded, __onchildremoved); + var render = new enchant.Event(enchant.Event.RENDER); + if (self._dirty) { + self._updateCoordinate(); + } + child._dirty = true; + enchant.Matrix.instance.stack.push(self._matrix); + enchant.CanvasRenderer.instance.render(layer.context, child, render); + enchant.Matrix.instance.stack.pop(self._matrix); + }; + + var __onchildremoved = function(e) { + var child = e.node; + var self = e.target; + var layer; + if (self instanceof enchant.CanvasLayer) { + layer = self._scene._layers.Canvas; + } else { + layer = self.scene._layers.Canvas; + } + enchant.CanvasLayer._detachCache(child, layer, __onchildadded, __onchildremoved); + }; + + this.addEventListener('childremoved', __onchildremoved); + this.addEventListener('childadded', __onchildadded); + + }, + width: { + get: function() { + return this._width; + }, + set: function(width) { + this._width = width; + this._element.width = this._detect.width = width; + } + }, + height: { + get: function() { + return this._height; + }, + set: function(height) { + this._height = height; + this._element.height = this._detect.height = height; + } + }, + addChild: function(node) { + this.childNodes.push(node); + node.parentNode = this; + var childAdded = new enchant.Event('childadded'); + childAdded.node = node; + childAdded.next = null; + this.dispatchEvent(childAdded); + node.dispatchEvent(new enchant.Event('added')); + if (this.scene) { + node.scene = this.scene; + var addedToScene = new enchant.Event('addedtoscene'); + node.dispatchEvent(addedToScene); + } + }, + insertBefore: function(node, reference) { + var i = this.childNodes.indexOf(reference); + if (i !== -1) { + this.childNodes.splice(i, 0, node); + node.parentNode = this; + var childAdded = new enchant.Event('childadded'); + childAdded.node = node; + childAdded.next = reference; + this.dispatchEvent(childAdded); + node.dispatchEvent(new enchant.Event('added')); + if (this.scene) { + node.scene = this.scene; + var addedToScene = new enchant.Event('addedtoscene'); + node.dispatchEvent(addedToScene); + } + } else { + this.addChild(node); + } + }, + /** + [lang:ja] + * レンダリングを開始. + [/lang] + * @private + */ + _startRendering: function() { + this.addEventListener('exitframe', this._onexitframe); + this._onexitframe(new enchant.Event(enchant.Event.RENDER)); + }, + /** + [lang:ja] + * レンダリングを停止. + [/lang] + * @private + */ + _stopRendering: function() { + this.removeEventListener('render', this._onexitframe); + this._onexitframe(new enchant.Event(enchant.Event.RENDER)); + }, + _onexitframe: function() { + var core = enchant.Core.instance; + var ctx = this.context; + ctx.clearRect(0, 0, core.width, core.height); + var render = new enchant.Event(enchant.Event.RENDER); + enchant.CanvasRenderer.instance.render(ctx, this, render); + }, + _determineEventTarget: function(e) { + return this._getEntityByPosition(e.x, e.y); + }, + _getEntityByPosition: function(x, y) { + var core = enchant.Core.instance; + var ctx = this._dctx; + if (this._lastDetected < core.frame) { + ctx.clearRect(0, 0, this.width, this.height); + enchant.CanvasRenderer.instance.detectRender(ctx, this); + this._lastDetected = core.frame; + } + var color = ctx.getImageData(x, y, 1, 1).data; + return this._colorManager.getSpriteByColor(color); + } +}); + +enchant.CanvasLayer._attachCache = function(node, layer, onchildadded, onchildremoved) { + var child; + if (!node._cvsCache) { + node._cvsCache = {}; + node._cvsCache.matrix = [ 1, 0, 0, 1, 0, 0 ]; + node._cvsCache.detectColor = 'rgba(' + layer._colorManager.attachDetectColor(node) + ')'; + node.addEventListener('childadded', onchildadded); + node.addEventListener('childremoved', onchildremoved); + } + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + child = node.childNodes[i]; + enchant.CanvasLayer._attachCache(child, layer, onchildadded, onchildremoved); + } + } +}; + +enchant.CanvasLayer._detachCache = function(node, layer, onchildadded, onchildremoved) { + var child; + if (node._cvsCache) { + layer._colorManager.detachDetectColor(node); + node.removeEventListener('childadded', onchildadded); + node.removeEventListener('childremoved', onchildremoved); + delete node._cvsCache; + } + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + child = node.childNodes[i]; + enchant.CanvasLayer._detachCache(child, layer, onchildadded, onchildremoved); + } + } +}; + +enchant.CanvasRenderer = enchant.Class.create({ + render: function(ctx, node, e) { + var width, height, child; + ctx.save(); + node.dispatchEvent(e); + // transform + this.transform(ctx, node); + if (typeof node._visible === 'undefined' || node._visible) { + width = node.width; + height = node.height; + // composite + if (node.compositeOperation) { + ctx.globalCompositeOperation = node.compositeOperation; + } + ctx.globalAlpha = (typeof node._opacity === 'number') ? node._opacity : 1.0; + // render + if (node._backgroundColor) { + ctx.fillStyle = node._backgroundColor; + ctx.fillRect(0, 0, width, height); + } + + if (node.cvsRender) { + node.cvsRender(ctx); + } + + if (enchant.Core.instance._debug && node._debugColor) { + ctx.strokeStyle = node._debugColor; + ctx.strokeRect(0, 0, width, height); + } + if (node._clipping) { + ctx.beginPath(); + ctx.rect(0, 0, width, height); + ctx.clip(); + } + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + child = node.childNodes[i]; + this.render(ctx, child, e); + } + } + } + ctx.restore(); + enchant.Matrix.instance.stack.pop(); + }, + detectRender: function(ctx, node) { + var width, height, child; + if (typeof node._visible === 'undefined' || node._visible) { + width = node.width; + height = node.height; + ctx.save(); + this.transform(ctx, node); + ctx.fillStyle = node._cvsCache.detectColor; + if (node._touchEnabled) { + if (node.detectRender) { + node.detectRender(ctx); + } else { + ctx.fillRect(0, 0, width, height); + } + } + if (node._clipping) { + ctx.beginPath(); + ctx.rect(0, 0, width, height); + ctx.clip(); + } + if (node.childNodes) { + for (var i = 0, l = node.childNodes.length; i < l; i++) { + child = node.childNodes[i]; + this.detectRender(ctx, child); + } + } + ctx.restore(); + enchant.Matrix.instance.stack.pop(); + } + }, + transform: function(ctx, node) { + var matrix = enchant.Matrix.instance; + var stack = matrix.stack; + var newmat, ox, oy, vec; + if (node._dirty) { + matrix.makeTransformMatrix(node, node._cvsCache.matrix); + newmat = []; + matrix.multiply(stack[stack.length - 1], node._cvsCache.matrix, newmat); + node._matrix = newmat; + ox = (typeof node._originX === 'number') ? node._originX : node._width / 2 || 0; + oy = (typeof node._originY === 'number') ? node._originY : node._height / 2 || 0; + vec = [ ox, oy ]; + matrix.multiplyVec(newmat, vec, vec); + node._offsetX = vec[0] - ox; + node._offsetY = vec[1] - oy; + node._dirty = false; + } else { + newmat = node._matrix; + } + stack.push(newmat); + ctx.setTransform.apply(ctx, newmat); + } +}); +enchant.CanvasRenderer.instance = new enchant.CanvasRenderer(); + +/** + * @scope enchant.Scene.prototype + * @type {*} + */ +enchant.Scene = enchant.Class.create(enchant.Group, { + /** + * @name enchant.Scene + * @class + [lang:ja] + * 表示オブジェクトツリーのルートになるクラス. + * シーンはレイヤーを持っていて、子として追加されたオブジェクト (Entity) は描画方法に応じてレイヤーに振り分けられる。 + * Scene クラスは最も汎用的なシーンの実装で、({@link enchant.DOMLayer} と {@link enchant.CanvasLayer}) を持っており、 + * それぞれ DOM, Canvas を用いて描画される。描画順は DOM が手前、Canvas が奥で、 + * 各レイヤーの間では新しく追加されたオブジェクトほど手前に表示される。 + * Scene クラスを継承することで、新しい種類の Layer を持つシーンクラスを作ることができる。 + [/lang] + [lang:en] + * A Class that becomes the root of the display object tree. + [/lang] + [lang:de] + * Eine Klasse die zur Wurzel im Darstellungsobjektbaum wird. + [/lang] + * + * @example + * var scene = new Scene(); + * scene.addChild(player); + * scene.addChild(enemy); + * core.pushScene(scene); + * + * @constructs + * @extends enchant.Group + */ + initialize: function() { + var core = enchant.Core.instance; + + // Call initialize method of enchant.Group + enchant.Group.call(this); + + // All nodes (entities, groups, scenes) have reference to the scene that it belongs to. + this.scene = this; + + this._backgroundColor = null; + + // Create div tag which possesses its layers + this._element = document.createElement('div'); + this._element.style.position = 'absolute'; + this._element.style.overflow = 'hidden'; + this._element.style[enchant.ENV.VENDOR_PREFIX + 'TransformOrigin'] = '0 0'; + + this._layers = {}; + this._layerPriority = []; + + this.addEventListener(enchant.Event.CHILD_ADDED, this._onchildadded); + this.addEventListener(enchant.Event.CHILD_REMOVED, this._onchildremoved); + this.addEventListener(enchant.Event.ENTER, this._onenter); + this.addEventListener(enchant.Event.EXIT, this._onexit); + + var that = this; + this._dispatchExitframe = function() { + var layer; + for (var prop in that._layers) { + layer = that._layers[prop]; + layer.dispatchEvent(new enchant.Event(enchant.Event.EXIT_FRAME)); + } + }; + + this.addEventListener(enchant.Event.CORE_RESIZE, this._oncoreresize); + + this._oncoreresize(core); + }, + x: { + get: function() { + return this._x; + }, + set: function(x) { + this._x = x; + for (var type in this._layers) { + this._layers[type].x = x; + } + } + }, + y: { + get: function() { + return this._y; + }, + set: function(y) { + this._y = y; + for (var type in this._layers) { + this._layers[type].y = y; + } + } + }, + width: { + get: function() { + return this._width; + }, + set: function(width) { + this._width = width; + for (var type in this._layers) { + this._layers[type].width = width; + } + } + }, + height: { + get: function() { + return this._height; + }, + set: function(height) { + this._height = height; + for (var type in this._layers) { + this._layers[type].height = height; + } + } + }, + rotation: { + get: function() { + return this._rotation; + }, + set: function(rotation) { + this._rotation = rotation; + for (var type in this._layers) { + this._layers[type].rotation = rotation; + } + } + }, + scaleX: { + get: function() { + return this._scaleX; + }, + set: function(scaleX) { + this._scaleX = scaleX; + for (var type in this._layers) { + this._layers[type].scaleX = scaleX; + } + } + }, + scaleY: { + get: function() { + return this._scaleY; + }, + set: function(scaleY) { + this._scaleY = scaleY; + for (var type in this._layers) { + this._layers[type].scaleY = scaleY; + } + } + }, + backgroundColor: { + get: function() { + return this._backgroundColor; + }, + set: function(color) { + this._backgroundColor = this._element.style.backgroundColor = color; + } + }, + _oncoreresize: function(e) { + this._element.style.width = e.width + 'px'; + this.width = e.width; + this._element.style.height = e.height + 'px'; + this.height = e.height; + this._element.style[enchant.ENV.VENDOR_PREFIX + 'Transform'] = 'scale(' + e.scale + ')'; + + for (var type in this._layers) { + this._layers[type].dispatchEvent(e); + } + }, + addLayer: function(type, i) { + var core = enchant.Core.instance; + if (this._layers[type]) { + return; + } + var layer = new enchant[type + 'Layer'](); + if (core.currentScene === this) { + layer._startRendering(); + } + this._layers[type] = layer; + var element = layer._element; + if (typeof i === 'number') { + var nextSibling = this._element.childNodes[i]; + if (nextSibling) { + this._element.insertBefore(element, nextSibling); + } else { + this._element.appendChild(element); + } + this._layerPriority.splice(i, 0, type); + } else { + this._element.appendChild(element); + this._layerPriority.push(type); + } + layer._scene = this; + }, + _determineEventTarget: function(e) { + var layer, target; + for (var i = this._layerPriority.length - 1; i >= 0; i--) { + layer = this._layers[this._layerPriority[i]]; + target = layer._determineEventTarget(e); + if (target) { + break; + } + } + if (!target) { + target = this; + } + return target; + }, + _onchildadded: function(e) { + var child = e.node; + var next = e.next; + var target, i; + if (child._element) { + target = 'Dom'; + i = 1; + } else { + target = 'Canvas'; + i = 0; + } + if (!this._layers[target]) { + this.addLayer(target, i); + } + child._layer = this._layers[target]; + this._layers[target].insertBefore(child, next); + child.parentNode = this; + }, + _onchildremoved: function(e) { + var child = e.node; + child._layer.removeChild(child); + child._layer = null; + }, + _onenter: function() { + for (var type in this._layers) { + this._layers[type]._startRendering(); + } + enchant.Core.instance.addEventListener('exitframe', this._dispatchExitframe); + }, + _onexit: function() { + for (var type in this._layers) { + this._layers[type]._stopRendering(); + } + enchant.Core.instance.removeEventListener('exitframe', this._dispatchExitframe); + } +}); + +/** + * @scope enchant.LoadingScene.prototype + */ +enchant.LoadingScene = enchant.Class.create(enchant.Scene, { + /** + * @name enchant.LoadingScene. + * @class + * @constructs + * @extends enchant.Scene + * Default loading scene. If you want to use your own loading animation, overwrite (don't inherit) this class. + * Referred from enchant.Core in default, as `new enchant.LoadingScene` etc. + * + * @usage + * enchant.LoadingScene = enchant.Class.create(enchant.Scene, { + * initialize: function(){ + * enchant.Scene.call(this); + * this.backgroundColor = 'red'; + * // ... + * this.addEventListener('progress', function(e){ + * progress = e.loaded / e.total; + * }); + * this.addEventListener('enterframe', function(){ + * // animation + * }); + * } + * }); + */ + initialize: function() { + enchant.Scene.call(this); + this.backgroundColor = '#000'; + var barWidth = this.width * 0.4 | 0; + var barHeight = this.width * 0.05 | 0; + var border = barWidth * 0.03 | 0; + var bar = new enchant.Sprite(barWidth, barHeight); + bar.disableCollection(); + bar.x = (this.width - barWidth) / 2; + bar.y = (this.height - barHeight) / 2; + var image = new enchant.Surface(barWidth, barHeight); + image.context.fillStyle = '#fff'; + image.context.fillRect(0, 0, barWidth, barHeight); + image.context.fillStyle = '#000'; + image.context.fillRect(border, border, barWidth - border * 2, barHeight - border * 2); + bar.image = image; + var progress = 0, _progress = 0; + this.addEventListener('progress', function(e) { + // avoid #167 https://github.com/wise9/enchant.js/issues/177 + progress = e.loaded / e.total * 1.0; + }); + bar.addEventListener('enterframe', function() { + _progress *= 0.9; + _progress += progress * 0.1; + image.context.fillStyle = '#fff'; + image.context.fillRect(border, 0, (barWidth - border * 2) * _progress, barHeight); + }); + this.addChild(bar); + this.addEventListener('load', function(e) { + var core = enchant.Core.instance; + core.removeScene(core.loadingScene); + core.dispatchEvent(e); + }); + } +}); + +/** + * @scope enchant.CanvasScene.prototype + * @type {*} + */ +enchant.CanvasScene = enchant.Class.create(enchant.Scene, { + initialize: function() { + enchant.Scene.call(this); + this.addLayer('Canvas'); + }, + _determineEventTarget: function(e) { + var target = this._layers.Canvas._determineEventTarget(e); + if (!target) { + target = this; + } + return target; + }, + _onchildadded: function(e) { + var child = e.node; + var next = e.next; + child._layer = this._layers.Canvas; + this._layers.Canvas.insertBefore(child, next); + }, + _onenter: function() { + this._layers.Canvas._startRendering(); + enchant.Core.instance.addEventListener('exitframe', this._dispatchExitframe); + }, + _onexit: function() { + this._layers.Canvas._stopRendering(); + enchant.Core.instance.removeEventListener('exitframe', this._dispatchExitframe); + } +}); + +/** + * @scope enchant.CanvasScene.prototype + * @type {*} + */ +enchant.DOMScene = enchant.Class.create(enchant.Scene, { + initialize: function() { + enchant.Scene.call(this); + this.addLayer('Dom'); + }, + _determineEventTarget: function(e) { + var target = this._layers.Dom._determineEventTarget(e); + if (!target) { + target = this; + } + return target; + }, + _onchildadded: function(e) { + var child = e.node; + var next = e.next; + child._layer = this._layers.Dom; + this._layers.Dom.insertBefore(child, next); + }, + _onenter: function() { + this._layers.Dom._startRendering(); + enchant.Core.instance.addEventListener('exitframe', this._dispatchExitframe); + }, + _onexit: function() { + this._layers.Dom._stopRendering(); + enchant.Core.instance.removeEventListener('exitframe', this._dispatchExitframe); + } +}); + +/** + * @scope enchant.Surface.prototype + */ +enchant.Surface = enchant.Class.create(enchant.EventTarget, { + /** + * @name enchant.Surface + * @class + [lang:ja] + * canvas要素をラップしたクラス. + * + * {@link enchant.Sprite}や{@link enchant.Map}のimageプロパティに設定して表示させることができる. + * Canvas APIにアクセスしたいときは{@link enchant.Surface#context}プロパティを用いる. + * + * @example + * // 円を表示するSpriteを作成する + * var ball = new Sprite(50, 50); + * var surface = new Surface(50, 50); + * surface.context.beginPath(); + * surface.context.arc(25, 25, 25, 0, Math.PI*2, true); + * surface.context.fill(); + * ball.image = surface; + * + * @param {Number} width Surfaceの横幅. + * @param {Number} height Surfaceの高さ. + [/lang] + [lang:en] + * Class that wraps canvas elements. + * + * Can be used to set the {@link enchant.Sprite} and {@link enchant.Map}'s image properties to be displayed. + * If you wish to access Canvas API use the {@link enchant.Surface#context} property. + * + * @example + * // Creates Sprite that displays a circle. + * var ball = new Sprite(50, 50); + * var surface = new Surface(50, 50); + * surface.context.beginPath(); + * surface.context.arc(25, 25, 25, 0, Math.PI*2, true); + * surface.context.fill(); + * ball.image = surface; + * + * @param {Number} width Surface width. + * @param {Number} height Surface height. + [/lang] + [lang:de] + * Diese Klasse dient als Hüllenklasse (Wrapper) für Canvas Elemente. + * + * Mit dieser Klasse können die image Felder der {@link enchant.Sprite} und {@link enchant.Map}'s + * Klassen gesetzt werden und dadurch dargestellt werden. + * Falls die Canvas API genutzt werden möchte kann dies über die + * {@link enchant.Surface#context} Variable erfolgen. + * + * @example + * // Erstellt einen Sprite und stellt einen Kreis dar. + * var ball = new Sprite(50, 50); + * var surface = new Surface(50, 50); + * surface.context.beginPath(); + * surface.context.arc(25, 25, 25, 0, Math.PI*2, true); + * surface.context.fill(); + * ball.image = surface; + * + * @param {Number} width Die Breite der Surface. + * @param {Number} height Die Höhe der Surface. + [/lang] + * @constructs + */ + initialize: function(width, height) { + enchant.EventTarget.call(this); + + var core = enchant.Core.instance; + + /** + [lang:ja] + * Surfaceの横幅. + [/lang] + [lang:en] + * Surface width. + [/lang] + [lang:de] + * Die Breite der Surface. + [/lang] + * @type {Number} + */ + this.width = width; + /** + [lang:ja] + * Surfaceの高さ. + [/lang] + [lang:en] + * Surface height. + [/lang] + [lang:de] + * Die Höhe der Surface. + [/lang] + * @type {Number} + */ + this.height = height; + /** + [lang:ja] + * Surfaceの描画コンテクスト. + [/lang] + [lang:en] + * Surface drawing context. + [/lang] + [lang:de] + * Der Surface Zeichenkontext. + [/lang] + * @type {CanvasRenderingContext2D} + */ + this.context = null; + + var id = 'enchant-surface' + core._surfaceID++; + if (document.getCSSCanvasContext) { + this.context = document.getCSSCanvasContext('2d', id, width, height); + this._element = this.context.canvas; + this._css = '-webkit-canvas(' + id + ')'; + var context = this.context; + } else if (document.mozSetImageElement) { + this._element = document.createElement('canvas'); + this._element.width = width; + this._element.height = height; + this._css = '-moz-element(#' + id + ')'; + this.context = this._element.getContext('2d'); + document.mozSetImageElement(id, this._element); + } else { + this._element = document.createElement('canvas'); + this._element.width = width; + this._element.height = height; + this._element.style.position = 'absolute'; + this.context = this._element.getContext('2d'); + + enchant.ENV.CANVAS_DRAWING_METHODS.forEach(function(name) { + var method = this.context[name]; + this.context[name] = function() { + method.apply(this, arguments); + this._dirty = true; + }; + }, this); + } + }, + /** + [lang:ja] + * Surfaceから1ピクセル取得する. + * @param {Number} x 取得するピクセルのx座標. + * @param {Number} y 取得するピクセルのy座標. + * @return {Array.} ピクセルの情報を[r, g, b, a]の形式で持つ配列. + [/lang] + [lang:en] + * Returns 1 pixel from the Surface. + * @param {Number} x The pixel's x coordinates. + * @param {Number} y The pixel's y coordinates. + * @return {Array.} An array that holds pixel information in [r, g, b, a] format. + [/lang] + [lang:de] + * Liefert einen Pixel der Surface. + * @param {Number} x Die x Koordinaten des Pixel. + * @param {Number} y Die y Koordinaten des Pixel. + * @return {Array.} Ein Array das die Pixelinformationen im [r, g, b, a] Format enthält. + [/lang] + */ + getPixel: function(x, y) { + return this.context.getImageData(x, y, 1, 1).data; + }, + /** + [lang:ja] + * Surfaceに1ピクセル設定する. + * @param {Number} x 設定するピクセルのx座標. + * @param {Number} y 設定するピクセルのy座標. + * @param {Number} r 設定するピクセルのrの値. + * @param {Number} g 設定するピクセルのgの値. + * @param {Number} b 設定するピクセルのbの値. + * @param {Number} a 設定するピクセルの透明度. + [/lang] + [lang:en] + * Sets one pixel within the surface. + * @param {Number} x The pixel's x coordinates. + * @param {Number} y The pixel's y coordinates. + * @param {Number} r The pixel's red level. + * @param {Number} g The pixel's green level. + * @param {Number} b The pixel's blue level. + * @param {Number} a The pixel's transparency. + [/lang] + [lang:de] + * Setzt einen Pixel in der Surface. + * @param {Number} x Die x Koordinaten des Pixel. + * @param {Number} y Die y Koordinaten des Pixel. + * @param {Number} r Der Rotwert des Pixel. + * @param {Number} g Der Grünwert des Pixel. + * @param {Number} b Der Blauwert des Pixels. + * @param {Number} a Die Transparenz des Pixels + [/lang] + */ + setPixel: function(x, y, r, g, b, a) { + var pixel = this.context.createImageData(1, 1); + pixel.data[0] = r; + pixel.data[1] = g; + pixel.data[2] = b; + pixel.data[3] = a; + this.context.putImageData(pixel, x, y); + }, + /** + [lang:ja] + * Surfaceの全ピクセルをクリアし透明度0の黒に設定する. + [/lang] + [lang:en] + * Clears all Surface pixels and makes the pixels transparent. + [/lang] + [lang:de] + * Löscht alle Pixel und setzt macht die Pixel transparent. + [/lang] + */ + clear: function() { + this.context.clearRect(0, 0, this.width, this.height); + }, + /** + [lang:ja] + * Surfaceに対して引数で指定されたSurfaceを描画する. + * + * Canvas APIのdrawImageをラップしており, 描画する矩形を同様の形式で指定できる. + * + * @example + * var src = core.assets['src.gif']; + * var dst = new Surface(100, 100); + * dst.draw(src); // ソースを(0, 0)に描画 + * dst.draw(src, 50, 50); // ソースを(50, 50)に描画 + * // ソースを(50, 50)に縦横30ピクセル分だけ描画 + * dst.draw(src, 50, 50, 30, 30); + * // ソースの(10, 10)から縦横40ピクセルの領域を(50, 50)に縦横30ピクセルに縮小して描画 + * dst.draw(src, 10, 10, 40, 40, 50, 50, 30, 30); + * + * @param {enchant.Surface} image 描画に用いるSurface. + [/lang] + [lang:en] + * Draws the content of the given Surface onto this surface. + * + * Wraps Canvas API drawImage and if multiple arguments are given, + * these are getting applied to the Canvas drawImage method. + * + * @example + * var src = core.assets['src.gif']; + * var dst = new Surface(100, 100); + * dst.draw(src); // Draws source at (0, 0) + * dst.draw(src, 50, 50); // Draws source at (50, 50) + * // Draws just 30 horizontal and vertical pixels of source at (50, 50) + * dst.draw(src, 50, 50, 30, 30); + * // Takes the image content in src starting at (10,10) with a (Width, Height) of (40,40), + * // scales it and draws it in this surface at (50, 50) with a (Width, Height) of (30,30). + * dst.draw(src, 10, 10, 40, 40, 50, 50, 30, 30); + * + * @param {enchant.Surface} image Surface used in drawing. + [/lang] + [lang:de] + * Zeichnet den Inhalt der gegebenen Surface auf diese Surface. + * + * Umhüllt (wraps) die Canvas drawImage Methode und sollten mehrere Argumente + * übergeben werden, werden diese auf die Canvas drawImage Methode angewendet. + * + * @example + * var src = core.assets['src.gif']; + * var dst = new Surface(100, 100); + * dst.draw(src); // Zeichnet src bei (0, 0) + * dst.draw(src, 50, 50); // Zeichnet src bei (50, 50) + * // Zeichnet src an der Position (50,50), jedoch nur 30x30 Pixel + * dst.draw(src, 50, 50, 30, 30); + * // Skaliert und zeichnet den Bereich mit der (Breite, Höhe) von (40, 40) + * // in src ab (10,10) in diese Surface bei (50,50) mit einer (Breite, Höhe) von (30, 30). + * dst.draw(src, 10, 10, 40, 40, 50, 50, 30, 30); + * + * @param {enchant.Surface} image Surface used in drawing. + [/lang] + */ + draw: function(image) { + image = image._element; + if (arguments.length === 1) { + this.context.drawImage(image, 0, 0); + } else { + var args = arguments; + args[0] = image; + this.context.drawImage.apply(this.context, args); + } + }, + /** + [lang:ja] + * Surfaceを複製する. + * @return {enchant.Surface} 複製されたSurface. + [/lang] + [lang:en] + * Copies Surface. + * @return {enchant.Surface} The copied Surface. + [/lang] + [lang:de] + * Kopiert diese Surface. + * @return {enchant.Surface} Die kopierte Surface. + [/lang] + */ + clone: function() { + var clone = new enchant.Surface(this.width, this.height); + clone.draw(this); + return clone; + }, + /** + [lang:ja] + * SurfaceからdataスキームのURLを生成する. + * @return {String} Surfaceを表すdataスキームのURL. + [/lang] + [lang:en] + * Creates a data URI scheme from this Surface. + * @return {String} The data URI scheme that identifies this Surface and + * can be used to include this Surface into a dom tree. + [/lang] + [lang:de] + * Erstellt eine Data-URL (URI Schema) für diese Surface. + * @return {String} Die Data-URL, welche diese Surface identifiziert und + * welche genutzt werden kann um diese in einen DOM Baum einzubinden. + [/lang] + */ + toDataURL: function() { + var src = this._element.src; + if (src) { + if (src.slice(0, 5) === 'data:') { + return src; + } else { + return this.clone().toDataURL(); + } + } else { + return this._element.toDataURL(); + } + } +}); + +/** + [lang:ja] + * 画像ファイルを読み込んでSurfaceオブジェクトを作成する. + * + * このメソッドによって作成されたSurfaceはimg要素のラップしており{@link enchant.Surface#context}プロパティに + * アクセスしたり{@link enchant.Surface#draw}, {@link enchant.Surface#clear}, {@link enchant.Surface#getPixel}, + * {@link enchant.Surface#setPixel}メソッドなどの呼び出しでCanvas APIを使った画像操作を行うことはできない. + * ただし{@link enchant.Surface#draw}メソッドの引数とすることはでき, + * ほかのSurfaceに描画した上で画像操作を行うことはできる(クロスドメインでロードした + * 場合はピクセルを取得するなど画像操作の一部が制限される). + * + * @param {String} src ロードする画像ファイルのパス. + * @param {Function} callback ロード完了時のコールバック. + * @param {Function} [onerror] ロード失敗時のコールバック. + [/lang] + [lang:en] + * Loads an image and creates a Surface object out of it. + * + * It is not possible to access properties or methods of the {@link enchant.Surface#context}, or to call methods using the Canvas API - + * like {@link enchant.Surface#draw}, {@link enchant.Surface#clear}, {@link enchant.Surface#getPixel}, {@link enchant.Surface#setPixel}.. - + * of the wrapped image created with this method. + * However, it is possible to use this surface to draw it to another surface using the {@link enchant.Surface#draw} method. + * The resulting surface can then be manipulated. (when loading images in a cross-origin resource sharing environment, + * pixel acquisition and other image manipulation might be limited). + * + * @param {String} src The file path of the image to be loaded. + * @param {Function} callback on load callback. + * @param {Function} [onerror] on error callback. + [/lang] + [lang:de] + * Läd eine Grafik und erstellt daraus ein Surface Objekt. + * + * Bei Grafiken die mit dieser Methode erstellt wurden ist es nicht möglich auf Variablen oder Methoden des {@link enchant.Surface#context} + * zuzugreifen, oder Methoden die die Canvas API nutzen, wie {@link enchant.Surface#draw}, {@link enchant.Surface#clear}, + * {@link enchant.Surface#getPixel}, {@link enchant.Surface#setPixel}.., aufzurufen. + * Jedoch ist es möglich diese Surface zu nutzen um sie in eine andere Surface mittels der {@link enchant.Surface#draw} zu zeichen. + * Die daraus resultierende Surface kann dann manipuliert werden. (Wenn Bilder in einer Cross-Origin Resource Sharing Umgebung + * geladen werden, kann es sein, dass die Pixelabfrage und andere Bildmanipulationen limitiert sind) + * + * @param {String} src Der Dateipfad der Grafik die geladen werden soll. + [/lang] + * @static + * @return {enchant.Surface} Surface + */ +enchant.Surface.load = function(src, callback, onerror) { + var image = new Image(); + var surface = Object.create(enchant.Surface.prototype, { + context: { value: null }, + _css: { value: 'url(' + src + ')' }, + _element: { value: image } + }); + enchant.EventTarget.call(surface); + onerror = onerror || function() {}; + surface.addEventListener('load', callback); + surface.addEventListener('error', onerror); + image.onerror = function() { + var e = new enchant.Event(enchant.Event.ERROR); + e.message = 'Cannot load an asset: ' + image.src; + enchant.Core.instance.dispatchEvent(e); + surface.dispatchEvent(e); + }; + image.onload = function() { + surface.width = image.width; + surface.height = image.height; + surface.dispatchEvent(new enchant.Event('load')); + }; + image.src = src; + return surface; +}; +enchant.Surface._staticCanvas2DContext = document.createElement('canvas').getContext('2d'); + +enchant.Surface._getPattern = function(surface, force) { + if (!surface._pattern || force) { + surface._pattern = this._staticCanvas2DContext.createPattern(surface._element, 'repeat'); + } + return surface._pattern; +}; + +if (window.Deferred) { + enchant.Deferred = window.Deferred; +} else { + enchant.Deferred = enchant.Class.create({ + initialize: function() { + this._succ = this._fail = this._next = this._id = null; + this._tail = this; + }, + next: function(func) { + var q = new enchant.Deferred(); + q._succ = func; + return this._add(q); + }, + error: function(func) { + var q = new enchant.Deferred(); + q._fail = func; + return this._add(q); + }, + _add: function(queue) { + this._tail._next = queue; + this._tail = queue; + return this; + }, + call: function(arg) { + var received; + var queue = this; + while (queue && !queue._succ) { + queue = queue._next; + } + if (!(queue instanceof enchant.Deferred)) { + return; + } + try { + received = queue._succ(arg); + } catch (e) { + return queue.fail(e); + } + if (received instanceof enchant.Deferred) { + enchant.Deferred._insert(queue, received); + } else if (queue._next instanceof enchant.Deferred) { + queue._next.call(received); + } + }, + fail: function(arg) { + var result, err, + queue = this; + while (queue && !queue._fail) { + queue = queue._next; + } + if (queue instanceof enchant.Deferred) { + result = queue._fail(arg); + queue.call(result); + } else if (arg instanceof Error) { + throw arg; + } else { + err = new Error('failed in Deferred'); + err.arg = arg; + throw err; + } + } + }); + enchant.Deferred._insert = function(queue, ins) { + if (queue._next instanceof enchant.Deferred) { + ins._next = queue._next; + } + queue._next = ins; + }; + enchant.Deferred.next = function(func) { + var q = new enchant.Deferred().next(func); + q._id = setTimeout(function() { q.call(); }, 0); + return q; + }; + enchant.Deferred.parallel = function(arg) { + var q = new enchant.Deferred(); + q._id = setTimeout(function() { q.call(); }, 0); + var progress = 0; + var ret = (arg instanceof Array) ? [] : {}; + var p = new enchant.Deferred(); + for (var prop in arg) { + if (arg.hasOwnProperty(prop)) { + progress++; + /*jshint loopfunc:true */ + (function(queue, name) { + queue.next(function(arg) { + progress--; + ret[name] = arg; + if (progress <= 0) { + p.call(ret); + } + }) + .error(function(err) { p.fail(err); }); + if (typeof queue._id === 'number') { + clearTimeout(queue._id); + } + queue._id = setTimeout(function() { queue.call(); }, 0); + }(arg[prop], prop)); + } + } + if (!progress) { + p._id = setTimeout(function() { p.call(ret); }, 0); + } + return q.next(function() { return p; }); + }; +} + +/** + * @scope enchant.DOMSound.prototype + * @type {*} + */ +enchant.DOMSound = enchant.Class.create(enchant.EventTarget, { + /** + * @name enchant.DOMSound + * @class + [lang:ja] + * audio要素をラップしたクラス. + * + * MP3ファイルの再生はSafari, Chrome, Firefox, Opera, IEが対応 + * (Firefox, OperaではFlashを経由して再生). WAVEファイルの再生は + * Safari, Chrome, Firefox, Operaが対応している. ブラウザが音声ファイル + * のコーデックに対応していない場合は再生されない. + * + * コンストラクタではなく{@link enchant.DOMSound.load}を通じてインスタンスを作成する. + [/lang] + [lang:en] + * Class to wrap audio elements. + * + * Safari, Chrome, Firefox, Opera, and IE all play MP3 files + * (Firefox and Opera play via Flash). WAVE files can be played on + * Safari, Chrome, Firefox, and Opera. When the browser is not compatible with + * the used codec the file will not play. + * + * Instances are created not via constructor but via {@link enchant.DOMSound.load}. + [/lang] + [lang:de] + * Klasse die eine Hüllenklasse (Wrapper) für Audio Elemente darstellt. + * + * Safari, Chrome, Firefox, Opera, und IE können alle MP3 Dateien abspielen + * (Firefox und Opera spielen diese mit Hilfe von Flash ab). WAVE Dateien können + * Safari, Chrome, Firefox, and Opera abspielen. Sollte der Browser nicht mit + * dem genutzten Codec kompatibel sein, wird die Datei nicht abgespielt. + * + * Instanzen dieser Klasse werden nicht mit Hilfe des Konstruktors, sondern mit + * {@link enchant.DOMSound.load} erstellt. + [/lang] + * @constructs + */ + initialize: function() { + enchant.EventTarget.call(this); + /** + [lang:ja] + * Soundの再生時間 (秒). + [/lang] + [lang:en] + * Sound file duration (seconds). + [/lang] + [lang:de] + * Die länge der Sounddatei in Sekunden. + [/lang] + * @type {Number} + */ + this.duration = 0; + throw new Error("Illegal Constructor"); + }, + /** + [lang:ja] + * 再生を開始する. + [/lang] + [lang:en] + * Begin playing. + [/lang] + [lang:de] + * Startet die Wiedergabe. + [/lang] + */ + play: function() { + if (this._element) { + this._element.play(); + } + }, + /** + [lang:ja] + * 再生を中断する. + [/lang] + [lang:en] + * Pause playback. + [/lang] + [lang:de] + * Pausiert die Wiedergabe. + [/lang] + */ + pause: function() { + if (this._element) { + this._element.pause(); + } + }, + /** + [lang:ja] + * 再生を停止する. + [/lang] + [lang:en] + * Stop playing. + [/lang] + [lang:de] + * Stoppt die Wiedergabe. + [/lang] + */ + stop: function() { + this.pause(); + this.currentTime = 0; + }, + /** + [lang:ja] + * Soundを複製する. + * @return {enchant.DOMSound} 複製されたSound. + [/lang] + [lang:en] + * Create a copy of this Sound object. + * @return {enchant.DOMSound} Copied Sound. + [/lang] + [lang:de] + * Erstellt eine Kopie dieses Soundobjektes. + * @return {enchant.DOMSound} Kopiertes Sound Objekt. + [/lang] + */ + clone: function() { + var clone; + if (this._element instanceof Audio) { + clone = Object.create(enchant.DOMSound.prototype, { + _element: { value: this._element.cloneNode(false) }, + duration: { value: this.duration } + }); + } else if (enchant.ENV.USE_FLASH_SOUND) { + return this; + } else { + clone = Object.create(enchant.DOMSound.prototype); + } + enchant.EventTarget.call(clone); + return clone; + }, + /** + [lang:ja] + * 現在の再生位置 (秒). + [/lang] + [lang:en] + * Current playback position (seconds). + [/lang] + [lang:de] + * Aktuelle Wiedergabeposition (seconds). + [/lang] + * @type {Number} + */ + currentTime: { + get: function() { + return this._element ? this._element.currentTime : 0; + }, + set: function(time) { + if (this._element) { + this._element.currentTime = time; + } + } + }, + /** + [lang:ja] + * ボリューム. 0 (無音) ~ 1 (フルボリューム). + [/lang] + [lang:en] + * Volume. 0 (muted) ~ 1 (full volume). + [/lang] + [lang:de] + * Lautstärke. 0 (stumm) ~ 1 (volle Lautstärke). + [/lang] + * @type {Number} + */ + volume: { + get: function() { + return this._element ? this._element.volume : 1; + }, + set: function(volume) { + if (this._element) { + this._element.volume = volume; + } + } + } +}); + +/** + [lang:ja] + * 音声ファイルを読み込んでSoundオブジェクトを作成する. + * + * @param {String} src ロードする音声ファイルのパス. + * @param {String} [type] 音声ファイルのMIME Type. + * @param {Function} callback ロード完了時のコールバック. + * @param {Function} [onerror] ロード失敗時のコールバック. + [/lang] + [lang:en] + * Loads an audio file and creates Sound object. + * + * @param {String} src Path of the audio file to be loaded. + * @param {String} [type] MIME Type of the audio file. + * @param {Function} callback on load callback. + * @param {Function} [onerror] on error callback. + [/lang] + [lang:de] + * Läd eine Audio Datei und erstellt ein Sound objekt. + * + * @param {String} src Pfad zu der zu ladenden Audiodatei. + * @param {String} [type] MIME Type der Audtiodatei. + [/lang] + * @return {enchant.DOMSound} DOMSound + * @static + */ +enchant.DOMSound.load = function(src, type, callback, onerror) { + if (type == null) { + var ext = enchant.Core.findExt(src); + if (ext) { + type = 'audio/' + ext; + } else { + type = ''; + } + } + type = type.replace('mp3', 'mpeg').replace('m4a', 'mp4'); + onerror = onerror || function() {}; + + var sound = Object.create(enchant.DOMSound.prototype); + enchant.EventTarget.call(sound); + sound.addEventListener('load', callback); + sound.addEventListener('error', onerror); + var audio = new Audio(); + if (!enchant.ENV.SOUND_ENABLED_ON_MOBILE_SAFARI && + enchant.ENV.VENDOR_PREFIX === 'webkit' && enchant.ENV.TOUCH_ENABLED) { + window.setTimeout(function() { + sound.dispatchEvent(new enchant.Event('load')); + }, 0); + } else { + if (!enchant.ENV.USE_FLASH_SOUND && audio.canPlayType(type)) { + audio.addEventListener('canplaythrough', function() { + sound.duration = audio.duration; + sound.dispatchEvent(new enchant.Event('load')); + }, false); + audio.src = src; + audio.load(); + audio.autoplay = false; + audio.onerror = function() { + var e = new enchant.Event(enchant.Event.ERROR); + e.message = 'Cannot load an asset: ' + audio.src; + enchant.Core.instance.dispatchEvent(e); + sound.dispatchEvent(e); + }; + sound._element = audio; + } else if (type === 'audio/mpeg') { + var embed = document.createElement('embed'); + var id = 'enchant-audio' + enchant.Core.instance._soundID++; + embed.width = embed.height = 1; + embed.name = id; + embed.src = 'sound.swf?id=' + id + '&src=' + src; + embed.allowscriptaccess = 'always'; + embed.style.position = 'absolute'; + embed.style.left = '-1px'; + sound.addEventListener('load', function() { + Object.defineProperties(embed, { + currentTime: { + get: function() { + return embed.getCurrentTime(); + }, + set: function(time) { + embed.setCurrentTime(time); + } + }, + volume: { + get: function() { + return embed.getVolume(); + }, + set: function(volume) { + embed.setVolume(volume); + } + } + }); + sound._element = embed; + sound.duration = embed.getDuration(); + }); + enchant.Core.instance._element.appendChild(embed); + enchant.DOMSound[id] = sound; + } else { + window.setTimeout(function() { + sound.dispatchEvent(new enchant.Event('load')); + }, 0); + } + } + return sound; +}; + + +window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.msAudioContext || window.oAudioContext; + +/** + * @scope enchant.WebAudioSound.prototype + * @type {*} + */ +enchant.WebAudioSound = enchant.Class.create(enchant.EventTarget, { + /** + * @name enchant.WebAudioSound + * @class + * Sound wrapper class for Web Audio API (supported on some webkit-based browsers) + * + * @constructs + */ + initialize: function() { + if(!window.webkitAudioContext){ + throw new Error("This browser does not support WebAudio API."); + } + var actx = enchant.WebAudioSound.audioContext; + enchant.EventTarget.call(this); + this.src = actx.createBufferSource(); + this.buffer = null; + this._volume = 1; + this._currentTime = 0; + this._state = 0; + this.connectTarget = enchant.WebAudioSound.destination; + }, + play: function(dup) { + var actx = enchant.WebAudioSound.audioContext; + if (this._state === 2) { + this.src.connect(this.connectTarget); + } else { + if (this._state === 1 && !dup) { + this.src.disconnect(this.connectTarget); + } + this.src = actx.createBufferSource(); + this.src.buffer = this.buffer; + this.src.gain.value = this._volume; + this.src.connect(this.connectTarget); + this.src.noteOn(0); + } + this._state = 1; + }, + pause: function() { + var actx = enchant.WebAudioSound.audioContext; + this.src.disconnect(this.connectTarget); + this._state = 2; + }, + stop: function() { + this.src.noteOff(0); + this._state = 0; + }, + clone: function() { + var sound = new enchant.WebAudioSound(); + sound.buffer = this.buffer; + return sound; + }, + dulation: { + get: function() { + if (this.buffer) { + return this.buffer.dulation; + } else { + return 0; + } + } + }, + volume: { + get: function() { + return this._volume; + }, + set: function(volume) { + volume = Math.max(0, Math.min(1, volume)); + this._volume = volume; + if (this.src) { + this.src.gain.value = volume; + } + } + }, + currentTime: { + get: function() { + window.console.log('currentTime is not allowed'); + return this._currentTime; + }, + set: function(time) { + window.console.log('currentTime is not allowed'); + this._currentTime = time; + } + } +}); + +enchant.WebAudioSound.load = function(src, type, callback, onerror) { + var canPlay = (new Audio()).canPlayType(type); + var sound = new enchant.WebAudioSound(); + onerror = onerror || function() {}; + sound.addEventListener(enchant.Event.LOAD, callback); + sound.addEventListener(enchant.Event.ERROR, onerror); + var e = new enchant.Event(enchant.Event.ERROR); + e.message = 'Cannot load an asset: ' + src; + var actx, xhr; + if (canPlay === 'maybe' || canPlay === 'probably') { + actx = enchant.WebAudioSound.audioContext; + xhr = new XMLHttpRequest(); + xhr.responseType = 'arraybuffer'; + xhr.open('GET', src, true); + xhr.onload = function() { + actx.decodeAudioData( + xhr.response, + function(buffer) { + sound.buffer = buffer; + sound.dispatchEvent(new enchant.Event(enchant.Event.LOAD)); + }, + function(error) { + enchant.Core.instance.dispatchEvent(e); + sound.dispatchEvent(e); + } + ); + }; + xhr.send(null); + } else { + setTimeout(function() { + sound.dispatchEvent(e); + }, 50); + } + return sound; +}; + +if(window.AudioContext){ + enchant.WebAudioSound.audioContext = new window.AudioContext(); + enchant.WebAudioSound.destination = enchant.WebAudioSound.audioContext.destination; +} + +/* jshint newcap: false */ + +enchant.Sound = window.AudioContext && enchant.ENV.USE_WEBAUDIO ? enchant.WebAudioSound : enchant.DOMSound; + +/** + * ============================================================================================ + * Easing Equations v2.0 + * September 1, 2003 + * (c) 2003 Robert Penner, all rights reserved. + * This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html. + * ============================================================================================ + */ + +/** + [lang:ja] + * イージング関数ライブラリ + * {@link enchant.Easing} 以下にある関数は全て t(現在の時刻), b(初期値), c(変化後の値), d(値の変化にかける時間) の引数を取り、指定した時刻に取る値を返す。 + * ActionScript で広く使われている Robert Penner による Easing Equations を JavaScript に移植した。 + * + * @see http://www.robertpenner.com/easing/ + * @see http://www.robertpenner.com/easing/penner_chapter7_tweening.pdf + * + [/lang] + [lang:en] + [/lang] + * Easing function library, from "Easing Equations" by Robert Penner. + * @type {Object} + * @namespace + * {@link enchant.Tween} クラスで用いるイージング関数のライブラリ名前空間. + */ +enchant.Easing = { + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + LINEAR: function(t, b, c, d) { + return c * t / d + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + SWING: function(t, b, c, d) { + return c * (0.5 - Math.cos(((t / d) * Math.PI)) / 2) + b; + }, + // quad + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUAD_EASEIN: function(t, b, c, d) { + return c * (t /= d) * t + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUAD_EASEOUT: function(t, b, c, d) { + return -c * (t /= d) * (t - 2) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUAD_EASEINOUT: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t + b; + } + return -c / 2 * ((--t) * (t - 2) - 1) + b; + }, + // cubic + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + CUBIC_EASEIN: function(t, b, c, d) { + return c * (t /= d) * t * t + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + CUBIC_EASEOUT: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + CUBIC_EASEINOUT: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t + b; + } + return c / 2 * ((t -= 2) * t * t + 2) + b; + }, + // quart + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUART_EASEIN: function(t, b, c, d) { + return c * (t /= d) * t * t * t + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUART_EASEOUT: function(t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUART_EASEINOUT: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t + b; + } + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + }, + // quint + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUINT_EASEIN: function(t, b, c, d) { + return c * (t /= d) * t * t * t * t + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUINT_EASEOUT: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + QUINT_EASEINOUT: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t * t + b; + } + return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + }, + //sin + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + SIN_EASEIN: function(t, b, c, d) { + return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + SIN_EASEOUT: function(t, b, c, d) { + return c * Math.sin(t / d * (Math.PI / 2)) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + SIN_EASEINOUT: function(t, b, c, d) { + return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + }, + // circ + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + CIRC_EASEIN: function(t, b, c, d) { + return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + CIRC_EASEOUT: function(t, b, c, d) { + return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + CIRC_EASEINOUT: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + } + return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + }, + // elastic + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + ELASTIC_EASEIN: function(t, b, c, d, a, p) { + if (t === 0) { + return b; + } + if ((t /= d) === 1) { + return b + c; + } + + if (!p) { + p = d * 0.3; + } + + var s; + if (!a || a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + ELASTIC_EASEOUT: function(t, b, c, d, a, p) { + if (t === 0) { + return b; + } + if ((t /= d) === 1) { + return b + c; + } + if (!p) { + p = d * 0.3; + } + var s; + if (!a || a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b); + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + ELASTIC_EASEINOUT: function(t, b, c, d, a, p) { + if (t === 0) { + return b; + } + if ((t /= d / 2) === 2) { + return b + c; + } + if (!p) { + p = d * (0.3 * 1.5); + } + var s; + if (!a || a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + if (t < 1) { + return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + } + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b; + }, + // bounce + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + BOUNCE_EASEOUT: function(t, b, c, d) { + if ((t /= d) < (1 / 2.75)) { + return c * (7.5625 * t * t) + b; + } else if (t < (2 / 2.75)) { + return c * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + b; + } else if (t < (2.5 / 2.75)) { + return c * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + b; + } else { + return c * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + b; + } + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + BOUNCE_EASEIN: function(t, b, c, d) { + return c - enchant.Easing.BOUNCE_EASEOUT(d - t, 0, c, d) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + BOUNCE_EASEINOUT: function(t, b, c, d) { + if (t < d / 2) { + return enchant.Easing.BOUNCE_EASEIN(t * 2, 0, c, d) * 0.5 + b; + } else { + return enchant.Easing.BOUNCE_EASEOUT(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; + } + + }, + // back + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + BACK_EASEIN: function(t, b, c, d, s) { + if (s === undefined) { + s = 1.70158; + } + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + BACK_EASEOUT: function(t, b, c, d, s) { + if (s === undefined) { + s = 1.70158; + } + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + BACK_EASEINOUT: function(t, b, c, d, s) { + if (s === undefined) { + s = 1.70158; + } + if ((t /= d / 2) < 1) { + return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; + } + return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; + }, + // expo + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + EXPO_EASEIN: function(t, b, c, d) { + return (t === 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + EXPO_EASEOUT: function(t, b, c, d) { + return (t === d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; + }, + /** + * @param t + * @param b + * @param c + * @param d + * @return {Number} + */ + EXPO_EASEINOUT: function(t, b, c, d) { + if (t === 0) { + return b; + } + if (t === d) { + return b + c; + } + if ((t /= d / 2) < 1) { + return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + } + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + } +}; + +/** + * Easing Equations v2.0 + */ + +/** + * @scope enchant.ActionEventTarget.prototype + * @type {*} + */ +enchant.ActionEventTarget = enchant.Class.create(enchant.EventTarget, { + /** + * @name enchant.ActionEventTarget + * @class + [lang:ja] + * {@link enchant.Action} クラス向けに拡張された {@link enchant.EventTarget} クラス . + * + [/lang] + [lang:en] + * EventTarget which can change the context of event listeners + [/lang] + * @constructs + * @extends enchant.EventTarget + */ + initialize: function() { + enchant.EventTarget.apply(this, arguments); + }, + /** + * Issue event. + * @param {enchant.Event} e Event issued. + */ + dispatchEvent: function(e) { + var target; + if (this.node) { + target = this.node; + e.target = target; + e.localX = e.x - target._offsetX; + e.localY = e.y - target._offsetY; + } else { + this.node = null; + } + + if (this['on' + e.type] != null) { + this['on' + e.type].call(target, e); + } + var listeners = this._listeners[e.type]; + if (listeners != null) { + listeners = listeners.slice(); + for (var i = 0, len = listeners.length; i < len; i++) { + listeners[i].call(target, e); + } + } + } +}); + +/** + * @scope enchant.Timeline.prototype + */ +enchant.Timeline = enchant.Class.create(enchant.EventTarget, { + /** + * @name enchant.Timeline + * @class + [lang:ja] + * アニメーションを管理するためのクラス. + * + * 操作するノードひとつに対して、必ずひとつのタイムラインが対応する。 + * tl.enchant.js を読み込むと、Node クラスを継承したすべてのクラス (Group, Scene, Entity, Label, Sprite)の + * + * tl プロパティに、タイムラインクラスのインスタンスが生成される。 + * タイムラインクラスは、自身に様々なアクションを追加するメソッドを持っており、 + * これらを使うことで簡潔にアニメーションや様々な操作をすることができる。 + * タイムラインクラスはフレームとタイムのアニメーションができる。 + * @param node 操作の対象となるノード + * @param [unitialized] このパラメータがtrueならば、最初のaddメソッドが呼ばれる時nodeにenchant.Event.ENTER_FRAMEイベントリスナを追加される。 + [/lang] + [lang:en] + * Time-line class. + * Class for managing the action. + * For one node to manipulate the timeline of one must correspond. + * +      * Reading a tl.enchant.js, all classes (Group, Scene, Entity, Label, Sprite) of the Node class that inherits +      * Tlthe property, an instance of the Timeline class is generated. +      * Time-line class has a method to add a variety of actions to himself, +      * entities can be animated and various operations by using these briefly. +      * You can choose time based and frame based(default) animation. + * + * @param node target node + * @param [unitialized] if this param is true, when add method called in the first time, + * enchant.Event.ENTER_FRAME event listener will be added to node (for reducing unused event listeners) + [/lang] + * @constructs + */ + initialize: function(node) { + enchant.EventTarget.call(this); + this.node = node; + this.queue = []; + this.paused = false; + this.looped = false; + this.isFrameBased = true; + this._parallel = null; + this._activated = false; + this.addEventListener(enchant.Event.ENTER_FRAME, this.tick); + }, + /** + * @private + */ + _deactivateTimeline: function() { + if (this._activated) { + this._activated = false; + this.node.removeEventListener('enterframe', this._nodeEventListener); + } + }, + /** + * @private + */ + _activateTimeline: function() { + if (!this._activated && !this.paused) { + this.node.addEventListener("enterframe", this._nodeEventListener); + this._activated = true; + } + }, + /** + [lang:ja] + * 一つのenchant.Event.ENTER_FRAMEイベントはアニメーションに一つの時間単位になる。 (デフォルト) + [/lang] + */ + setFrameBased: function() { + this.isFrameBased = true; + }, + /** + [lang:ja] + * 一つのenchant.Event.ENTER_FRAMEイベントはアニメーションに前のフレームから経過した時間になる。 + [/lang] + */ + setTimeBased: function() { + this.isFrameBased = false; + }, + /** + [lang:ja] + * キューの先頭にあるアクションを終了し、次のアクションへ移行する。 + * アクションの中から呼び出されるが、外から呼び出すこともできる。 + * + * アクション実行中に、アクションが終了した場合、 + * もう一度 tick() 関数が呼ばれるため、1フレームに複数のアクションが処理される場合もある。 + * ex. + * sprite.tl.then(function A(){ .. }).then(function B(){ .. }); + * と記述した場合、最初のフレームで A・B の関数どちらも実行される + [/lang] + [lang:en] + [/lang] + */ + next: function(remainingTime) { + var e, action = this.queue.shift(); + e = new enchant.Event("actionend"); + e.timeline = this; + action.dispatchEvent(e); + + if (this.queue.length === 0) { + this._activated = false; + this.node.removeEventListener('enterframe', this._nodeEventListener); + return; + } + + if (this.looped) { + e = new enchant.Event("removedfromtimeline"); + e.timeline = this; + action.dispatchEvent(e); + action.frame = 0; + + this.add(action); + } else { + // remove after dispatching removedfromtimeline event + e = new enchant.Event("removedfromtimeline"); + e.timeline = this; + action.dispatchEvent(e); + } + if (remainingTime > 0 || (this.queue[0] && this.queue[0].time === 0)) { + var event = new enchant.Event("enterframe"); + event.elapsed = remainingTime; + this.dispatchEvent(event); + } + }, + /** + [lang:ja] + * ターゲットの enterframe イベントのリスナとして登録される関数 + * 1フレーム経過する際に実行する処理が書かれている。 + * (キューの先頭にあるアクションに対して、actionstart/actiontickイベントを発行する) + [/lang] + */ + tick: function(enterFrameEvent) { + if (this.paused) { + return; + } + if (this.queue.length > 0) { + var action = this.queue[0]; + if (action.frame === 0) { + var f; + f = new enchant.Event("actionstart"); + f.timeline = this; + action.dispatchEvent(f); + } + + var e = new enchant.Event("actiontick"); + e.timeline = this; + if (this.isFrameBased) { + e.elapsed = 1; + } else { + e.elapsed = enterFrameEvent.elapsed; + } + action.dispatchEvent(e); + } + }, + add: function(action) { + if (!this._activated) { + var tl = this; + this._nodeEventListener = function(e) { + tl.dispatchEvent(e); + }; + this.node.addEventListener("enterframe", this._nodeEventListener); + + this._activated = true; + } + if (this._parallel) { + this._parallel.actions.push(action); + this._parallel = null; + } else { + this.queue.push(action); + } + action.frame = 0; + + var e = new enchant.Event("addedtotimeline"); + e.timeline = this; + action.dispatchEvent(e); + + e = new enchant.Event("actionadded"); + e.action = action; + this.dispatchEvent(e); + + return this; + }, + /** + [lang:ja] + * アクションを簡単に追加するためのメソッド。 + * 実体は add メソッドのラッパ。 + * @param params アクションの設定オブジェクト + [/lang] + */ + action: function(params) { + return this.add(new enchant.Action(params)); + }, + /** + [lang:ja] + * トゥイーンを簡単に追加するためのメソッド。 + * 実体は add メソッドのラッパ。 + * @param params トゥイーンの設定オブジェクト。 + [/lang] + */ + tween: function(params) { + return this.add(new enchant.Tween(params)); + }, + /** + [lang:ja] + * タイムラインのキューをすべて破棄する。終了イベントは発行されない。 + [/lang] + */ + clear: function() { + var e = new enchant.Event("removedfromtimeline"); + e.timeline = this; + + for (var i = 0, len = this.queue.length; i < len; i++) { + this.queue[i].dispatchEvent(e); + } + this.queue = []; + this._deactivateTimeline(); + return this; + }, + /** + [lang:ja] + * タイムラインを早送りする。 + * 指定したフレーム数が経過したのと同様の処理を、瞬時に実行する。 + * 巻き戻しはできない。 + * @param frames + [/lang] + */ + skip: function(frames) { + var event = new enchant.Event("enterframe"); + if (this.isFrameBased) { + event.elapsed = 1; + } else { + event.elapsed = frames; + frames = 1; + } + while (frames--) { + this.dispatchEvent(event); + } + return this; + }, + /** + [lang:ja] + * タイムラインの実行を一時停止する + [/lang] + */ + pause: function() { + if (!this.paused) { + this.paused = true; + this._deactivateTimeline(); + } + return this; + }, + /** + [lang:ja] + * タイムラインの実行を再開する + [/lang] + */ + resume: function() { + if (this.paused) { + this.paused = false; + this._activateTimeline(); + } + return this; + }, + /** + [lang:ja] + * タイムラインをループさせる。 + * ループしているときに終了したアクションは、タイムラインから取り除かれた後 + * 再度タイムラインに追加される。このアクションは、ループが解除されても残る。 + [/lang] + */ + loop: function() { + this.looped = true; + return this; + }, + /** + [lang:ja] + * タイムラインのループを解除する。 + [/lang] + */ + unloop: function() { + this.looped = false; + return this; + }, + /** + [lang:ja] + * 指定したフレーム数だけ待ち、何もしないアクションを追加する。 + * @param time + [/lang] + */ + delay: function(time) { + this.add(new enchant.Action({ + time: time + })); + return this; + }, + /** + [lang:ja] + * @ignore + * @param time + [/lang] + */ + wait: function(time) { + // reserved + return this; + }, + /** + [lang:ja] + * 関数を実行し、即時に次のアクションに移るアクションを追加する。 + * @param func + [/lang] + */ + then: function(func) { + var timeline = this; + this.add(new enchant.Action({ + onactiontick: function(evt) { + func.call(timeline.node); + }, + // if time is 0, next action will be immediately executed + time: 0 + })); + return this; + }, + /** + [lang:ja] + * then メソッドのシノニム。 + * 関数を実行し、即時に次のアクションに移る。 + * @param func + [/lang] + */ + exec: function(func) { + this.then(func); + }, + /** + [lang:ja] + * 実行したい関数を、フレーム数をキーとした連想配列(オブジェクト)で複数指定し追加する。 + * 内部的には delay, then を用いている。 + * + * @example + * sprite.tl.cue({ + * 10: function(){ 10フレーム経過した後に実行される関数 }, + * 20: function(){ 20フレーム経過した後に実行される関数 }, + * 30: function(){ 30フレーム経過した後に実行される関数 } + * }); + * @param cue キューオブジェクト + [/lang] + */ + cue: function(cue) { + var ptr = 0; + for (var frame in cue) { + if (cue.hasOwnProperty(frame)) { + this.delay(frame - ptr); + this.then(cue[frame]); + ptr = frame; + } + } + }, + /** + [lang:ja] + * ある関数を指定したフレーム数繰り返し実行するアクションを追加する。 + * @param func 実行したい関数 + * @param time 持続フレーム数 + [/lang] + */ + repeat: function(func, time) { + this.add(new enchant.Action({ + onactiontick: function(evt) { + func.call(this); + }, + time: time + })); + return this; + }, + /** + [lang:ja] + * 複数のアクションを並列で実行したいときに指定する。 + * and で結ばれたすべてのアクションが終了するまで次のアクションには移行しない + * @example + * sprite.tl.fadeIn(30).and.rotateBy(360, 30); + * 30フレームでフェードインしながら 360度回転する + [/lang] + */ + and: function() { + var last = this.queue.pop(); + if (last instanceof enchant.ParallelAction) { + this._parallel = last; + this.queue.push(last); + } else { + var parallel = new enchant.ParallelAction(); + parallel.actions.push(last); + this.queue.push(parallel); + this._parallel = parallel; + } + return this; + }, + /** + * @ignore + */ + or: function() { + return this; + }, + /** + * @ignore + */ + doAll: function(children) { + return this; + }, + /** + * @ignore + */ + waitAll: function() { + return this; + }, + /** + [lang:ja] + * true値 が返るまで、関数を毎フレーム実行するアクションを追加する。 + * @example + * sprite.tl.waitUntil(function(){ + * return this.x-- < 0 + * }).then(function(){ .. }); + * // x 座標が負になるまで毎フレーム x座標を減算し続ける + * + * @param func 実行したい関数 + [/lang] + */ + waitUntil: function(func) { + var timeline = this; + this.add(new enchant.Action({ + onactionstart: func, + onactiontick: function(evt) { + if (func.call(this)) { + timeline.next(); + } + } + })); + return this; + }, + /** + [lang:ja] + * Entity の不透明度をなめらかに変えるアクションを追加する。 + * @param opacity 目標の不透明度 + * @param time フレーム数 + * @param [easing] イージング関数 + [/lang] + */ + fadeTo: function(opacity, time, easing) { + this.tween({ + opacity: opacity, + time: time, + easing: easing + }); + return this; + }, + /** + [lang:ja] + * Entity をフェードインするアクションを追加する。 + * fadeTo(1) のエイリアス。 + * @param time フレーム数 + * @param [easing] イージング関数 + [/lang] + */ + fadeIn: function(time, easing) { + return this.fadeTo(1, time, easing); + }, + /** + [lang:ja] + * Entity をフェードアウトするアクションを追加する。 + * fadeTo(1) のエイリアス。 + * @param time フレーム数 + * @param [easing] イージング関数 + [/lang] + */ + fadeOut: function(time, easing) { + return this.fadeTo(0, time, easing); + }, + /** + [lang:ja] + * Entity の位置をなめらかに移動させるアクションを追加する。 + * @param x 目標のx座標 + * @param y 目標のy座標 + * @param time フレーム数 + * @param [easing] イージング関数 + [/lang] + */ + moveTo: function(x, y, time, easing) { + return this.tween({ + x: x, + y: y, + time: time, + easing: easing + }); + }, + /** + [lang:ja] + * Entity のx座標をなめらかに変化させるアクションを追加する。 + * @param x + * @param time + * @param [easing] + [/lang] + */ + moveX: function(x, time, easing) { + return this.tween({ + x: x, + time: time, + easing: easing + }); + }, + /** + [lang:ja] + * Entity のy座標をなめらかに変化させるアクションを追加する。 + * @param y + * @param time + * @param [easing] + [/lang] + */ + moveY: function(y, time, easing) { + return this.tween({ + y: y, + time: time, + easing: easing + }); + }, + /** + [lang:ja] + * Entity の位置をなめらかに変化させるアクションを追加する。 + * 座標は、アクション開始時からの相対座標で指定する。 + * @param x + * @param y + * @param time + * @param [easing] + [/lang] + */ + moveBy: function(x, y, time, easing) { + return this.tween({ + x: function() { + return this.x + x; + }, + y: function() { + return this.y + y; + }, + time: time, + easing: easing + }); + }, + /** + [lang:ja] + * Entity の opacity を0にする (即時) + [/lang] + */ + hide: function() { + return this.then(function() { + this.opacity = 0; + }); + }, + /** + [lang:ja] + * Entity の opacity を1にする (即時) + [/lang] + */ + show: function() { + return this.then(function() { + this.opacity = 1; + }); + }, + /** + [lang:ja] + * Entity をシーンから削除する。 + * シーンから削除された場合、 enterframe イベントは呼ばれなくなるので、 + * タイムラインも止まることに注意。 + * これ以降のアクションは、再度シーンに追加されるまで実行されない。 + [/lang] + */ + removeFromScene: function() { + return this.then(function() { + this.scene.removeChild(this); + }); + }, + /** + [lang:ja] + * Entity をなめらかに拡大・縮小するアクションを追加する。 + * @param scaleX 縮尺 + * @param [scaleY] 縮尺。省略した場合 scaleX と同じ + * @param time + * @param [easing] + [/lang] + */ + scaleTo: function(scale, time, easing) { + if (typeof easing === "number") { + return this.tween({ + scaleX: arguments[0], + scaleY: arguments[1], + time: arguments[2], + easing: arguments[3] + }); + } + return this.tween({ + scaleX: scale, + scaleY: scale, + time: time, + easing: easing + }); + }, + /** + [lang:ja] + * Entity をなめらかに拡大・縮小させるアクションを追加する。 + * 相対縮尺 (ex. アクション開始時の縮尺の n 倍) で指定する。 + * @param scaleX 相対縮尺 + * @param [scaleY] 相対縮尺。省略した場合 scaleX と同じ + * @param time + * @param [easing] + [/lang] + */ + scaleBy: function(scale, time, easing) { + if (typeof easing === "number") { + return this.tween({ + scaleX: function() { + return this.scaleX * arguments[0]; + }, + scaleY: function() { + return this.scaleY * arguments[1]; + }, + time: arguments[2], + easing: arguments[3] + }); + } + return this.tween({ + scaleX: function() { + return this.scaleX * scale; + }, + scaleY: function() { + return this.scaleY * scale; + }, + time: time, + easing: easing + }); + }, + /** + [lang:ja] + * Entity をなめらかに回転させるアクションを追加する。 + * @param deg 目標の回転角度 (弧度法: 1回転を 360 とする) + * @param time フレーム数 + * @param [easing] イージング関数 + [/lang] + */ + rotateTo: function(deg, time, easing) { + return this.tween({ + rotation: deg, + time: time, + easing: easing + }); + }, + /** + [lang:ja] + * Entity をなめらかに回転させるアクションを追加する。 + * 角度は相対角度 (アクション開始時の角度から更に n 度) で指定する + * @param deg 目標の相対角度 (弧度法: 1回転を 360 とする) + * @param time フレーム数 + * @param [easing] イージング関数 + [/lang] + */ + rotateBy: function(deg, time, easing) { + return this.tween({ + rotation: function() { + return this.rotation + deg; + }, + time: time, + easing: easing + }); + } +}); + +/** + * @scope enchant.Action.prototype + * @type {*} + */ + +enchant.Action = enchant.Class.create(enchant.ActionEventTarget, { + /** + * @name enchant.Action + * @class + [lang:ja] + * アニメーションタイムラインを構成する、実行したい処理を指定するためのクラス. + * + * タイムラインに追加されたアクションは順に実行される。 + * アクションが開始・終了された時に actionstart, actionend イベントが発行され、 + * また1フレーム経過した時には actiontick イベントが発行される。 + * これらのイベントのリスナとして実行したい処理を指定する。 + * + * time で指定されたフレーム数が経過すると自動的に次のアクションに移行するが、 + * null が指定されると、タイムラインの next メソッドが呼ばれるまで移行しない。 + * @constructs + * @param param + * @config {integer} [time] アクションが持続するフレーム数。 null が指定されると無限長 + * @config {function} [onactionstart] アクションが開始される時のイベントリスナ + * @config {function} [onactiontick] アクションが1フレーム経過するときのイベントリスナ + * @config {function} [onactionend] アクションがが終了する時のイベントリスナ + [/lang] + [lang:en] + * Action class. +     * Actions are units that make up the time line, +     * It is a unit used to specify the action you want to perform. +     * Action has been added to the time line is performed in order. +     * +     * Actionstart, actiontick event is fired when the action is started and stopped, +     * When one frame has elapsed actiontick event is also issued. +     * Specify the action you want to perform as a listener for these events. +     * The transition to the next action automatically the number of frames that are specified in the time has elapsed. + * + * @constructs + * @param param + * @config {integer} [time] The number of frames that will last action. infinite length is specified null + * @config {function} [onactionstart] Event listener for when the action is initiated + * @config {function} [onactiontick] Event listener for when the action has passed one frame + * @config {function} [onactionend] Event listener for when the action is finished + [/lang] + * @constructs + */ + initialize: function(param) { + enchant.ActionEventTarget.call(this); + this.time = null; + this.frame = 0; + for (var key in param) { + if (param.hasOwnProperty(key)) { + if (param[key] != null) { + this[key] = param[key]; + } + } + } + var action = this; + + this.timeline = null; + this.node = null; + + this.addEventListener(enchant.Event.ADDED_TO_TIMELINE, function(evt) { + action.timeline = evt.timeline; + action.node = evt.timeline.node; + action.frame = 0; + }); + + this.addEventListener(enchant.Event.REMOVED_FROM_TIMELINE, function() { + action.timeline = null; + action.node = null; + action.frame = 0; + }); + + this.addEventListener(enchant.Event.ACTION_TICK, function(evt) { + var remaining = action.time - (action.frame + evt.elapsed); + if (action.time != null && remaining <= 0) { + action.frame = action.time; + evt.timeline.next(-remaining); + } else { + action.frame += evt.elapsed; + } + }); + + } +}); + +/** + * @scope enchant.ParallelAction.prototype + */ +enchant.ParallelAction = enchant.Class.create(enchant.Action, { + /** + * @name enchant.ParallelAction + * @class + [lang:ja] + * アクションを並列で実行するためのアクション。 + * 子アクションを複数持つことができる。 + [/lang] + * @constructs + * @extends enchant.Action + */ + initialize: function(param) { + enchant.Action.call(this, param); + var timeline = this.timeline; + var node = this.node; + /** + [lang:ja] + * 子アクション + [/lang] + [lang:en] + * Children Actions + [/lang] + */ + this.actions = []; + /** + [lang:ja] + * 実行が終了したアクション + [/lang] + [lang:en] + * Removed actions + [/lang] + */ + this.endedActions = []; + var that = this; + + this.addEventListener(enchant.Event.ACTION_START, function(evt) { + for (var i = 0, len = that.actions.length; i < len; i++) { + that.actions[i].dispatchEvent(evt); + } + }); + + this.addEventListener(enchant.Event.ACTION_TICK, function(evt) { + var i, len, timeline = { + next: function(remaining) { + var action = that.actions[i]; + that.actions.splice(i--, 1); + len = that.actions.length; + that.endedActions.push(action); + + var e = new enchant.Event("actionend"); + e.timeline = this; + action.dispatchEvent(e); + + e = new enchant.Event("removedfromtimeline"); + e.timeline = this; + action.dispatchEvent(e); + } + }; + + var e = new enchant.Event("actiontick"); + e.timeline = timeline; + e.elapsed = evt.elapsed; + for (i = 0, len = that.actions.length; i < len; i++) { + that.actions[i].dispatchEvent(e); + } + + if (that.actions.length === 0) { + evt.timeline.next(); + } + }); + + this.addEventListener(enchant.Event.ADDED_TO_TIMELINE, function(evt) { + for (var i = 0, len = that.actions.length; i < len; i++) { + that.actions[i].dispatchEvent(evt); + } + }); + + this.addEventListener(enchant.Event.REMOVED_FROM_TIMELINE, function() { + this.actions = this.endedActions; + this.endedActions = []; + }); + + } +}); + +/** + * @scope enchant.Tween.prototype + */ +enchant.Tween = enchant.Class.create(enchant.Action, { + /** + * @name enchant.Tween + * @class + [lang:ja] + * {@link enchant.Action} を継承した、オブジェクトの特定のプロパティを、なめらかに変更したい時に用いるためのアクションクラス. + * アクションを扱いやすく拡張したクラス. + * + * コンストラクタに渡す設定オブジェクトに、プロパティの目標値を指定すると、 + * アクションが実行された時に、目標値までなめらかに値を変更するようなアクションを生成する。 + * + * トゥイーンのイージングも、easing プロパティで指定できる。 + * デフォルトでは enchant.Easing.LINEAR が指定されている。 + * + * @param params + * @constructs + * @config {time} + * @config {easing} [function] + [/lang] + */ + initialize: function(params) { + var origin = {}; + var target = {}; + enchant.Action.call(this, params); + + if (this.easing == null) { + // linear + this.easing = function(t, b, c, d) { + return c * t / d + b; + }; + } + + var tween = this; + this.addEventListener(enchant.Event.ACTION_START, function() { + // excepted property + var excepted = ["frame", "time", "callback", "onactiontick", "onactionstart", "onactionend"]; + for (var prop in params) { + if (params.hasOwnProperty(prop)) { + // if function is used instead of numerical value, evaluate it + var target_val; + if (typeof params[prop] === "function") { + target_val = params[prop].call(tween.node); + } else { + target_val = params[prop]; + } + + if (excepted.indexOf(prop) === -1) { + origin[prop] = tween.node[prop]; + target[prop] = target_val; + } + } + } + }); + + this.addEventListener(enchant.Event.ACTION_TICK, function(evt) { + // if time is 0, set property to target value immediately + var ratio = tween.time === 0 ? 1 : tween.easing(Math.min(tween.time,tween.frame + evt.elapsed), 0, 1, tween.time) - tween.easing(tween.frame, 0, 1, tween.time); + + for (var prop in target){ + if (target.hasOwnProperty(prop)) { + if (typeof this[prop] === "undefined"){ + continue; + } + tween.node[prop] += (target[prop] - origin[prop]) * ratio; + if (Math.abs(tween.node[prop]) < 10e-8){ + tween.node[prop] = 0; + } + } + } + }); + } +}); + +/** + * + */ +}(window)); diff --git a/init.js b/init.js new file mode 100644 index 0000000..1b87834 --- /dev/null +++ b/init.js @@ -0,0 +1,286 @@ +function include(astrFile) +{ + +  var script = document.createElement('script'); +  script.src = astrFile; +  script.type = 'text/javascript'; +  script.defer = true; +  document.getElementsByTagName('head').item(0).appendChild(script); +} +function rand(number){ + return Math.round (Math.random () * number); +} +/** 一回のタップで発生するエフェクトの数 */ +var EFFECT_NUM = 1; + +/** 単体エフェクト作成 */ +function makeSingleEffect(delay) { + var easing = enchant.Easing.SIN_EASEOUT; // イージングの種類. + var sprite = new Sprite(32, 32); + sprite.scaleX = 0.0; + sprite.scaleY = 0.0; + sprite.visible = false; // 最初は非表示. + // エフェクトの動作設定. + sprite.tl + .delay(delay) // 指定時間待つ. + .then(function() { sprite.visible = true; }) // ここで表示. + .scaleTo(1.0, ctl.game.fps * 0.1, easing) + .scaleTo(0.5, ctl.game.fps * 0.1, easing) + .scaleTo(2.0, ctl.game.fps * 1, easing) + .and().fadeOut(ctl.game.fps * 1, easing) + .then(function() { sprite.tl.removeFromScene(); }); + return sprite; +} + +/** ランダムな色を作成 */ +function makeRandomColor() { + var r = 128 + Math.ceil(Math.random() * 128); + var g = 128 + Math.ceil(Math.random() * 128); + var b = 128 + Math.ceil(Math.random() * 128); + return 'rgb(' + r + ',' + g + ',' + b + ')'; +} + +/** 指定位置の付近に複数エフェクトを追加 */ +function addEffect(scene, x, y) { + for (var i = 0, iNum = EFFECT_NUM; i < iNum; ++i) { + var sprite = makeSingleEffect(i * ctl.game.fps * 0.1); + sprite.backgroundColor = makeRandomColor(); + // sprite.x = x - (sprite.width / 2) + Math.random() * EFFECT_RANGE - (EFFECT_RANGE / 2); + // sprite.y = y - (sprite.height / 2) + Math.random() * EFFECT_RANGE - (EFFECT_RANGE / 2); + sprite.x = x - (sprite.width / 2); + sprite.y = y - (sprite.height / 2); + scene.addChild(sprite); + } +} + +//http://enchantmapeditor.simtter.com/index.html +_mapData = [ + [0,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49,49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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], + [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], + [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], + [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], + [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], + [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] +]; diff --git a/main.js b/main.js new file mode 100644 index 0000000..72c3440 --- /dev/null +++ b/main.js @@ -0,0 +1,469 @@ +enchant(); +////////////////////////////////////// +//global +var ctl = null; +var mangIcon = null; +var mangTouch = null; +var mangLabel = null; +var LabelGroup = enchant.Class.mixClasses(Label, Group,true); +var net = new Net(); +////////////////////////////////////// +//define +////////////////////////////////////// +var PALYER_INIT_X = 100; +var PALYER_INIT_Y = 100; +var CHARA_WIDTH = 64; +var CHARA_HEIGHT = 64; +var GAME_WIDTH = 800; +var GAME_HEIGHT = 600; +var EResPath = { + YUKKURI_BASE : './data/yukkuri_base.png', + YUKKURI_SHADOW : './data/shadow.png', + MARISA_FACE_NORMAL : './data/marisa/face_normal.png', + MARISA_FACE_TIRED : './data/marisa/face_tired.png', + MARISA_HEAR : './data/marisa/hear.png', + OBJECT : './data/object.png', + MAP0 : './data/map0.png', + COMMAND : './data/command.png', + OKAZARI : './data/okazari.png', +}; +var ECommand = { + WORLD_CURSOR: 0, + WORLD_TARGET: 1, +}; + +var EMenuPos = { + X : 600, + Y : 0, + WIDTH : 200, + HEIGHT : GAME_HEIGHT, +}; +var EFieldPos = { + X : 0, + Y : 0, + WIDTH: GAME_WIDTH - EMenuPos.WIDTH, + HEIGHT: GAME_HEIGHT, +}; +var EAction = { + WAIT : 0, + SLEEP : 1, + EAT : 2, + HUNT : 3, + THINK : 4, + WALK : 5, + DEAD: 6, +}; +var EDirection = { + LEFT : 0, + RIGHT: 1, +}; +window.onload = function(){ + + + //init game + var SpriteGroup = enchant.Class.mixClasses(Sprite, Group,true); + var menuBg = new SpriteGroup(EMenuPos.WIDTH, EMenuPos.HEIGHT); + var fieldBg = new enchant.Sprite(EFieldPos.WIDTH, EFieldPos.HEIGHT); + var game = new Game(GAME_WIDTH, GAME_HEIGHT); + var _loadArr = []; + var i=0; + for(var _v in EResPath){ + _loadArr[i] = EResPath[_v]; + i++; + } + game.preload(_loadArr); + var MapGroup = enchant.Class.mixClasses(Map, Group,true); + var backgroundMap = new MapGroup(16, 16); + include("./class.js"); + include("./ctrl.js"); + ctl = new Ctrl(); + ctl.init(game); + ctl.setBackgroundMap(backgroundMap); + var Action = enchant.Class.create({ + initialize: function (yukkuri){ + this.status = EAction.THINK; + // this.status = EAction.EAT; + this.yukkuri = yukkuri; + this.isMoving = false; + }, + act : function(){ + // console.log(this.yukkuri); + if(this.yukkuri.isDead()){ + this.status = EAction.DEAD; + } + switch(this.status){ + case EAction.THINK: + // this.status = EAction.WALK; + // yukkuri.moveTo(120, 120, 30); + if(this.yukkuri.age%10 === 0){ + this.search(); + } + break; + //Random Walk + case EAction.WALK: + this.walk(0); + break; + case EAction.DEAD: + this.dead(); + break; + } + }, + walk : function(retryCounter){ + if(retryCounter > 15){ + retryCounter = 0; + this.status = EAction.EAT; + console.log("retryCount over"); + return; + } + if(this.yukkuri.imgGroup.tl.queue.length === 0){ + var frame = 200; + if(this.isMoving){ + this.isMoving = false; + this.status = EAction.THINK; + this.yukkuri.vx = 0; + this.yukkuri.vy = 0; + }else{ + // this.isMoving = true; + var xpos = 150 - (retryCounter * 10); + var ypos = 150 - (retryCounter * 10); + if(rand(8) === 0){ + this.yukkuri.vx = 0; + this.yukkuri.vy = -ypos; + } + else if(rand(8) == 1){ + this.yukkuri.vx = xpos; + this.yukkuri.vy = -ypos; + this.yukkuri.direction = EDirection.RIGHT; + } + else if(rand(8) == 2){ + this.yukkuri.vx = xpos; + this.yukkuri.vy = 0; + this.yukkuri.direction = EDirection.RIGHT; + } + else if(rand(8) == 3){ + this.yukkuri.vx = xpos; + this.yukkuri.vy = ypos; + this.yukkuri.direction = EDirection.RIGHT; + } + else if(rand(8) == 4){ + this.yukkuri.vx = 0; + this.yukkuri.vy = ypos; + } + else if(rand(8) == 5){ + this.yukkuri.vx = -xpos; + this.yukkuri.vy = ypos; + this.yukkuri.direction = EDirection.LEFT; + } + else if(rand(8) == 6){ + this.yukkuri.vx = -xpos; + this.yukkuri.vy = 0; + this.yukkuri.direction = EDirection.LEFT; + } + else if(rand(8) == 7){ + this.yukkuri.vx = -xpos; + this.yukkuri.vy = -ypos; + this.yukkuri.direction = EDirection.LEFT; + } + if (this.yukkuri.vx || this.yukkuri.vy) { + var map = ctl.backgroundMap; + // var x = this.yukkuri.x + (this.yukkuri.moveX ? this.yukkuri.moveX / Math.abs(this.yukkuri.moveX) * 16 : 0) + 16; + // var y = this.yukkuri.y + (this.yukkuri.moveY ? this.yukkuri.moveY / Math.abs(this.yukkuri.moveY) * 16 : 0) + 16; + var x = this.yukkuri.imgGroup.x + this.yukkuri.vx; + var y = this.yukkuri.imgGroup.y + this.yukkuri.vy + this.yukkuri.height / 2; + if (0 <= x && x < map.width && 0 <= y && y < map.height && !map.hitTest(x, y)) { + // console.log("あたってないよ:"+ this.yukkuri.imgGroup.x + ":" + this.yukkuri.imgGroup.y); + // console.log("X:" + this.yukkuri.moveX); + // console.log("Y:" + this.yukkuri.moveY); + this.isMoving = true; + this.yukkuri.reverse(); + this.yukkuri.moveBy(this.yukkuri.vx, this.yukkuri.vy, frame); + }else{ + // console.log("HIT:"+ this.yukkuri.imgGroup.x + ":" + this.yukkuri.imgGroup.y); + this.walk(retryCounter+1); + } + } + } + } + }, + dead : function(){ + this.yukkuri.tweet("もっとゆっくりしたかった…"); + this.yukkuri.imgBody.tl.clear(); + this.yukkuri.imgBody.tl.pause(); + this.yukkuri.imgGroup.tl.clear(); + this.yukkuri.imgGroup.tl.pause(); + // this.yukkuri.imgBody.tl.unloop(); + // this.yukkuri.imgBody.tl.removeFromScene(); + // this.yukkuri.imgGroup.tl.removeFromScene(); + }, + search : function(){ + this.status = EAction.WALK; + if(true)return; + for (var i = 0, l = game.rootScene.childNodes.length; i < l; i++) { + var node = game.rootScene.childNodes[i]; + if (node instanceof Food) { + + if(this.yukkuri.within(node, this.yukkuri.range)){ + // console.log("yes:"); + }else{ + // console.log("no:"); + } + } + } + } + }); + var Food = enchant.Class.create(enchant.Sprite,{ + initialize: function (type, x, y){ + enchant.Sprite.call(this,16,16); + this.image = game.assets[EResPath.OBJECT]; + this.frame = 15; + this.x = x; + this.y = y; + // this.moveTo(180, 252); + backgroundMap.addChild(this); + } + }); + var Okazari = enchant.Class.create(enchant.Sprite,{ + initialize: function(){ + enchant.Sprite.call(this, 64, 64); + this.image = game.assets[EResPath.OKAZARI]; + this.x = -CHARA_WIDTH / 2; + this.y = -12 - CHARA_HEIGHT / 2; + } + }); + var Yukkuri = enchant.Class.create(enchant.Sprite,{ + initialize: function(x, y){ + this.imgGroup = new Group(); + this.imgBody = new Group(); + enchant.Sprite.call(this, 64, 64); + this.x = -CHARA_WIDTH / 2; + this.y = -CHARA_HEIGHT / 2; + this.vx = 0; + this.vy = 0; + this.image = game.assets[EResPath.YUKKURI_BASE]; + this.direction = EDirection.RIGHT; + this.addEventListener('enterframe', this.runEnterframe); + }, + runEnterframe:function(){ + this.runYukkuri(); + this.runHungry(); + }, + reverse:function(){ + if(this.direction == EDirection.RIGHT){ + this.imgBody.scaleX = 1; + } + else if(this.direction == EDirection.LEFT){ + this.imgBody.scaleX = -1; + } + }, + tweet:function(text){ + this._tweet.text(text, this.x - this._tweet.width/4, this.y - this._tweet.height); + }, + moveTo:function(x, y, time){ + this.imgGroup.tl.moveTo(x, y, time, enchant.Easing.SIN_EASEINOUT); + }, + moveBy:function(x, y, time){ + this.imgGroup.tl.moveBy(x, y, time, enchant.Easing.SIN_EASEINOUT); + + }, + act: function(){ + this.action.act(); + }, + animation: function(){ + this.imgBody.tl.moveBy(0, -5, 10, enchant.Easing.SWING).moveBy(0, 5, 10, enchant.Easing.SWING).loop(); + // this.tl.moveBy(0, -5, 10, enchant.Easing.SWING).moveBy(0, 5, 10, enchant.Easing.SWING).loop(); + // this.okazari.tl.moveBy(0, -5, 10, enchant.Easing.SWING).moveBy(0, 5, 10, enchant.Easing.SWING).loop(); + // this.face.tl.moveBy(0, -5, 10, enchant.Easing.SWING).moveBy(0, 5, 10, enchant.Easing.SWING).loop(); + // this.hear.tl.moveBy(0, -5, 10, enchant.Easing.SWING).moveBy(0, 5, 10, enchant.Easing.SWING).loop(); + }, + moveX: function(x){ + this.imgGroup.x += x; + // this.x += x; + // this.shadow.x += x; + // this._tweet.x += x; + }, + moveY: function(y){ + this.imgGroup.y += y; + // this.y += y; + // this.shadow.y += y; + // this._tweet.y += y; + }, + changeFace: function(erespath){ + this.face.image = game.assets[erespath]; + }, + loadParamsXML: function(url){ + var http = new JKL.ParseXML( url ); + return http.parse(); + }, + runYukkuri: function(){ + if(this.param.hungry > 70){ + if(this.age%(50 - this.param.hungry - 70) === 0 && this.age !== 0){ + this.param.yukkuri -= 1; + } + } + else if(this.param.hungry < 10){ + if(this.age%50 === 0 && this.age !== 0) this.param.yukkuri += 1; + } + + if(this.param.yukkuri <= 0)this.param.yukkuri = 0; + else if(this.param.yukkuri >= this.param.maxYukkuri)this.param.yukkuri = this.param.maxYukkuri; + }, + runHungry: function(){ + if(this.age%100 === 0 && this.age !== 0)this.param.hungry++; + if(this.param.hungry >= 100)this.param.hungry = 100; + }, + isDead: function(){ + return this.param.yukkuri <= 0; + }, + destruct: function(){ + + } + }); + var Marisa = enchant.Class.create(Yukkuri,{ + initialize: function(x, y){ + Yukkuri.call(this,x,y); + + + // var xml = this.loadParamsXML("./data/marisa/params.xml"); + var json = net.load("./data/marisa/params.json"); + this.param = json.root.param; + this.range = 200; + this.shadow = new enchant.Sprite(64, 64); + this.shadow.image = game.assets[EResPath.YUKKURI_SHADOW]; + this.shadow.x = 0 + this.x; + this.shadow.y = CHARA_HEIGHT / 16 + this.x; + + this.face = new enchant.Sprite(64, 64); + this.face.image = game.assets[EResPath.MARISA_FACE_NORMAL]; + this.face.x = -CHARA_WIDTH / 2; + this.face.y = -CHARA_HEIGHT / 2; + + this.hear = new enchant.Sprite(64, 64); + this.hear.image = game.assets[EResPath.MARISA_HEAR]; + this.hear.x = -CHARA_WIDTH / 2; + this.hear.y = -CHARA_HEIGHT / 2; + + this.okazari = new Okazari(); + this.imgGroup.addChild(this.shadow); + this.imgBody.addChild(this); + this.imgBody.addChild(this.face); + this.imgBody.addChild(this.hear); + this.imgBody.addChild(this.okazari); + this.imgGroup.addChild(this.imgBody); + backgroundMap.addChild(this.imgGroup); + this._tweet = new TTweet(148, 64); + + this.imgGroup.addChild(this._tweet); + this.imgGroup.x = x; + this.imgGroup.y = y; + this.animation(); + this.action = new Action(this); + + } + }); + var Player = enchant.Class.create(Marisa,{ + initialize: function(x, y){ + // this.runEnterframe = function(){ + // }, + Marisa.call(this, x, y); + ctl.setPlayer(this); + // this.removeEventListener('enterframe',this.runEnterframe); + this.addEventListener('enterframe', function(){ + if(this.age%10 === 0 && this.age !== 0){ + // console.log("palyer:" + this.age); + } + this.act(); + + //Action pattern for debug + if(game.input.left){ + this.changeFace(EResPath.MARISA_FACE_TIRED); + this.moveX(-10); + this.direction = EDirection.LEFT; + } + if(game.input.right){ + this.moveX(10); + this.direction = EDirection.RIGHT; + } + if(game.input.up){ + this.moveY(-10); + // this.tweet("ゆっくりしていってね!"); + } + if(game.input.down){ + this.moveY(10); + } + this.reverse(); + // if(ctl.backgroundMap.hitTest(this.imgGroup.x, this.imgGroup.y + this.height / 2)){ + // console.log("hit:" + this.imgGroup.x + ":" + (this.imgGroup.y + this.height/2) ); + // }else{ + // console.log("not:" + this.imgGroup.x + ":" + (this.imgGroup.y + this.image.height/2)); + // } + //- Display the circle of search range. + // fieldBg.image.clear(); + // fieldBg.image.context.beginPath(); + // fieldBg.image.context.fillStyle = '#ff0000'; + // fieldBg.image.context.arc(this.imgGroup.x + this.width/2, this.imgGroup.y + this.height/2, this.range, Math.PI * 2, false); + // fieldBg.image.context.fill(); + }); + } + }); + game.onload = function(){ + mangTouch = new MangTouch(ctl); + backgroundMap.image = game.assets[EResPath.MAP0]; + backgroundMap.loadData(_mapData); + backgroundMap.collisionData = _collisionData; + + var menuSurface = new enchant.Surface(EMenuPos.WIDTH, EMenuPos.HEIGHT); + var fieldSurface = new enchant.Surface(EFieldPos.WIDTH, EFieldPos.HEIGHT); + fieldBg.image = fieldSurface; + fieldBg.x = 0; + fieldBg.y = 0; + + menuSurface.context.fillStyle = '#000'; + menuSurface.context.fillRect(0, 0, EMenuPos.WIDTH, EMenuPos.HEIGHT); + menuBg.image = menuSurface; + menuBg.x = EMenuPos.X; + menuBg.y = EMenuPos.Y; + + backgroundMap.addChild(fieldBg); + mangIcon = new MangIcon(ctl, menuBg); + + game.rootScene.addChild(backgroundMap); + game.rootScene.addChild(menuBg); + + // var labelGroup = new LabelGroup(); + mangLabel = new MangLabel(ctl, menuBg); + // var info = new Label("ゆっくり"); + // info.color = "#ffffff"; + // info.font = "14px 'Times New Roman'"; + // info.x = 4; + // info.y = GAME_HEIGHT / 2; + // labelGroup.addChild(info); + // menuBg.addChild(labelGroup); + + + var food = new Food("apple", 200, 250); + var player = new Player(PALYER_INIT_X, PALYER_INIT_Y); + var touchX = 0; + + game.rootScene.addEventListener('touchstart', function (e) { + game.touched = true; + var mang = mangTouch.get(ctl.getCurrentCommand()); + mang.touchstart(e); + }); + game.rootScene.addEventListener('touchmove', function (e) { + var mang = mangTouch.get(ctl.getCurrentCommand()); + mang.touchmove(e); + }); + game.rootScene.addEventListener('touchend', function (e) { + var mang = mangTouch.get(ctl.getCurrentCommand()); + mang.touchend(e); + game.touched = false; + }); + + + game.rootScene.addEventListener('enterframe', function(){ + //main frame + mangLabel.draw(player); + }); + }; + game.start(); +}; diff --git a/mixing.enchant.js b/mixing.enchant.js new file mode 100644 index 0000000..1e78084 --- /dev/null +++ b/mixing.enchant.js @@ -0,0 +1,508 @@ +/** + * @fileOverview + * mixing.enchant.js + [lang:ja] + *

複数のクラスを混ぜることができるようにし、同じ関数やプロパティを複数のクラスに追加することができるようにするenchant.jsプラグイン. + * その上、コピーアンドペーストをしないために、製法({@link enchant.Class.MixingRecipe})で定義された関数やプロパティを + * 複数クラスに混ぜることもできるようにする.

+ *

これで複数の継承ようなことができるということ

+ *

必要なもの:

    + *
  • enchant.js v0.6 以上.

+ * 詳細は{@link enchant.Class.mixClasses}, {@link enchant.Class.MixingRecipe.createFromClass}, + * {@link enchant.Class.mixClassesFromRecipe}, {@link enchant.Class.MixingRecipe} や + * {@link enchant.Class.applyMixingRecipe} 参照してください. + [/lang] + [lang:en] + *

A plugin for enchant.js which allows to mix + * arbitrary many {@link enchant.Class} classes together. + * It is also possible to add functions and properties defined + * as a recipe ({@link enchant.Class.MixingRecipe}) to arbitrary many classes to avoid copy and paste.

+ *

Through this it is possible to achieve a behavior similar to multiple inheritance

+ *

Requires:

    + *
  • enchant.js v0.6 or later.

+ * See also {@link enchant.Class.mixClasses}, {@link enchant.Class.MixingRecipe.createFromClass}, + * {@link enchant.Class.mixClassesFromRecipe}, {@link enchant.Class.MixingRecipe} and + * {@link enchant.Class.applyMixingRecipe} for an introduction. + [/lang] + [lang:de] + *

Ein Plugin für enchant.js mit dem es möglich ist, beliebig viele + * {@link enchant.Class} Klassen zusammen zu mischen. + * Um Copy & Paste zu vermeiden, ist es auch möglich Funktionen und + * Properties, die in einem Rezept ({@link enchant.Class.MixingRecipe}) + * definiert sind zu beliebig vielen Klassen hinzuzufügen.

+ *

Durch dies ist es möglich ein Verhalten ähnlich zu multipler Vererbung zu erlangen.

+ *

Benötigt:

    + *
  • enchant.js v0.6 oder höher.

+ * Weiterführende Informationen: {@link enchant.Class.mixClasses}, {@link enchant.Class.MixingRecipe.createFromClass}, + * {@link enchant.Class.mixClassesFromRecipe}, {@link enchant.Class.MixingRecipe} und + * {@link enchant.Class.applyMixingRecipe} + [/lang] + * @require enchant.js v0.6+ + * + * @version 0.1 + * @author Ubiquitous Entertainment Inc. (Kevin Kratzer) + **/ + +if (enchant !== undefined) { + (function() { + + /** + * @private + */ + var decorateFunctionFactory = function(srcFunction, currentFunctionName) { + return function() { + var firstResult, secondResult; + firstResult = this._mixing[currentFunctionName].apply(this,arguments); + secondResult = srcFunction.apply(this,arguments); + if(secondResult) { + return secondResult; + } + if(firstResult) { + return firstResult; + } + }; + }; + + /** + * @private + */ + var voidFunction = function(){}; + + /** + * @private + */ + var multipleMixingCombinationFunctionFactory = function(oldFunc,newFunc, key) { + return function() { + var firstResult = oldFunc.apply(this,arguments); + var mixingStore = this._mixing[key]; + this._mixing[key] = voidFunction; + var secondResult = newFunc.apply(this,arguments); + this._mixing[key] = mixingStore; + if(secondResult) { + return secondResult; + } + if(firstResult) { + return firstResult; + } + }; + }; + + /** + * @private + */ + var createFromPrototypeNonRecursive = function(decorate, override, properties, source, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) { + for(var key in source) { + if(source.hasOwnProperty(key)) { + var descriptor = Object.getOwnPropertyDescriptor(source, key); + if(descriptor.value && typeof(descriptor.value) === 'function') { + if((!functionIgnoreNameList || functionIgnoreNameList.indexOf(key) === -1) && key !== 'constructor') { + if(!functionOverrideNameList || functionOverrideNameList.indexOf(key) === -1) { + decorate[key] = (decorateFunctionFactory(source[key],key)); + } else { + override[key] = source[key]; + } + } + } else { + if(!propertyIgnoreNameList || propertyIgnoreNameList.indexOf(key) === -1 && key !== '_mixing') { + properties[key] = descriptor; + } + } + } + } + }; + + /** + * @private + */ + var createFromPrototype = function(decorate,override,properties,source,onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) { + if(!onlyOwnProperties && source instanceof Object) { + createFromPrototype(decorate,override,properties,Object.getPrototypeOf(source),onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList); + } + createFromPrototypeNonRecursive(decorate,override,properties,source, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList); + }; + + /** + * @private + */ + var getFunctionParams = function(methodString) { + if(typeof(methodString) !== 'string') { + methodString = methodString.toString(); + } + return methodString.substring(methodString.indexOf('(')+1,methodString.indexOf(')')).replace(/\s+/,'').split(','); + }; + + /*Public Interface */ + /** + * @scope enchant.Class.MixingRecipe.prototype + */ + enchant.Class.MixingRecipe = enchant.Class.create({ + /** + [lang:ja] + * 混ぜる中、どういう風に関数やプロパティが追加されるか設定する新たなMixingRecipeを生成する. + * クラスからMixingRecipeを生成することには {@link enchant.Class.MixingRecipe.createFromClass} を参照してください. + * @class 混ぜる先にどういう風に混ぜる処理を行うか設定する. + * このために、MixingRecipeはプロパティが三つある: + *
  • decorateMethods(先の関数をラップする関数、デコレータ・パターンを参照してください)
  • + *
  • overrideMethods (先の関数をオーバーライドする関数)
  • + *
  • overrideProperties (先のプロパティをオーバーライドするプロパティ)
+ *

{@link enchant.Class.mixClasses}、 {@link enchant.Class.mixClassesFromRecipe} や {@link enchant.Class.applyMixingRecipe} を参照してください.

+ * @param {Object} decorateMethods 先の関数をラップする関数、デコレータ・パターンを参照してください. 混ぜる結果のクラスでラップされた関数をアクセスするように_mixingというプロパティがある、例:this._mixing.myFunction.apply(this,arguments).
(キーと値のペア持っているオブジェクト、キーは関数名、値は関数). + * @param {Object} overrideMethods 先の関数をオーバーライドする関数.
(キーと値のペア持っているオブジェクト、キーは関数名、値は関数). + * @param {Object} properties 先のプロパティをオーバーライドするプロパティ.
(キーと値のペア持っているオブジェクト、キーは関数名、値はプロパティデスクリプタ). + * @property {Object} decorateMethods 先の関数をラップする関数、デコレータ・パターンを参照してください. 混ぜる結果のクラスでラップされた関数をアクセスするように_mixingというプロパティがある、例:this._mixing.myFunction.apply(this,arguments).
(キーと値のペア持っているオブジェクト、キーは関数名、値は関数). + * @property {Object} overrideMethods 先の関数をオーバーライドする関数.
(キーと値のペア持っているオブジェクト、キーは関数名、値は関数). + * @property {Object} overrideProperties 先のプロパティをオーバーライドするプロパティ.
(キーと値のペア持っているオブジェクト、キーは関数名、値はプロパティデスクリプタ). + [/lang] + [lang:en] + * Creates a new MixingRecipe which is used for describing in which way functions and properties should be added during the mixing. + * To create a recipe from an existing class see {@link enchant.Class.MixingRecipe.createFromClass} + * @class This class is describing in which way the mixing will be performed on the target classes. + * For this purpose, MixingRecipe contains three properties: + *
  • decorateMethods (methods which will be decorated in the target, see decorator pattern)
  • + *
  • overrideMethods (methods which will be overriden in the target)
  • + *
  • overrideProperties (properties which will be redefined in the target)
+ *

See also {@link enchant.Class.mixClasses}, {@link enchant.Class.mixClassesFromRecipe} and {@link enchant.Class.applyMixingRecipe}.

+ * @param {Object} decorateMethods The methods which will be decorated in the target, see decorator pattern. To access methods which have been decorated in the class resulting from mixing the _mixing property can be used, e.g. this._mixing.myFunction.apply(this,arguments).
(Object containing key-value pairs, key := function name, value := function). + * @param {Object} overrideMethods The methods which will be overriden in the target.
(Object containing key-value pairs, key := function name, value := function). + * @param {Object} properties The properties which will be redefined in the target.
(Object containing key-value pairs, key := function name, value := property descriptor). + * @property {Object} decorateMethods The methods which will be decorated in the target, see decorator pattern. To access methods which have been decorated in the class resulting from mixing the _mixing property can be used, e.g. this._mixing.myFunction.apply(this,arguments).
(Object containing key-value pairs, key := function name, value := function). + * @property {Object} overrideMethods The methods which will be overriden in the target.
(Object containing key-value pairs, key := function name, value := function). + * @property {Object} overrideProperties The properties which will be redefined in the target.
(Object containing key-value pairs, key := function name, value := property descriptor). + [/lang] + [lang:de] + * Erstellt ein neues MixingRecipe, welches beschreibt, auf welche Art und Weise Funktionen und Properties während des Mischens hinzugefügt werden. + * Um ein Rezept aus einer bereits existierend Klasse zu erstellen, ist auf {@link enchant.Class.MixingRecipe.createFromClass} zu verweisen. + * @class Diese Klasse beschreibt auf welche Art und Weise das mischen mit der Zielklasse durchgeführt wird. + * Für diesen Zweck enthählt ein MixingRecipe drei Properties: + *
  • decorateMethods (Methoden, welche in der Zielklasse dekoriert werden, siehe Dekorierer Entwurfsmuster)
  • + *
  • overrideMethods (Methoden, welche in der Zielklasse überschrieben werden)
  • + *
  • overrideProperties (Properties, welche in der Zielklasse redefiniert werden)
+ *

Siehe auch: {@link enchant.Class.mixClasses}, {@link enchant.Class.mixClassesFromRecipe} und {@link enchant.Class.applyMixingRecipe}.

+ * @param {Object} decorateMethods Die Methoden, welche in der Zielklasse dekoriert werden, siehe Dekorierer Entwurfsmuster. Auf die dekoriertie Methode kann in der durch das Mixen erstellten Klasse mit Hilfe des _mixing Property zugegriffen werden, z.B. this._mixing.myFunction.apply(this,arguments).
(Objekt welches Schlüssel-Wert Paare enthält, Schlüssel := Funktionsname, Wert := Funktion) + * @param {Object} overrideMethods Die Methoden, welche in der Zielklasse überschrieben werden.
(Objekt welches Schlüssel-Wert Paare enthält, Schlüssel := Funktionsname, Wert := Funktion). + * @param {Object} properties Die Properties, welche in der Zielklasse redefiniert werden.
(Objekt welches Schlüssel-Wert Paare enthält, Schlüssel := Funktionsname, Wert := Propertydescriptor). + * @property {Object} decorateMethods Die Methoden, welche in der Zielklasse dekoriert werden, siehe Dekorierer Entwurfsmuster. Auf die dekoriertie Methode kann in der durch das Mixen erstellten Klasse mit Hilfe des _mixing Property zugegriffen werden, z.B. this._mixing.myFunction.apply(this,arguments).
(Objekt welches Schlüssel-Wert Paare enthält, Schlüssel := Funktionsname, Wert := Funktion) + * @property {Object} overrideMethods Die Methoden, welche in der Zielklasse überschrieben werden.
(Objekt welches Schlüssel-Wert Paare enthält, Schlüssel := Funktionsname, Wert := Funktion). + * @property {Object} overrideProperties Die Properties, welche in der Zielklasse redefiniert werden.
(Objekt welches Schlüssel-Wert Paare enthält, Schlüssel := Funktionsname, Wert := Propertydescriptor). + [/lang] + * @example + * var recipe = new enchant.Class.MixingRecipe({ + * add : function(value) { + * this._myValue += 3*value; + * this._mixing.add.apply(this,arguments); + * }, + * mult : function(value) { + * this._myValue *= value*7; + * this._mixing.mult.apply(this,arguments); + * } + * },{ + * sub : function(value) { + * this._myValue -= 5*value; + * } + * },{ + * myProperty : { + * get: function() { + * return 3*this._myPropertyValue; + * }, + * set : function(val) { + * this._myPropertyValue = val; + * } + * }}); + * var NewClass = enchant.Class.applyMixingRecipe(Class1,recipe); + * @extends Object + * @constructs + */ + initialize : function(decorateMethods, overrideMethods, properties) { + this.decorateMethods = decorateMethods; + this.overrideMethods = overrideMethods; + this.overrideProperties = properties; + } + }); + + /** + [lang:ja] + * 引数のクルスの関数やプロパティから、MixingRecipeを生成する. + * デフォルト振舞はsourceClassの全ての関数やプロパティ、スーパークラスの関数やプロパティも使用して、 + * 混ぜる先の関数をラップする(decorate).
_mixingプロパティでラップされた関数が自動的に、 + * sourceClassと混ぜる先の関数を呼び出されるので、関係なくてもいい. + *

対応引数でデフォルト振舞を変更ができる.

+ * + * @param {Function} sourceClass このクラスから、MixingRecipeが生成される. + * @param [boolean] onlyOwnProperties Trueの場合、スーパークラスの関数やプロパティが無視されない. + * @param [Array] functionOverrideNameList 混ぜるときオーバーライドされる関数名を持っている配列. + * @param [Array] functionIgnoreNameList MixingRecipeを生成するとき無視される関数名を持っている配列. + * @param [Array] propertyIgnoreNameList MixingRecipeを生成するとき無視されるプロパティ名を持っている配列. + * @returns {enchant.Class.MixingRecipe} クラス定義から生成されたMixingRecipe. + [/lang] + [lang:en] + * Takes the methods and properties of the given class to create a new MixingRecipe. + * The default behavior is to take all functions and properties of the given class + * including functions and properties defined in super classes, whereas functions + * are set to decorate the mixing target.
Methods which are decorated will automatically + * call the soureClass method and the mixing target method (using the _mixing property) - + * so there is no need to handle this yourself. + *

To change the default behavior set the corresponding arguments of the function.

+ * + * @param {Function} sourceClass The class which will be used to create the recipe. + * @param [boolean] onlyOwnProperties If set to true, the functions and properties of the super classes will be ignored. + * @param [Array] functionOverrideNameList An array containing names of functions which should be set to override functions in the target during mixing. + * @param [Array] functionIgnoreNameList An array containing names of functions which should be ignored when creating the recipe. + * @param [Array] propertyIgnoreNameList An array containing names of properties which should be ignored when creating the recipe. + * @returns {enchant.Class.MixingRecipe} The MixingRecipe created from the definition of the sourceClass. + [/lang] + [lang:de] + * Nimmt die Methoden und Properties der übergebenen Klasse um ein neues MixingRecipe zu erstellen. + * Das Standardverhalten dabei ist, alle Funktionen und Properties der übergebenen Klasse, + * einschließlich der Funktionen und Properties in den Superklassen zu nehmen und diese + * in der Zielklasse beim mixen zu dekorieren.
Methoden welche dekoriert werden, rufen + * automatisch die Methoden der sourceClass und der Zielklasse des Mixens, mit Hilfe des + * _mixing Properties, auf. Daher muss dies nicht selbst berücksichtigt werden. + *

Durch die entsprechenden Argumente der Funktion kann das Standardverhalten zu verändert werden.

+ * + * @param {Function} sourceClass Die Klasse aus der das MixingRecipe erstellt wird. + * @param [boolean] onlyOwnProperties Wenn dieses Argument true ist, werden Funktionen und Properties der Superklassen ignoriert. + * @param [Array] functionOverrideNameList Ein Array welches Namen von Funktionen enthält, welche während des Mixens überschrieben werden sollen. + * @param [Array] functionIgnoreNameList Ein Array welches Namen von Funktionen enthält, welche bei der MixingRecipe erstellung ignoriert werden sollen. + * @param [Array] propertyIgnoreNameList Ein Array welches Namen von Properties enthält, welche bei der MixingRecipe erstellung ignoriert werden sollen. + * @returns {enchant.Class.MixingRecipe} Das MixingRecipe, welches aus der Definition der sourceClass erstellt wurde. + [/lang] + * @example + * var recipe = enchant.Class.MixingRecipe.createFromClass(Class2, true, + * ['overrideFunction1','overrideFunction2'], + * ['ignoreFunction1','ignoreFunction2'], + * ['ignoreProperty1','ignorePropterty2']); + * recipe.overrideMethods['additionalFunction'] = new function() { + * console.log('Hello, World'); + * } + * recipe.overrideProperties['newProperty'] = { + * get: function() { + * return this._newProperty; + * }, + * set : function(val) { + * this._newProperty = val; + * } + * } + * var NewClass = enchant.Class.mixClassesFromRecipe(Class1,Class2,recipe); + * @constructs + * @static + */ + enchant.Class.MixingRecipe.createFromClass = function(sourceClass, onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList) { + var decorate = {}; + var override = {}; + var properties = {}; + + var source = sourceClass.prototype; + createFromPrototype(decorate,override,properties,source,onlyOwnProperties, functionOverrideNameList, functionIgnoreNameList, propertyIgnoreNameList); + return new enchant.Class.MixingRecipe(decorate,override,properties); + }; + + /** + [lang:ja] + * 設定されたMixingRecipeを使用して、firstClassというクラスに実行して、この結果を戻る。設定されたMixingRecipeはsecondClassというクラスに関係があったほうがいい. + * どちらでもクラスの初期化関数を呼び出すデフォルト初期化関数が追加される. + * このデフォルト初期か関数の書式は:
+ * ([firstClass コンストラクタ 引数 1],...,[firstClass コンストラクタ 引数 n],[secondClass コンストラクタ 引数 1],...[secondClass コンストラクタ 引数 n])

+ *

どちらでもクラスが変更されない

{@link enchant.Class.MixingRecipe} を参照してください. + * @param {Function} firstClass MixingRecipeを実行されるクラス. + * @param {Function} sourceClass MixingRecipに関係があるクラス。デフォルト初期化関数に使用される。 + * @param {enchant.Class.MixingRecipe} recipe firstClassに実行される製法。 secondClassに関係があったほうがいい. + * @param [Function] initializeMethod 設定すると、新しいクラスの初期化にデフォルト初期化関数が使用されないけど、この関数が使用される. + * @returns {Function} 製法でどちらでもクラスを混ぜた結果クラス. + [/lang] + [lang:en] + * Uses the given MixingRecipe, applies it to the first class and returns the result - the MixingRecipe should correspond to the secondClass. + * A default initialize method will be added which will call the initialize functions of both classes. + * The signature for the default initialize method is:
+ * ([firstClass constructor arg 1],...,[firstClass constructor arg n],[secondClass constructor arg1],...[secondClass constructor arg n]) + *

Both classes will not be modified.

See also: {@link enchant.Class.MixingRecipe} + * + * @param {Function} firstClass The class to which the recipe will be applied. + * @param {Function} secondClass The class which is related to the MixingRecipe, used for the default initialize function. + * @param {enchant.Class.MixingRecipe} recipe The recipe which is applied to the first class - should correspond to the secondClass. + * @param [Function] initializeMethod If provided, this function will be used to initialize the resulting class instead of the default initialize method. + * @returns {Function} initializeMethod The class which is the result of mixing both classes using the recipe. + [/lang] + [lang:de] + * Nutzt das gegebene MixingRecipe, wendet es auf die "firstClass" Klasse an und liefert das Ergebnis daraus zurück - das MixingRecipe sollte der secondClass entsprechen. + * Eine Standard-Initialisierungsmethode wird hinzugefügt, welche die Initialisierungsmethode beider Klassen aufruft. + * Die Signatur für diese Standard-Initialisierungsmethode ist:
+ * ([firstClass Konstruktor Arg 1],...,[firstClass Konstruktor Arg n],[secondClass Konstruktor Arg 1],...[secondClass Konstruktor Arg n])

+ *

Beide Klassen werden nicht verändert.

Siehe auch: {@link enchant.Class.MixingRecipe} + * @param {Function} firstClass Die Klasse auf die das MixingRecipe angewendet wird. + * @param {Function} secondClass Die Klasse die dem MixingRecipe entpsricht, wird für die Standard-Initialisierungsmethode genutzt. + * @param {enchant.Class.MixingRecipe} recipe Das MixingRecipe, welches auf die firstClass Klasse angewendet wird - sollte der secondClass entsprechen. + * @param [Function] initializeMethod Falls gegeben, wird diese Methode, anstelle der Standard-Initialisierungsmethode, zum Initialisieren der resultierenden Klasse verwendet. + * @returns {Function} Die Klasse, welche das Ergebnis des Mixens beider Klassen mit Hilfe des MixingRecipe darstellt. + [/lang] + * @example + * var MapGroup = enchant.Class.mixClasses(Map, Group,true); + * var map = new MapGroup(16, 16); + * var SpriteLabel = enchant.Class.mixClasses(Sprite, Label,true); + * var kumaLabel = new SpriteLabel(32,32,'Kuma'); + * @static + */ + enchant.Class.mixClassesFromRecipe = function(firstClass, secondClass, recipe, initializeMethod) { + var result = enchant.Class.applyMixingRecipe(firstClass,recipe); + var paramLength = getFunctionParams(firstClass.prototype.initialize).length; + if(typeof(initializeMethod) !== 'function') { + initializeMethod = function() { + var args = Array.prototype.slice.call(arguments); + secondClass.prototype.initialize.apply(this,args.slice(paramLength)); + firstClass.prototype.initialize.apply(this,args.slice(0,paramLength)); + }; + } + result.prototype.initialize = initializeMethod; + return result; + }; + + + /** + [lang:ja] + * secondClassというクルスからMixingRecipeを生成して、firstClassというクラスに実行して、この結果を戻る. + * デフォルト振舞はsecondClassの全ての関数やプロパティ、スーパークラスの関数やプロパティも使用して、 + * 混ぜる先の関数をラップする(decorate).
_mixingプロパティでラップされた関数が自動的に、 + * sourceClassと混ぜる先の関数を呼び出されるので、関係なくてもいい. + *

その上、どちらでもクラスの初期化関数を呼び出すデフォルト初期化関数が追加される.このデフォルト初期か関数の書式は:
+ * ([firstClass コンストラクタ 引数 1],...,[firstClass コンストラクタ 引数 n],[secondClass コンストラクタ 引数 1],...[secondClass コンストラクタ 引数 n])

+ *

どちらでもクラスが変更されない

{@link enchant.Class.MixingRecipe} を参照してください. + * @param {Function} firstClass MixingRecipeを実行されるクラス. + * @param {Function} sourceClass このクラスから、MixingRecipeが生成される. + * @param [boolean] onlyOwnProperties Trueの場合、スーパークラスの関数やプロパティが無視されない. + * @param [Function] initializeMethod 設定すると、新しいクラスの初期化にデフォルト初期化関数が使用されないけど、この関数が使用される. + * @returns {Function} どちらでもクラスを混ぜた結果クラス. + [/lang] + [lang:en] + * Creates an MixingRecipe out of the second class, applies it to the first class and returns the result. + * The default behavior is to take all functions and properties of the second class, + * including functions and properties defined in its super classes, whereas functions + * are set to decorate the mixing target.
Methods which are decorated will automatically + * call the soureClass method and the mixing target method (using the _mixing property) - + * so there is no need to handle this yourself. + *

Furthermore, a default initialize method will be added which will + * call the initialize functions of both classes. The signature for the default initialize method is:
+ * ([firstClass constructor arg 1],...,[firstClass constructor arg n],[secondClass constructor arg 1],...[secondClass constructor arg n])

+ *

Both classes will not be modified.

See also: {@link enchant.Class.MixingRecipe} + * + * @param {Function} firstClass The class to which the recipe will be applied. + * @param {Function} secondClass The class from which the recipe will be created + * @param [boolean] useOnlyOwnPropertiesForSecondClass If set to true, the functions and properties of the super classes will be ignored during the recipe creation of the secondClass. + * @param [Function] initializeMethod If provided, this function will be used to initialize the resulting class instead of the default initialize method. + * @returns {Function} The class which is the result of mixing both classes. + [/lang] + [lang:de] + * Erstellt ein MixingRecipe aus der "secondClass" Klasse, wendet dieses auf die "firstClass" Klasse an und liefert das Ergebnis daraus zurück. + * Das Standardverhalten dabei ist, alle Funktionen und Properties der "secondClass" Klasse, + * einschließlich der Funktionen und Properties in deren Superklassen zu nehmen und diese + * in der Zielklasse beim mixen zu dekorieren.
Methoden welche dekoriert werden, rufen + * automatisch die Methoden der sourceClass und der Zielklasse des Mixens, mit Hilfe des + * _mixing Properties, auf. Daher muss dies nicht selbst berücksichtigt werden. + *

Des Weiteren wird eine Standard-Initialisierungsmethode, welche die Initialisierungsmethode beider Klassen aufruft, hinzugefügt. + * Die Signatur für diese Standard-Initialisierungsmethode ist:
+ * ([firstClass Konstruktor Arg 1],...,[firstClass Konstruktor Arg n],[secondClass Konstruktor Arg 1],...[secondClass Konstruktor Arg n])

+ *

Beide Klassen werden nicht verändert.

Siehe auch: {@link enchant.Class.MixingRecipe} + * + * @param {Function} firstClass Die Klasse auf die das MixingRecipe angewendet wird. + * @param {Function} secondClass Die Klasse aus der das MixingRecipe erstellt wird. + * @param [boolean] onlyOwnProperties Wenn dieses Argument true ist, werden Funktionen und Properties der Superklassen der "secondClass" Klasse ignoriert. + * @param [Function] initializeMethod Falls gegeben, wird diese Methode, anstelle der Standard-Initialisierungsmethode, zum Initialisieren der resultierenden Klasse verwendet. + * @returns {Function} Die Klasse, welche das Ergebnis des Mixens beider Klassen darstellt. + [/lang] + * @example + * var MapGroup = enchant.Class.mixClasses(Map, Group,true); + * var map = new MapGroup(16, 16); + * var SpriteLabel = enchant.Class.mixClasses(Sprite, Label,true); + * var kumaLabel = new SpriteLabel(32,32,'Kuma'); + * @static + */ + enchant.Class.mixClasses = function(firstClass, secondClass, useOnlyOwnPropertiesForSecondClass, initializeMethod) { + return enchant.Class.mixClassesFromRecipe(firstClass,secondClass,enchant.Class.MixingRecipe.createFromClass(secondClass, useOnlyOwnPropertiesForSecondClass, [], ['initialize'], []),initializeMethod); + }; + + /** + [lang:ja] + * 設定されたMixingRecipeを先クラスに実行して、新たなクラスを生成してこのクラスを戻る. + * 先クラスが変更されない.
{@link enchant.Class.MixingRecipe} を参照してください. + * + * @param {Function} target MixingRecipeを実行される先クラス. + * @param {enchant.Class.MixingRecipe} source 先に新しい機能を追加するMixingRecipe. + * @returns {Function} sourceという製法とtargetというクラスを混ぜた結果クラス. + [/lang] + [lang:en] + * Applies the defined MixingRecipe to the target class creating a new class definition which is then returned. + * The target class is not modified directly.
See also: {@link enchant.Class.MixingRecipe}. + * + * @param {Function} target The class to which the recipe will be applied. + * @param {enchant.Class.MixingRecipe} source The MixingRecipe which is used to add new functionality to the target. + * @returns {Function} The class which is the result of mixing the target class with the source recipe. + [/lang] + [lang:de] + * Wendet das übergebene MixingRecipe auf die Zielklasse an, erstellt eine neue Klassendefinition und liefert diese als Rückgabewert zurück. + * Die Zielklasse wird nicht modifiziert.
Siehe auch: {@link enchant.Class.MixingRecipe}. + * + * @param {Function} target Die Klasse auf die das MixingRecipe angewendet wird. + * @param {enchant.Class.MixingRecipe} source Das MixingRecipe, welches genutzt wird um der Zielklasse neue Funktionalität zu verleihen. + * @returns {Function} Die Klasse, welche das Ergebnis des Mixens der Zielklasse (target) mit dem Rezept (source) darstellt. + [/lang] + * @example + * var recipe = new enchant.Class.MixingRecipe({ + * // ... see enchant.Class.MixingRecipe + * },{ + * // ... see enchant.Class.MixingRecipe + * },{ + * // ... see enchant.Class.MixingRecipe + * }); + * var NewClass = applyMixingRecipe(Class1,recipe); + * @static + */ + enchant.Class.applyMixingRecipe = function(target, source) { + var result = enchant.Class.create(target,{}); + target = result.prototype; + for(var recipeKey in source) { + if(source.hasOwnProperty(recipeKey)) { + var currentSource = source[recipeKey]; + if(recipeKey === 'overrideMethods') { + for(var methodKey in currentSource) { + if(currentSource.hasOwnProperty(methodKey)) { + target[methodKey] = currentSource[methodKey]; + if(target._mixing && target._mixing[methodKey]) { + target._mixing[methodKey] = voidFunction; + } + } + } + } else if(recipeKey === 'overrideProperties') { + for(var propertyKey in currentSource) { + if(currentSource.hasOwnProperty(propertyKey)) { + Object.defineProperty(target,propertyKey,currentSource[propertyKey]); + } + } + } else if(recipeKey === 'decorateMethods') { + if(!target._mixing) { + target._mixing = {}; + } + for(var key in currentSource) { + if(currentSource.hasOwnProperty(key)) { + var targetHolder = target; + if(!target[key]) { + while(targetHolder instanceof Object && !targetHolder[key]) { + targetHolder = Object.getPrototypeOf(targetHolder); + } + } + if(target._mixing[key]) { + var newFunc = targetHolder[key]; + target._mixing[key] = (multipleMixingCombinationFunctionFactory(target._mixing[key],newFunc,key)); + } else { + target._mixing[key] = targetHolder[key]; + if(!target._mixing[key]) { + target._mixing[key] = voidFunction; + } + } + target[key] = currentSource[key]; + } + } + } + } + } + return result; + }; + })(); +} diff --git a/net.js b/net.js new file mode 100644 index 0000000..675d1ed --- /dev/null +++ b/net.js @@ -0,0 +1,34 @@ +function Net(){ +} +Net.prototype.load = function(url){ + $.get("./index.html", function(data){ + // console.log(data); + // console.log("ff"); + }); + var data = null; + $.ajax({ + // type: 'GET', + url: url, + dataType: 'json', + async : false, + success : function(_data, _status){ + //通信が成功した場合の処理 (JSONPのコールバック関数はこれが呼ばれます) + // console.log("success"); + data = _data; + }, + error: function(data){ + // console.log("error"); + // console.log(data); + }, + complete : function(XMLHttpRequest, textStatus){ + // console.log("complete"); + //通信終了時の処理 + // console.log(XMLHttpRequest); + // console.log(textStatus); + if(textStatus != "success"){ + // throw "Bad json format"; + } + } + }); + return data; +}; diff --git a/siyou.txt b/siyou.txt new file mode 100644 index 0000000..70703e3 --- /dev/null +++ b/siyou.txt @@ -0,0 +1,92 @@ +▼概要 +越冬を目標としたゲームである。 +越冬には知力、体力、運、ゆっくり、スキルが必要 + + +▼基本アクション + +移動 +会話 +攻撃 +食事(むしゃむしゃタイム) +睡眠 +すっきり +狩り +うんうん + +▼日常パラメータ + +腹減り +睡眠 +ゆっくり +ストレス + +▼ステータス +知力 +体力 +器用さ + +▼スキル +スキルはレベルがあり1~5までになっている。 + +・けっかい +おうちを外敵から守るためのスキル。LVが高いほど効果が高い + +・狩り +良い食料を集めるためのスキル。LVがが高いほど良い食料を集められる。 + +・コーディネート(素材加工) +食料の運搬効率を上げる編み籠を作ったり、良いお家を作ったりする。 + +・うんうん運び。 +必要に応じてうんうんをトイレに運ぶ +▼知識 +・食べ物は腐る +・水に弱い +・赤、子ゆっくりは食料をたくさん食べる +・トイレの必要性 +・食料の蓄え + +▼個体のイベント +・お腹が空くとエサを探す +・他のゆっくりを見かけると挨拶をする + ゆっくり同士で好感度あり + +▼場のイベント +・雨 +・越冬 + + +▼シーン +・外 +・お家 + +▼命令 +移動の誘導 +エサを探す +お家を作る +待て +正解 GOOD +間違い BAD + + +▼シーン +初期: +お家宣言から始まる。 +お家はもとからある。 +お腹が空いてるのでエサを探しに行く。 +すぐ食べてしまう。その場でうんうんをしてしまう。 +うんうんが多くなると近づかなくなるので狩場が減ってしまう。 +一度餓死しそうになるとうんうんの近くで食事をする。 +その際にうんうんしそうになったらBADを行うとトイレの必要性を覚える + + +3日目で雨が振って狩りが出来ない日が出てくる。 +お腹が空いて死にそうになる。 +蓄えるということを覚える + +他のゆっくりを配置しないとゆっくり値が減少して寂しさで永遠にゆっくりしてしまう。 +そのため遠くに移動して番となるゆっくりを探さないといけない。 + + + -- 2.11.0