OSDN Git Service

update
[yukkurioverwint/YukkuriOverwinter.git] / main.js
diff --git a/main.js b/main.js
index 3dcd6f3..9da106e 100644 (file)
--- a/main.js
+++ b/main.js
@@ -26,20 +26,25 @@ var net = new Net();
 //////////////////////////////////////
 //define
 //////////////////////////////////////
+var ADD_HUNGRY = 1;
 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 FPS = 40;
+var FPS = 20;
 var BASE_FPS = 20;
 var HUNGRY_MAX = 100;
+var TIME_SPEED = 4;
 var MIN = BASE_FPS;
 var HOUR = MIN * 60;
 // var DAY = HOUR * 24;
 var DAY = HOUR ;
 var GAME_START_TIME = HOUR * 6;
+//48x48 best?
+var ICON_WIDTH = 48;
+var ICON_HEIGHT = 48;
 
 var EResPath = {
        YUKKURI_BASE : './data/yukkuri_base.png',
@@ -57,15 +62,36 @@ var EResPath = {
        MARISA_FACE_HAPPY2 : './data/marisa/face_happy2.png',
        MARISA_FACE_SLEEP : './data/marisa/face_sleep1.png',
        MARISA_HEAR : './data/marisa/hear1.png',
+       MARISA_OKAZARI : './data/marisa/okazari.png',
        OBJECT : './data/object.png',
        MAP0 : './data/map0.png',
        COMMAND : './data/command.png',
-       OKAZARI : './data/okazari.png',
        PLACE_TREE : './data/system/place_tree.png',
        GRASS : './data/system/grass.png',
        PLAYER_BADGE : './data/system/player_badge.png',
+       KUKI : './data/system/kuki.png',
        // PLACE_TREE : './data/system/rapture.png',
 };
+var EResPathReimu = {
+       getName: function(){
+               return "reimu";
+       },
+       FACE_NORMAL : './data/reimu/face_normal1.png',
+       FACE_TIRED : './data/reimu/face_tired1.png',
+       FACE_ANGRY : './data/reimu/face_angry1.png',
+       FACE_CRY1 : './data/reimu/face_cry1.png',
+       FACE_CRY2 : './data/reimu/face_cry2.png',
+       FACE_EAT1 : './data/reimu/face_eat1.png',
+       FACE_EAT2 : './data/reimu/face_eat2.png',
+       FACE_HAPPY1 : './data/reimu/face_happy1.png',
+       FACE_HAPPY2 : './data/reimu/face_happy2.png',
+       FACE_SLEEP : './data/reimu/face_sleep1.png',
+       HEAR : './data/reimu/hear1.png',
+       OKAZARI : './data/reimu/okazari.png',
+       SUB1 : './data/reimu/sub1.png',
+
+};
+
 var EFace = {
        NORMAL:0,
        TIRED:1,
@@ -88,6 +114,8 @@ var ECommand = {
        WORLD_TARGET: 1,
        WORLD_APPLE: 2,
        WORLD_PLACE: 3,
+       WORLD_REMOVE: 4,
+       WORLD_PICOPICO_HUMMER: 5,
 };
 
 var EMenuPos = {
@@ -96,6 +124,7 @@ var EMenuPos = {
        WIDTH : 200,
        HEIGHT : GAME_HEIGHT,
 };
+//width:200px;
 var EFieldPos = {
        X : 0,
        Y : 0,
@@ -131,6 +160,7 @@ var EAction = {
        MOVE_GOTO_HOME: 28,
        IN_HOME: 29,
        THINK_IN_HOME: 30,
+       EAT_IN_HOME: 31,
        NONE: 9999
 };
 var EDirection = {
@@ -156,6 +186,13 @@ var EMsg = {
        HUNT_ESCAPE: 15,
        YYUYYU: 16,
        MOVE_GOTO_HOME:17,
+       HUNTING_MESSAGE:18,
+       LEARN_NO_FOOD_IN_PLACE:19,
+       REMOVE_YUKKURI:20,
+       LOST_HOUSE:21,
+       MOVE_TO_HUNTING:22,
+       DAMAGE:23,
+
 };
 var EWalkAnimation = {
        START: 0,
@@ -166,6 +203,7 @@ var EGrow = {
        SUBADULT : 1,
        CHILD : 2,
        BABY : 3,
+       FRUIT_BABY : 4,
 };
 var EDate = {
        MORNING : 0,
@@ -186,18 +224,37 @@ var EFood = {
        NORMAL : 1,
        GREAT : 2
 };
+var EExSkill = {
+       NO_FOOD_IN_PLACE : 1,
+       KEKKAI : 2,
+};
+var EMemory = {
+       FOOD_IN_PLACE : 1,
+};
+var EDamage = {
+       PICOHAN : 1
+};
+var ELooks = {
+       GOOD_YUKKURI : 0,
+       NORMAL_YUKKURI : 1,
+       BAD_YUKKURI : 2,
+};
+var EAnimStatus = {
+       UP : 0,
+       DOWN : 1,
+};
+include("./lib/Animation.js"); 
+include("./lib/FormSprite.js"); 
+
+
 var ObjSprite = enchant.Class.create(enchant.Sprite,{
        initialize: function (w, h){
                enchant.Sprite.call(this, w, h);
                this.id = guid();
                ctl.addObj(this);
-
-
                                // // new BoxLabel(this.ctl,100, e.x, e.y);
                                // var box = new Box(this.ctl, 200, 200);
-
                                // box.text("テスト\naaaaaa\nfffffffff\nテスト\naaaaaa\nfffffffff\nテスト\naaaaaa\n", e.x, e.y);
-
        },
        getStatusForDisplay: function (){
                return "";
@@ -214,9 +271,20 @@ var ObjSprite = enchant.Class.create(enchant.Sprite,{
        getHeight: function(){
                return this.height;
        },
+       isWorld: function(){
+               return (this.id !== null && this.id !== undefined);
+       },
        removeAll: function(){
                this.remove();
                ctl.removeObj(this);
+               this.id = null;
+       },
+       undefineAll: function (){
+               for(var key in this){
+                       // if(this.hasOwnProperty(key)){
+                               delete this[key];
+                       // }
+               }
        }
 });
 
@@ -269,6 +337,51 @@ window.onload = function(){
                if(b instanceof Box){
                        return -1;
                }
+               var budgeValue = 10 + 28;
+               var shadowValue = -28;
+               //okazariは他のbodyと比べて11低い
+               var okazariValue = 37 + 11;
+               var okazariReimuValue = 32;
+               var bodyValue = 37;
+               var tweetValue = 188;
+
+               if(a.type == "shadow"){
+                       ay += shadowValue * a.scaleValue;
+               }
+               else if(a.type == "body" && a.classname == "Okazari" && a.spname == "reimu"){
+                       ay += okazariReimuValue * a.scaleValue - a.anim.cnt;
+               }
+               else if(a.type == "body"){
+                       ay += bodyValue * a.scaleValue - a.anim.cnt;
+               }
+               else if(a.type == "tweet"){
+                       ay += tweetValue * a.scaleValue;
+               }
+               else if(a.type == "budge"){
+                       ay += budgeValue * a.scaleValue - a.anim.cnt;
+               }
+
+               if(b.type == "shadow"){
+                       by += shadowValue * b.scaleValue;
+               }
+
+               else if(b.type == "body" && b.classname == "Okazari" && b.spname == "reimu"){
+                       by += okazariReimuValue * b.scaleValue - b.anim.cnt;
+               }
+               else if(b.type == "body" && b.classname == "Okazari"){
+                       by += okazariValue * b.scaleValue - b.anim.cnt;
+               }
+               else if(b.type == "body"){
+                       by += bodyValue * b.scaleValue - b.anim.cnt;
+               }
+               else if(b.type == "tweet"){
+                       by += tweetValue * b.scaleValue;
+               }
+               else if(b.type == "budge"){
+                       by += budgeValue * b.scaleValue - b.anim.cnt;
+               }
+
+
                if(a instanceof SpriteGroup){
                        ay = a.y;
                        ay += a.height/2;
@@ -284,9 +397,15 @@ window.onload = function(){
                if(b instanceof Place){
                        by += Math.round(b.height * 0.7);
                }
+               // if(a.flgMiYukkuri){
+               //      ay += CHARA_HEIGHT;
+               // }
+               // if(b.flgMiYukkuri){
+               //      by += CHARA_HEIGHT;
+               // }
 
-               if(ay < by)return -1;
-               else if(ay > by)return 1;
+               if(Math.round(ay) < Math.round(by))return -1;
+               else if(Math.round(ay) > Math.round(by))return 1;
                if(a.id < b.id)return -1;
                else if(a.id > b.id)return 1;
                return 0;
@@ -297,13 +416,24 @@ window.onload = function(){
        var def = new Object();
        var foodGroup = new Group();
        var SpriteGroup = enchant.Class.mixClasses(Sprite, Group,true);
+       SpriteGroup.prototype.classname = "";
        var menuBg = new SpriteGroup(EMenuPos.WIDTH, EMenuPos.HEIGHT);
        var fieldBg = new enchant.Sprite(EFieldPos.WIDTH, EFieldPos.HEIGHT);
        var windowFront = new enchant.Sprite(EFieldPos.WIDTH, EFieldPos.HEIGHT);
-       var game = new Game(GAME_WIDTH, GAME_HEIGHT);
+       game = new Game(GAME_WIDTH, GAME_HEIGHT);
        game.fps = FPS;
        var _loadArr = [];
        var i=0;
+       var tmpName = EResPathReimu.getName();
+       i=0;
+       for(var _v in EResPathReimu){
+               if(typeof EResPathReimu[_v] === "function")continue;
+               EResPath[_v + "_" + tmpName] = EResPathReimu[_v];
+               i++;
+       }
+       tmpName = null;
+
+       i=0;
        for(var _v in EResPath){
                _loadArr[i] = EResPath[_v];
                i++;
@@ -311,6 +441,7 @@ window.onload = function(){
        game.preload(_loadArr);
        var MapGroup = enchant.Class.mixClasses(Map, Group,true);
        var backgroundMap = new MapGroup(16, 16);
+       App.backgroundMap = backgroundMap;
        include("./class.js");
        include("./ctrl.js");
        ctl = new Ctrl();
@@ -339,16 +470,26 @@ window.onload = function(){
 
                },
                act : function(){
-
                        this.observe();
                        switch(this.status){
                                case EAction.WAIT:
-
+                                       this.waitCnt++;
+                                       if(this.waitCnt >= BASE_FPS * 60 * 24 * 3){
+                                               this.waitCnt = 0;
+                                               this.setStatus(EAction.THINK);
+                                               console.log("wait cnt end");
+                                       }
                                break;
                                case EAction.THINK_IN_HOME:
+                                       this.waitCnt = 0;
+                                       this.search();
                                        this.think_in_home();
                                break;
+                               case EAction.EAT_IN_HOME:
+                                       this.eat_in_home();
+                               break;
                                case EAction.THINK:
+                                       this.waitCnt = 0;
                                        if(this.yukkuri.age%2 === 0){
                                                this.yukkuri.changeFace();
                                                this.search();
@@ -392,8 +533,15 @@ window.onload = function(){
                                        this.communicate_start();
                                break;
                                case EAction.COMMUNICATE_WAIT:
-                               break;
                                case EAction.COMMUNICATE_RECV:
+                               if(this.yukkuri.communicateYukkuri != null){
+                                       var _s = this.yukkuri.communicateYukkuri.action.getStatus();
+                                       if(this.yukkuri.communicateYukkuri.isDead()
+                                               || (_s !== EAction.COMMUNICATE_START && _s !== EAction.COMMUNICATE_WAIT && _s !== EAction.COMMUNICATE_RECV)){
+                                               this.setStatus(EAction.THINK);
+                                               this.yukkuri.animation();
+                                       }
+                               }
                                break;
                                case EAction.MOVE_TO_PLACE_START_HOMELESS:
                                        this.move_to_place_start_homeless();
@@ -417,52 +565,63 @@ window.onload = function(){
                        }
                        this.yukkuri.reverse();
                },
-               thinkHavePlace: function(){
-                       var date = ctl.getDate();
-                       if(this.yukkuri.isPlaceRange()){
-                       }else{
-                               //ゆっくりプレイスの範囲外
-                               if(date === EDate.EVENING
-                                       || date === EDate.NIGHT
-                                       || date === EDate.MIDNIGHT
-                                       ){
-                                       this.setStatus(EAction.MOVE_GOTO_HOME);
-                                       return;
-                               }
-                               else if(date === EDate.EVENING){
-                                       // if(this.yukkuri.isItemsMax()){
-                                       //      this.setStatus(EAction.IN_HOME);
-                                       // }
-                                       // else{
-                                       //      this.setStatus(EAction.MOVE_TO_HUNT_START);
-                                       // }
-                               }
-                       }
-                       if(this.yukkuri.isVeryKuhuku()){
-                               //食べ物探したい
-                               //なかったら
-                               this.setStatus(EAction.MOVE_GOTO_HOME);
-                       }
-                       else if(this.yukkuri.isSleep()){
-                               this.setStatus(EAction.SLEEP_START);
-                       }
-                       else if(this.yukkuri.getUnun() >= 80){
-                               this.setStatus(EAction.UNUN_START);
-                       }
-                       else{
-                               this.yukkuri.changeFace();
-                               this.search();
-                       }
-               },
+               // thinkHavePlace: function(){
+               //      var date = ctl.getDate();
+               //      if(this.yukkuri.isPlaceRange()){
+               //      }else{
+               //              //ゆっくりプレイスの範囲外
+               //              if(date === EDate.EVENING
+               //                      || date === EDate.NIGHT
+               //                      || date === EDate.MIDNIGHT
+               //                      ){
+               //                      this.setStatus(EAction.MOVE_GOTO_HOME);
+               //                      return;
+               //              }
+               //              else if(date === EDate.EVENING){
+               //                      // if(this.yukkuri.isItemsMax()){
+               //                      //      this.setStatus(EAction.IN_HOME);
+               //                      // }
+               //                      // else{
+               //                      //      this.setStatus(EAction.MOVE_TO_HUNT_START);
+               //                      // }
+               //              }
+               //      }
+               //      if(this.yukkuri.isVeryKuhuku()){
+               //              //食べ物探したい
+
+               //              //なかったら
+               //              this.setStatus(EAction.MOVE_GOTO_HOME);
+               //      }
+               //      else if(this.yukkuri.isSleep()){
+               //              this.setStatus(EAction.SLEEP_START);
+               //      }
+               //      else if(this.yukkuri.getUnun() >= 80){
+               //              this.setStatus(EAction.UNUN_START);
+               //      }
+               //      else{
+               //              this.yukkuri.changeFace();
+               //              this.search();
+               //      }
+               // },
                think_in_home: function(){
                        var date = ctl.getDate();
-                       if((date === EDate.MIDNIGHT || date === EDate.NIGHT)
-                               && !this.yukkuri.isSleep()){
-                               //sleep
+                       if((date === EDate.MIDNIGHT)
+                               && !this.yukkuri.isSleep()
+                               && !this.yukkuri.isVeryKuhuku()
+                               ){
+                               new SleepEvent({
+                                       "action": this,
+                                       "nextStatus":EAction.THINK_IN_HOME,
+                                       "myYukkuri": this.yukkuri
+                               });
+                               return;
                        }
                        else if(date === EDate.EVENING){
                                //QK
                        }
+                       else if(this.yukkuri.isVeryKuhuku() && this.yukkuri.getPlace().isFood()){
+                               this.setStatus(EAction.EAT_IN_HOME);
+                       }
                        else{
                                //marisa is hunting move
                                if(this.yukkuri.beforeHuntingFood !== null){
@@ -478,6 +637,13 @@ window.onload = function(){
                                }
                        }
                },
+               eat_in_home: function(){
+                       new EatInHomeEvent({
+                               "targetNode": this.yukkuri.getPlace(),
+                               "action": this,
+                               "myYukkuri": this.yukkuri
+                       });
+               },
                move_to_eat_start : function(){
                        new MoveToEatEvent({
                                "type": 'food',
@@ -496,7 +662,8 @@ window.onload = function(){
                                console.log("retryCount over");
                                return;
                        }
-                       if(this.yukkuri.imgGroup.tl.queue.length === 0){
+                       if(this.yukkuri.formSprite.tlQueueLength() === 0){
+                       // if(this.yukkuri.imgGroup.tl.queue.length === 0){
                                var frame = 200;
                                frame += plusFrameScale(frame, this.yukkuri.getMyScale());
                                if(this.isMoving){
@@ -507,7 +674,12 @@ window.onload = function(){
                                }else{
                                        var xpos = 150 + rand(40) - (retryCounter * 10);
                                        var ypos = 150 + rand(40) - (retryCounter * 10);
-                                       if(rand(8) === 0){
+                                       if(false){
+                                               this.yukkuri.vx = xpos;
+                                               this.yukkuri.vy = ypos;
+                                               this.yukkuri.direction = EDirection.RIGHT;
+                                       }
+                                       else if(rand(8) === 0){
                                                this.yukkuri.vx = 0;
                                                this.yukkuri.vy = -ypos;
                                        }
@@ -549,10 +721,10 @@ window.onload = function(){
                                                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;
+                                               var x = this.yukkuri.getX() + this.yukkuri.vx;
+                                               var y = this.yukkuri.getY() + this.yukkuri.vy + this.yukkuri.getHeight() / 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("あたってないよ:"+ this.yukkuri.getX() + ":" + this.yukkuri.getY());
                                                        // console.log("X:" + this.yukkuri.moveX);
                                                        // console.log("Y:" + this.yukkuri.moveY);
                                                        this.isMoving = true;
@@ -562,7 +734,7 @@ window.onload = function(){
                                                        //うんうんくさい対策
                                                        this.targetNode = null;
                                                }else{
-                                                       // console.log("HIT:"+ this.yukkuri.imgGroup.x + ":" + this.yukkuri.imgGroup.y);
+                                                       // console.log("HIT:"+ this.yukkuri.getX() + ":" + this.yukkuri.getY() + "," + this.yukkuri.vx + ":" + this.yukkuri.vy);
                                                        this.walk(retryCounter+1);
                                                }
                                        }
@@ -650,14 +822,33 @@ window.onload = function(){
                },
                in_home:function(){
                        var place = this.yukkuri.getPlace();
-                       new InHomeEvent({
-                               "type": 'hunt_end',
-                               "targetNode": place,
+                       if(place != null && place.isWorld()){
+                               new InHomeEvent({
+                                       "type": 'hunt_end',
+                                       "targetNode": place,
+                                       "action": this,
+                                       "myYukkuri": this.yukkuri
+                               });
+                       }else{
+                               if(place && !place.isWorld())place.undefineAll();
+                               this.yukkuri.declarePlace(null);
+                               this.setStatus(EAction.WAIT);
+                               mangMsg.output(this.yukkuri, EMsg.LOST_HOUSE);
+                               this.yukkuri.setFaceImage(EFace.CRY2);
+                               new WaitEvent({
+                                       "waitframe": FPS * 3.0,
+                                       "action": this,
+                                       "myYukkuri": this.yukkuri
+                               });
+                       }
+               },
+               move_to_command: function(){
+                       var obj = this.yukkuri.searchObjectMang.currentCmdObject;
+                       new MoveToCommandEvent({
                                "action": this,
+                               "cmdObject": obj,
                                "myYukkuri": this.yukkuri
                        });
-               },
-               move_to_command: function(){
 
                },
                search: function(){
@@ -665,9 +856,9 @@ window.onload = function(){
                        var nodes = ctl.getObjs();
                        l = nodes.length;
                        var ununFlg = false;
-
                        for (var key in nodes) {
                                var node = nodes[key];
+                               if(node === null || node === undefined)continue;
                                if(this.yukkuri.id === node.id)continue;
                                //うんうん臭いを検索
                                if (
@@ -685,12 +876,14 @@ window.onload = function(){
                                }
                                //ゆっくりを検索
                                else if(node instanceof Yukkuri){
-                                       if(this.yukkuri.within(node, this.yukkuri.getRange())){
+                                       if(node.grow != EGrow.FRUIT_BABY && this.yukkuri.within(node, this.yukkuri.getRange())){
                                                this.yukkuri.addSearchObject(ESearch.YUKKURI, node);
                                        }
                                }
                                //ゆっくりプレイスを検索
                                else if(node instanceof Place){
+                                       if(this.yukkuri instanceof Player){
+                                       }
                                        if(this.yukkuri.within(node, this.yukkuri.getRange())){
                                                this.yukkuri.addSearchObject(ESearch.PLACE, node);
                                        }
@@ -708,6 +901,7 @@ window.onload = function(){
        var SearchObjectMang = enchant.Class.create({
                initialize: function (){
                        this.init();
+                       this.currentCmdObject = null;
                },
                init:function(){
                        this.datas = [];
@@ -745,21 +939,29 @@ window.onload = function(){
                        return ret;
                },
                callEvent: function(yukkuri){
-                       ununs = this.get(ESearch.UNUN);
-                       if(ununs.length !== 0){
+                       if(yukkuri.cmdQueue.length !== 0){
+                               this.currentCmdObject = yukkuri.cmdQueue.shift();
+                               yukkuri.action.setStatus(EAction.MOVE_TO_COMMAND);
+                               return;
+                       }
+                       if(yukkuri.isSleep()){
+                               yukkuri.action.setStatus(EAction.SLEEP_START);
+                               return;
+                       }
+                       else if(yukkuri.getUnun() >= 80){
+                               yukkuri.action.setStatus(EAction.UNUN_START);
+                               return;
+                       }
+
+                       if(yukkuri.isItemsMax() && yukkuri.isPlace()){
                                yukkuri.action.targetNode = yukkuri.getPlace();
-                               yukkuri.action.setStatus(EAction.UNUN_SMELL_START);
+                               yukkuri.action.setStatus(EAction.MOVE_GOTO_HOME);
                                return;
                        }
                        if(yukkuri.isVeryKuhuku()){
                                //エサを探す
                                var foods = this.get(ESearch.FOOD);
-                               if(foods.length === 0 && yukkuri.isPlace()){
-                                       //家があるなら家に帰宅
-                                       yukkuri.action.targetNode = yukkuri.getPlace();
-                                       yukkuri.action.setStatus(EAction.MOVE_GOTO_HOME);
-                                       return;
-                               }else{
+                               if(foods.length > 0){
                                        var foods = this.get(ESearch.FOOD);
                                        food = this.getNear(ESearch.FOOD, yukkuri);
                                        if(food !== null){
@@ -768,20 +970,25 @@ window.onload = function(){
                                                return;
                                        }
                                }
-                       }
+                               if(yukkuri.getMemory(EMemory.FOOD_IN_PLACE) === 0 && yukkuri.getExSkill(EExSkill.NO_FOOD_IN_PLACE) >= 1){
+                                       yukkuri.action.setStatus(EAction.WALK);
+                                       return;
+                               }
 
-                       if(yukkuri.isSleep()){
-                               yukkuri.action.setStatus(EAction.SLEEP_START);
+                               //家があるなら家に帰宅
+                               if(foods.length === 0 && yukkuri.isPlace() && yukkuri.getPlace().isFood()){
+                                       yukkuri.action.targetNode = yukkuri.getPlace();
+                                       yukkuri.action.setStatus(EAction.MOVE_GOTO_HOME);
+                                       return;
+                               }
+                               //たべものを探しに行く
+                               yukkuri.action.setStatus(EAction.WALK);
                                return;
                        }
 
-                       else if(yukkuri.getUnun() >= 80){
-                               yukkuri.action.setStatus(EAction.UNUN_START);
-                               return;
-                       }
 
 
-                       if(!yukkuri.isItemsMax()){
+                       if(!yukkuri.isItemsMax() && yukkuri.isPlace()){
                                food = this.getNear(ESearch.FOOD, yukkuri);
                                if(food !== null){
                                        yukkuri.action.targetNode = food;
@@ -789,14 +996,21 @@ window.onload = function(){
                                        return;
                                }
                        }
-                       var searchYukkuri = this.getNear(ESearch.YUKKURI);
+                       ununs = this.get(ESearch.UNUN);
+                       if(ununs.length !== 0){
+                               yukkuri.action.targetNode = yukkuri.getPlace();
+                               yukkuri.action.setStatus(EAction.UNUN_SMELL_START);
+                               return;
+                       }
+                       var searchYukkuri = this.getNear(ESearch.YUKKURI, yukkuri);
                        if(searchYukkuri !== null && yukkuri.isCommunication(searchYukkuri)){
+                               yukkuri.action.targetNode = searchYukkuri;
                                yukkuri.action.setStatus(EAction.COMMUNICATE_START);
                                return;
                        }
                        if(!yukkuri.isPlace()){
                                var searchYukkuri = this.getNear(ESearch.PLACE, yukkuri);
-                               if(!searchYukkuri.isOwner()){
+                               if(searchYukkuri != null && !searchYukkuri.isOwner()){
                                        yukkuri.action.targetNode = searchYukkuri;
                                        yukkuri.action.setStatus(EAction.MOVE_TO_PLACE_START_HOMELESS);
                                        return;
@@ -812,9 +1026,10 @@ window.onload = function(){
                        this.guid = guid();
                },
                onactionstart:function(self){
-                       return function(e){
-                               if(typeof e === "undefined")return;
-                       };
+                       return this._onactionstart;
+               },
+               _onactionstart:function(e){
+                       if(typeof e === "undefined")return;
                },
                onactiontick:function(self){
                        return function(e){
@@ -869,7 +1084,11 @@ window.onload = function(){
                                        yukkuri.setFaceImage(EFace.NORMAL);
                                        yukkuri.tlResume();
                                        // self.action.setStatus(EAction.WAIT);
-                                       self.action.setStatus(EAction.THINK);
+                                       if(self.data.nextStatus !== undefined){
+                                               self.action.setStatus(self.data.nextStatus);
+                                       }else{
+                                               self.action.setStatus(EAction.THINK);
+                                       }
                                }
                        });
                }
@@ -952,7 +1171,6 @@ window.onload = function(){
                        this.action = _data.action;
                        this.action.setStatus(EAction.EAT_WAIT);
 
-
                        var sec = BASE_FPS * 3;
                        if(this.yukkuri.eat(this.food)){
                                mangMsg.output(this.yukkuri, EMsg.EAT);
@@ -969,7 +1187,7 @@ window.onload = function(){
                onactionend:function(self){
                        return function(e){
                                if(typeof e === "undefined")return;
-                               if(self.food.getAmount() <= 0 || self.yukkuri.isManpuku()){
+                               if(self.food == null || self.food.getAmount() <= 0 || self.yukkuri.isManpuku() || !self.food.isWorld()){
                                        self.action.setStatus(EAction.THINK);
                                        self.yukkuri.setFaceImage(EFace.NORMAL);
                                }else{
@@ -998,27 +1216,21 @@ window.onload = function(){
                        //food distance
                        if(this.data.type == "food"){
                                this.action.status = EAction.MOVE_TO_EAT_UNDERWAY;
-                               yukkuri.vx = node.x - yukkuri.getX() + node.width / 2;
-                               yukkuri.vy = node.y - yukkuri.getY() - yukkuri.getHeight() / 2 + node.height / 2;
+                               yukkuri.vx = node.x - yukkuri.getX() + node.width / 2 + yukkuri.getWidth() / 2;
+                               yukkuri.vy = node.y - yukkuri.getY() - yukkuri.getHeight() / 2 + node.height / 2 + yukkuri.getHeight() / 2;
                                var distance = (Math.abs(yukkuri.vx) + Math.abs(yukkuri.vy)) / 2;
                                var frame = distance + distance/5 + 1;
                                frame += plusFrameScale(frame, this.yukkuri.getMyScale());
                                yukkuri.direction = yukkuri.vx > 0 ? EDirection.RIGHT : EDirection.LEFT;
                                yukkuri.reverse();
+                               mangMsg.output(yukkuri, EMsg.TARGETING_EAT);
 
                                yukkuri.moveBy(yukkuri.vx, yukkuri.vy, frame, {
-                                       "onactionstart": this.onactionstart(this),
                                        "onactiontick": this.onactiontick(this),
                                        "onactionend": this.onactionend(this)
                                });
                        }
                },
-               onactionstart:function(self){
-                       return function(e){
-                               if(typeof e === "undefined")return;
-                               mangMsg.output(self.yukkuri, EMsg.TARGETING_EAT);
-                       };
-               },
                onactiontick:function(self){
                        return function(e){
                                if(typeof e === "undefined")return;
@@ -1048,14 +1260,14 @@ window.onload = function(){
                        //food distance
                        if(this.data.type == "food"){
                                this.action.setStatus(EAction.WAIT);
-                               yukkuri.vx = nodeX - yukkuri.getX() + nodeWidth / 2;
-                               yukkuri.vy = nodeY - yukkuri.getY() - yukkuri.getHeight() / 2 + nodeHeight / 2;
+                               yukkuri.vx = nodeX - yukkuri.getX() + yukkuri.getWidth() / 2;
+                               yukkuri.vy = nodeY - yukkuri.getY() - yukkuri.getHeight() / 2 + nodeHeight / 2 + yukkuri.getHeight() / 2;
                                var distance = (Math.abs(yukkuri.vx) + Math.abs(yukkuri.vy)) / 2;
                                var frame = distance + distance/5 + 1;
                                frame += plusFrameScale(frame, this.yukkuri.getMyScale());
                                yukkuri.direction = yukkuri.vx > 0 ? EDirection.RIGHT : EDirection.LEFT;
                                yukkuri.reverse();
-                               mangMsg.output(yukkuri, EMsg.TARGETING_EAT);
+                               mangMsg.output(yukkuri, EMsg.MOVE_TO_HUNTING);
 
                                yukkuri.moveBy(yukkuri.vx, yukkuri.vy, frame, {
                                        "onactionend": this.onactionend(this)
@@ -1080,22 +1292,34 @@ window.onload = function(){
                        this.action.setStatus(EAction.WAIT);
                        this.huntingStatus = "hunting";
                        this.tick = 0;
-                       this.yukkuri.beforeHuntingFood = this.food;
-                       var sec = BASE_FPS * 8;
-                       if(this.yukkuri.hunt(this.food)){
-                               this.huntingStatus = "hunting";
-                               mangMsg.output(this.yukkuri, EMsg.HUNT);
-                               this.yukkuri.setFaceImage(EFace.HAPPY1);
-                       }else{
-                               if(this.yukkuri.isItemsMax()){
-                                       this.huntingStatus = "return";
-                                       mangMsg.output(this.yukkuri, EMsg.REHUNT);
-                                       this.yukkuri.setFaceImage(EFace.NORMAL);
+                       // this.yukkuri.beforeHuntingFood = this.food;
+                       if(this.food.isWorld()){
+                               this.yukkuri.beforeHuntingFood = new MemoryFood(this.food);
+                               var sec = BASE_FPS * 8;
+                               if(this.yukkuri.hunt(this.food)){
+                                       this.huntingStatus = "hunting";
+                                       mangMsg.output(this.yukkuri, EMsg.HUNTING_MESSAGE);
+                                       this.yukkuri.setFaceImage(EFace.HAPPY1);
                                }else{
-                                       this.huntingStatus = "cry";
-                                       mangMsg.output(this.yukkuri, EMsg.EAT_FAILED);
-                                       this.yukkuri.setFaceImage(EFace.CRY2);
+                                       if(this.yukkuri.isItemsMax()){
+                                               sec = 1;
+                                               this.huntingStatus = "return";
+                                               // mangMsg.output(this.yukkuri, EMsg.REHUNT);
+                                               this.yukkuri.setFaceImage(EFace.NORMAL);
+                                       }else{
+                                               sec = BASE_FPS * 3;
+                                               this.huntingStatus = "cry";
+                                               mangMsg.output(this.yukkuri, EMsg.EAT_FAILED);
+                                               this.yukkuri.setFaceImage(EFace.CRY2);
+                                       }
                                }
+
+                       }else{
+                               this.yukkuri.beforeHuntingFood = null;
+                               sec = BASE_FPS * 3;
+                               this.huntingStatus = "cry";
+                               mangMsg.output(this.yukkuri, EMsg.EAT_FAILED);
+                               this.yukkuri.setFaceImage(EFace.CRY2);
                        }
 
                        this.yukkuri.wait(sec, {
@@ -1107,9 +1331,10 @@ window.onload = function(){
                        return function(e){
                                if(typeof e === "undefined")return;
                                self.tick++;
-                               if(self.huntingStatus == "hunting" && self.tick > BASE_FPS * 2){
-                                       if(this.age%(BASE_FPS * 3) == 0){
-                                               mangMsg.output(self.yukkuri, EMsg.YYUYYU)
+                               if(self.huntingStatus == "hunting" && self.tick > BASE_FPS * 1){
+                                       if(this.age%(BASE_FPS * 5) == 0){
+                                               // mangMsg.output(self.yukkuri, EMsg.YYUYYU)
+                                               mangMsg.output(self.yukkuri, EMsg.HUNTING_MESSAGE);
                                        }
                                }
                        };
@@ -1120,18 +1345,26 @@ window.onload = function(){
                                if(self.huntingStatus == "hunting"){
                                        if(self.yukkuri.isItemsMax()){
                                                self.action.setStatus(EAction.MOVE_GOTO_HOME);
-                                               mangMsg.output(self.yukkuri, EMsg.MOVE_GOTO_HOME);
+                                               // mangMsg.output(self.yukkuri, EMsg.MOVE_GOTO_HOME);
                                        }else{
                                                self.action.setStatus(EAction.HUNT_START);
                                        }
                                }
                                else if(self.huntingStatus == "return"){
-                                       self.action.setStatus(EAction.THINK);
+                                       self.action.setStatus(EAction.MOVE_GOTO_HOME);
                                }
                                else if(self.huntingStatus === "cry"){
-                                       self.action.setStatus(EAction.THINK);
+                                       // self.action.setStatus(EAction.THINK);
+                                       self.action.setStatus(EAction.WALK);
                                }
+                               self.release();
                        };
+               },
+               release:function(){
+                       this.action = null;
+                       this.yukkuri = null;
+                       this.food = null;
+                       this.data = null;
                }
        });
        var MoveGotoHomeEvent = enchant.Class.create(Event,{
@@ -1172,7 +1405,13 @@ window.onload = function(){
                        return function(e){
                                if(typeof e === "undefined")return;
                                self.action.setStatus(EAction.IN_HOME);
+                               self.release();
                        };
+               },
+               release:function(){
+                       this.action = null;
+                       this.yukkuri = null;
+                       this.data = null;
                }
        });
        var InHomeEvent = enchant.Class.create(Event,{
@@ -1183,16 +1422,24 @@ window.onload = function(){
 
                        var yukkuri = this.yukkuri;
                        var place = this.data.targetNode;
+
                        if(yukkuri.isVeryKuhuku()){
                                if(place.isFood()){
-                                       new EatInHomeEvent({
-                                               "targetNode": place,
-                                               "action": this.action,
-                                               "myYukkuri": yukkuri
-                                       });
+                                       yukkuri.setMemory(EMemory.FOOD_IN_PLACE, 1);
+                                       this.action.setStatus(EAction.EAT_IN_HOME);
                                        return;
                                }else{
-                                       mangMsg.output(self.yukkuri, EMsg.EAT_FAILED);
+                                       yukkuri.setMemory(EMemory.FOOD_IN_PLACE, 0);
+                                       //experience skill
+                                       if(yukkuri.getExSkill(EExSkill.NO_FOOD_IN_PLACE) >= 1){
+                                               mangMsg.output(yukkuri, EMsg.LEARN_NO_FOOD_IN_PLACE);
+                                               this.action.setStatus(EAction.THINK);
+                                               return;
+                                       }else{
+                                               mangMsg.output(yukkuri, EMsg.EAT_FAILED);
+                                               yukkuri.addExValue(EExSkill.NO_FOOD_IN_PLACE, 50);
+                                       }
+
                                }
                        }
                        this.action.setStatus(EAction.WAIT);
@@ -1203,6 +1450,7 @@ window.onload = function(){
 
                        }
                        var sec = BASE_FPS * 10;
+                       if(place.isFood())yukkuri.setMemory(EMemory.FOOD_IN_PLACE, 1);
                        this.yukkuri.wait(sec, {
                                "onactiontick": this.onactiontick(this),
                                "onactionend": this.onactionend(this)
@@ -1219,7 +1467,7 @@ window.onload = function(){
                onactionend:function(self){
                        return function(e){
                                if(typeof e === "undefined")return;
-                               self.action.setStatus(EAction.THINK);
+                               self.action.setStatus(EAction.THINK_IN_HOME);
                        };
                }
        });
@@ -1249,49 +1497,48 @@ window.onload = function(){
                onactionend:function(self){
                        return function(e){
                                if(typeof e === "undefined")return;
-                               if(self.place.isFood() && self.yukkuri.isManpuku()){
-
-                                       self.action.setStatus(EAction.THINK);
-                                       self.yukkuri.setFaceImage(EFace.NORMAL);
+                               if(self.place.isFood() && !self.yukkuri.isManpuku()){
+                                       self.action.setStatus(EAction.EAT_IN_HOME);
+
+                                       // new EatInHomeEvent({
+                                       //      "targetNode": self.place,
+                                       //      "action": self.action,
+                                       //      "myYukkuri": self.yukkuri
+                                       // });
                                }else{
-                                       new EatInHomeEvent({
-                                               "targetNode": self.place,
-                                               "action": self.action,
-                                               "myYukkuri": self.yukkuri
-                                       });
+                                       self.action.setStatus(EAction.THINK_IN_HOME);
+                                       self.yukkuri.setFaceImage(EFace.NORMAL);
                                }
                        };
                }
        });
 
 
-       var MoveCommandEvent = enchant.Class.create(Event,{
+       var MoveToCommandEvent = enchant.Class.create(Event,{
                initialize: function (_data){
                        this.data = _data;
                        this.yukkuri = this.data.myYukkuri;
                        this.action = this.data.action;
-                       this.vx = this.data.vx;
-                       this.vy = this.data.vy;
+                       // this.vx = this.data.cmdObject.vx;
+                       // this.vy = this.data.cmdObject.vy;
+                       // var vx = (-backgroundMap.x + e.x) - this.ctl.player.getX() ;
+
 
                        var yukkuri = this.yukkuri;
-                       this.action.status = EAction.MOVE_TO_EAT_UNDERWAY;
-                       yukkuri.vx = node.x - yukkuri.getX();
-                       yukkuri.vy = node.y - yukkuri.getY();
+                       this.action.status = EAction.WAIT;
+                       yukkuri.vx = this.data.cmdObject.touchX - this.yukkuri.getX();
+                       yukkuri.vy = this.data.cmdObject.touchY - this.yukkuri.getY();
                        var distance = (Math.abs(yukkuri.vx) + Math.abs(yukkuri.vy)) / 2;
-                       var frame = distance + 1;
+                       var frame = distance + distance/2 + 1;
                        frame += plusFrameScale(frame, this.yukkuri.getMyScale());
 
+                       yukkuri.direction = yukkuri.vx > 0 ? EDirection.RIGHT : EDirection.LEFT;
+
                        yukkuri.moveBy(yukkuri.vx, yukkuri.vy, frame, {
-                               "onactionstart": this.onactionstart(this),
                                "onactiontick": this.onactiontick(this),
                                "onactionend": this.onactionend(this)
                        });
                },
-               onactionstart:function(self){
-                       return function(e){
-                               if(typeof e === "undefined")return;
-                       };
-               },
                onactiontick:function(self){
                        return function(e){
                                if(typeof e === "undefined")return;
@@ -1314,11 +1561,15 @@ window.onload = function(){
                        this.targetYukkuri = _data.targetNode;
                        this.action = _data.action;
                        this.action.setStatus(EAction.COMMUNICATE_WAIT);
-
+                       // this.targetYukkuri.action.setStatus(EAction.COMMUNICATE_RECV);
+                       // this.targetYukkuri.tlPause();
                        mangMsg.output(this.yukkuri, EMsg.SAY_HELLO, this.targetYukkuri);
+                       this.yukkuri.send(this.targetYukkuri, {
+                               "actionStatus":EAction.COMMUNICATE_RECV,
+                               "yukkuri":this.yukkuri
+                       });
+
 
-                       this.targetYukkuri.action.setStatus(EAction.COMMUNICATE_RECV);
-                       this.targetYukkuri.tlPause();
                        this.yukkuri.tlPause();
                        this.yukkuri.syncDirection(this.targetYukkuri);
 
@@ -1399,7 +1650,6 @@ window.onload = function(){
 
                        yukkuri.direction = yukkuri.vx > 0 ? EDirection.RIGHT : EDirection.LEFT;
                        yukkuri.reverse();
-
                        yukkuri.moveBy(yukkuri.vx, yukkuri.vy, frame, {
                                "onactionend": this.onactionend(this)
                        });
@@ -1474,6 +1724,41 @@ window.onload = function(){
                        return this.give;
                }
        });
+       var MemoryPlace = enchant.Class.create({
+               // initialize: function (place){
+               //      if(place.x != null){
+               //              this.isWorld = true;
+               //      }else{
+               //              this.isWorld = false;
+               //      }
+               //      this.isWorld = (place.x != null);
+               //      this.x = place.x;
+               //      this.y = place.y;
+               //      this.width = place.width;
+               //      this.height = place.height;
+               // },
+               // isWorld: function(){
+               //      return this.isWorld;
+               // }
+
+       });
+       var MemoryFood = enchant.Class.create({
+               initialize: function (food){
+                       if(food.x != null){
+                               this.isWorld = true;
+                       }else{
+                               this.isWorld = false;
+                       }
+                       this.isWorld = (food.x != null);
+                       this.x = food.x;
+                       this.y = food.y;
+                       this.width = food.width;
+                       this.height = food.height;
+               },
+               isWorld: function(){
+                       return this.isWorld;
+               }
+       });
        var Place = enchant.Class.create(ObjSprite,{
                initialize: function (type, x, y){
                        ObjSprite.call(this,128,128);
@@ -1565,7 +1850,8 @@ window.onload = function(){
                        this.x = x;
                        this.y = y;
                        backgroundMap.addChild(this);
-                       this.lifetime = 60 * 24 * 3;
+                       // this.lifetime = 30 * 24 * 3;
+                       this.lifetime = 15 * 24;
                        this.addEventListener('enterframe', this.runEnterframe(this));
                        // game.rootScene.addEventListener('enterframe', this.runEnterframe(this));
 
@@ -1585,18 +1871,52 @@ window.onload = function(){
 
                        };
                }
-               // runEnterframe: function(){
-               //      console.log("enterframe:" + this.id);
-               // }
        });
        var Okazari = enchant.Class.create(enchant.Sprite,{
                initialize: function(yukkuri){
                        this.classname = "Okazari";
-                       enchant.Sprite.call(this, 64, 64);
-                       this.image = game.assets[EResPath.OKAZARI];
+                       if(yukkuri.myCode === "REIMU"){
+                               enchant.Sprite.call(this, 80, 32);
+                               this.image = game.assets[EResPathReimu.OKAZARI];
+                               this.x = -CHARA_WIDTH / 3 * 2;
+                               this.y = -yukkuri.getHeight()/5 * 2 - 4;
+                       }else{
+                               enchant.Sprite.call(this, 64, 64);
+                               this.image = game.assets[EResPath.MARISA_OKAZARI];
+                               this.x = -CHARA_WIDTH / 2;
+                               this.y = -CHARA_HEIGHT / 2 - yukkuri.getHeight()/6;
+                       }
                        this.yukkuri = yukkuri;
-                       this.x = -CHARA_WIDTH / 2;
-                       this.y = -CHARA_HEIGHT / 2 - yukkuri.getWidth()/6;
+               },
+               getWidth: function(){
+                       return this.width;
+                       // return this.width * this.yukkuri.myScaleX;
+               },
+               getHeight: function(){
+                       return this.height;
+                       // return this.height * this.yukkuri.myScaleY;
+               }
+       });
+       var Kuki = enchant.Class.create(ObjSprite,{
+               initialize: function(yukkuri, x, y){
+                       this.classname = "Kuki";
+                       enchant.Sprite.call(this, 56, 40);
+                       this.image = game.assets[EResPath.KUKI];
+                       this.x = 0 + x;
+                       this.y = -CHARA_HEIGHT / 2 -CHARA_HEIGHT / 4 + y;
+                       this.owner = yukkuri;
+                       this.miYukkuris = [];
+               },
+               addMiYukkuri: function(miYukkuri){
+                       miYukkuri.setX(miYukkuri.getX() + 30);
+                       miYukkuri.setY(miYukkuri.getY() - 30);
+                       this.miYukkuris.push(miYukkuri);
+               },
+               getX : function(){
+                       return this.x;
+               },
+               getY : function(){
+                       return this.y;
                },
                getWidth: function(){
                        return this.width;
@@ -1632,6 +1952,8 @@ window.onload = function(){
                        ObjSprite.call(this, 64, 64);
                        this.searchObjectMang = new SearchObjectMang();
                        this.grow = grow;
+                       //base plyaer only
+                       this.cmdQueue = [];
                        this.myCode = "YUKKURI";
                        this.myName = "ゆっくり";
                        this.beforeHuntingFood = null;
@@ -1655,14 +1977,19 @@ window.onload = function(){
                                this.myScaleY = 0.3;
                                this.mySize = "SS";
                        }
+                       else if(grow == EGrow.FRUIT_BABY){
+                               this.myScaleX = 0.2;
+                               this.myScaleY = 0.2;
+                               this.mySize = "SSS";
+                       }
 
                        // ctl.game.rootScene.addEventListener('touchstart', this.touchstart);
                        this.classname = "Yukkuri";
                        this.addressBook = {};
-                       this.imgGroup = new SpriteGroup();
-                       this.imgBody = new SpriteGroup();
-                       this.imgGroup.id = guid();
-                       this.imgBody.id = guid();
+                       // this.imgGroup = new SpriteGroup();
+                       // this.imgBody = new SpriteGroup();
+                       // this.imgGroup.id = guid();
+                       // this.imgBody.id = guid();
                        this.x = -CHARA_WIDTH / 2;
                        this.y = -CHARA_HEIGHT / 2;
                        this.vx = 0;
@@ -1676,84 +2003,137 @@ window.onload = function(){
                        this.walkAnimationStatus = EWalkAnimation.END;
                        this.place = null;
                        this.items = [];
+                       this.actionQueue = [];
+                       this.exLvHash = {};
+                       this.exValueHash = {};
+                       this.memoryHash = {};
+                       this.communicateYukkuri = {};
+                       for(var _v in EExSkill){
+                               var key = EExSkill[_v];
+                               this.exLvHash[key] = 0;
+                               this.exValueHash[key] = 0;
+                       }
+                       this.kukis = [];
+                       this.formSprite = new FormSprite();
                },
                runEnterframe:function(){
+                       // console.log("runEnterframe");
+                               // this.formSprite.run();
+                               // this.formSprite.addX(1);
+
                        // try{
-                               this.act();
-                               if(this.isDead())return;
-                               this.runYukkuri();
-                               this.runHungry();
-                               this.runUnun();
-                               this.runSleep();
-                               this.runAddress();
+                               if(this.grow == EGrow.FRUIT_BABY){
+                               }else{
+                                       if(this.kukis){
+                                               // this.kukis[0].miYukkuris[0].setX(this.getX());
+                                               // this.kukis[0].miYukkuris[0].setY(this.getY());
+                                               // var _x = this.imgBody.tl.node.x;
+                                               // var _y = this.imgBody.tl.node.y;
+                                               // var _gety = this.kukis[0].miYukkuris[0].getY();
+                                               // this.kukis[0].miYukkuris[0].setOldY();
+                                               // this.kukis[0].miYukkuris[0].animY(-_y);
+                                       }
+                                       // console.log(this.getX() + ":" + this.getY());
+                                       this.act();
+                                       if(this.isDead())return;
+                                       this.runYukkuri();
+                                       this.runHungry();
+                                       this.runUnun();
+                                       this.runSleep();
+                                       this.runAddress();
+                                       this.runAnimation();
+                                       // this.animation();
+
+                               }
                        // }catch(e){
                        //      console.log(e);
                        // }
                },
                reverse:function(){
                        if(this.direction == EDirection.RIGHT){
-                               this.imgBody.scaleX = 1;
+                               this.formSprite.formScaleX(this.myScaleX);
+                               if(this instanceof Player){
+                                       this.formSprite.setFixBudgeRight(5);
+                               }
+                               // this.formSprite.formScaleY(this.myScale);
+
+                               // this.imgBody.scaleX = 1;
                        }
                        else if(this.direction == EDirection.LEFT){
-                               this.imgBody.scaleX = -1;
+                               this.formSprite.formScaleX(-this.myScaleX);
+                               if(this instanceof Player){
+                                       this.formSprite.setFixBudgeLeft(5);
+                               }
+                               // this.formSprite.formScaleY(this.myScale);
+                               // this.imgBody.scaleX = -1;
                        }
                },
                tweet:function(text){
                        text = text.replace(/%name%/g, this.myName);
-                       this._tweet.text(text, this.x - this._tweet.width/4, this.y - this._tweet.height);
+                       // this._tweet.text(text, this.x - this._tweet.width/4, this.y - this._tweet.height);
+                       this._tweet.text(text, this.getX() - this._tweet.width/4, this.getY() - this._tweet.height);
                },
                moveTo:function(x, y, time){
-                       this.imgGroup.tl.moveTo(x, y, time, enchant.Easing.SIN_EASEINOUT);
+                       this.formSprite.tlMoveTo(x, y, time, enchant.Easing.SIN_EASEINOUT);
+                       // this.imgGroup.tl.moveTo(x, y, time, enchant.Easing.SIN_EASEINOUT);
                },
                moveBy:function(x, y, time, eventFunctions){
-                       var self = this;
-                       var params = {
-                               x: function() {
-                                       return self.imgGroup.x + x;
-                               },
-                               y: function() {
-                                       return self.imgGroup.y + y;
-                               },
-                               time: time,
-                               easing: enchant.Easing.SIN_EASEINOUT
-                       };
-                       //-Event register [onactionstart,onactiontick,onactionend]
-                       if(eventFunctions !== undefined){
-                               for(var key in eventFunctions){
-                                       params[key] = eventFunctions[key];
-                               }
-                       }
-                       return this.imgGroup.tl.tween(params);
+                       this.formSprite.tlMoveBy(x, y, time, eventFunctions);
+                       // var self = this;
+                       // var params = {
+                       //      x: function() {
+                       //              return self.getX() + x;
+                       //              // return self.imgGroup.x + x;
+                       //      },
+                       //      y: function() {
+                       //              return self.getY() + y;
+                       //              // return self.imgGroup.y + y;
+                       //      },
+                       //      time: time,
+                       //      easing: enchant.Easing.SIN_EASEINOUT
+                       // };
+                       // //-Event register [onactionstart,onactiontick,onactionend]
+                       // if(eventFunctions !== undefined){
+                       //      for(var key in eventFunctions){
+                       //              params[key] = eventFunctions[key];
+                       //      }
+                       // }
+                       // console.log("moveBy");
+                       // console.log("self.x:" + self.getX());
+                       // return this.formSprite.tlTween(params);
+                       // // return this.imgGroup.tl.tween(params);
                },
                wait:function(frame, eventFunctions){
-                       this.moveBy(0,1,frame,eventFunctions);
+                       this.moveBy(0,0,frame,eventFunctions);
                },
                act: function(){
                        this.action.act();
                },
+               runAnimation: function(){
+                       this.formSprite.formRunAnimation();
+               },
                animation: function(){
-
-                       var frame = 10;
-                       frame += plusFrameScale(frame, this.getMyScale());
-                       var move = 5;
-                       move -= plusFrameScale(move, this.getMyScale());
-                       if(this.walkAnimationStatus == EWalkAnimation.END){
-                               this.imgBody.y = 0;
-                               this.imgBody.tl.moveByEx(0, -move, frame, enchant.Easing.SWING, {
-                                       "onactionstart": function(e){
-                                               this.walkAnimationStatus = EWalkAnimation.START;
-                                       }
-                               })
-                               .moveByEx(0, move, frame, enchant.Easing.SWING,
-                               {
-                                       "onactionend": function(e){
-                                               this.walkAnimationStatus = EWalkAnimation.END;
-                                       }
-                               }).loop();
-
-                       }else{
-                               this.imgBody.tl.loop();
-                       }
+                       this.formSprite.formStartAnimation();
+                       // var frame = 10;
+                       // frame -= plusFrameScale(frame, this.getMyScale()) / 2;
+                       // var move = 5;
+                       // move -= plusFrameScale(move, this.getMyScale());
+                       // if(this.walkAnimationStatus == EWalkAnimation.END){
+                       //      this.imgBody.y = 0;
+                       //      this.imgBody.tl.moveByEx(0, -move, frame, enchant.Easing.SWING, {
+                       //              "onactionstart": function(e){
+                       //                      this.walkAnimationStatus = EWalkAnimation.START;
+                       //              }
+                       //      })
+                       //      .moveByEx(0, move, frame, enchant.Easing.SWING,
+                       //      {
+                       //              "onactionend": function(e){
+                       //                      this.walkAnimationStatus = EWalkAnimation.END;
+                       //              }
+                       //      }).loop();
+                       // }else{
+                       //      this.imgBody.tl.loop();
+                       // }
                },
                getMyScale: function(){
                        return (this.myScaleX + this.myScaleY) / 2;
@@ -1764,23 +2144,29 @@ window.onload = function(){
                getHeight: function(){
                        return this.height * this.myScaleY;
                },
+               setX: function(x){
+                       this.formSprite.setX(x);
+                       // this.imgGroup.x = x;
+               },
+               setY: function(y){
+                       this.formSprite.setY(y);
+                       // this.imgGroup.y = y;
+               },
                getX: function(){
-                       return this.imgGroup.x;
+                       return this.formSprite.getX();
+                       // return this.imgGroup.x;
                },
                getY: function(){
-                       return this.imgGroup.y;
+                       return this.formSprite.getY();
+                       // return this.imgGroup.y;
                },
                moveX: function(x){
-                       this.imgGroup.x += x;
-                       // this.x += x;
-                       // this.shadow.x += x;
-                       // this._tweet.x += x;
+                       this.formSprite.addX(x);
+                       // this.imgGroup.x += x;
                },
                moveY: function(y){
-                       this.imgGroup.y += y;
-                       // this.y += y;
-                       // this.shadow.y += y;
-                       // this._tweet.y += y;
+                       this.formSprite.addY(y);
+                       // this.imgGroup.y += y;
                },
                // changeFace: function(erespath){
                //      this.face.image = game.assets[erespath];
@@ -1803,16 +2189,16 @@ window.onload = function(){
                        else if(this.param.yukkuri >= this.param.maxYukkuri)this.param.yukkuri = this.param.maxYukkuri;
                },
                runHungry: function(){
-                       if(this.age%50 === 0 && this.age !== 0)this.param.hungry++;
+                       if(this.age%50 === 0 && this.age !== 0)this.param.hungry += ADD_HUNGRY;
                        if(this.param.hungry >= 100)this.param.hungry = 100;
                },
                runUnun: function(){
-                       if(this.age%50 === 0 && this.age !== 0)this.param.unun++;
+                       if(this.age%50 === 0 && this.age !== 0)this.param.unun += 1;
                        if(this.param.unun >= 100)this.param.unun = 100;
                },
                runSleep: function(){
                        if(this.action.getStatus() != EAction.SLEEP_START && this.action.getStatus() != EAction.SLEEP_WAIT){
-                               if(this.age%80 === 0 && this.age !== 0)this.param.sleep++;
+                               if(this.age%80 === 0 && this.age !== 0)this.param.sleep += 1;
                                if(this.param.sleep >= 100){
                                        this.param.sleep = 100;
                                }
@@ -1873,6 +2259,10 @@ window.onload = function(){
                        this.param.yukkuri = yukkuri;
                        if(this.param.yukkuri < 0)this.param.yukkuri = 0;
                },
+               addYukkuri: function(yukkuri){
+                       this.param.yukkuri += yukkuri;
+                       if(this.param.yukkuri < 0)this.param.yukkuri = 0;
+               },
                getHungry: function(){
                        return this.param.hungry;
                },
@@ -1936,10 +2326,15 @@ window.onload = function(){
 
                unun:function(){
                        if(this.direction == EDirection.RIGHT){
-                               new Unun(this.getX(), this.getY() + this.getHeight()/5 );
+                               new Unun(this.getX() -  this.getWidth()/5, this.getY() + this.getHeight()/5 );
                        }else{
                                new Unun(this.getX() -  this.getWidth()/5, this.getY() + this.getHeight()/5 );
                        }
+                       // if(this.direction == EDirection.RIGHT){
+                       //      new Unun(this.getX() + this.getWidth()/2 - this.getWidth()/5, this.getY() + this.getHeight() / 2 +  this.getHeight() / 5 );
+                       // }else{
+                       //      new Unun(this.getX() + this.getWidth()/2 - this.getWidth()/5, this.getY() + this.getHeight() / 2 + this.getHeight() / 5 );
+                       // }
                        this.setUnun(0);
                },
                setBodyImage: function(ebody){
@@ -1947,14 +2342,12 @@ window.onload = function(){
                        this.image = game.assets[path];
                },
                tlPause:function(){
-                       // this.imgBody.tl.pause();
-                       // this.imgGroup.tl.pause();
-                       this.imgBody.tl.clear();
-                       this.imgGroup.tl.clear();
-                       this.imgBody.tl.unloop();
-                       this.imgGroup.tl.unloop();
-                       this.imgBody.y = 0;
-
+                       // this.imgBody.tl.clear();
+                       // this.imgGroup.tl.clear();
+                       // this.imgBody.tl.unloop();
+                       // this.imgGroup.tl.unloop();
+                       // this.imgBody.y = 0;
+                       this.formSprite.formStopAnimation();
                },
                tlResume: function(){
                        // this.imgBody.tl.resume();
@@ -1991,6 +2384,7 @@ window.onload = function(){
                        ret += "空腹  " + this.getHungry() + "\n";
                        ret += "うんうん  " + this.getUnun() + "\n";
                        ret += "もちもの  " + this.items.length + "\n";
+                       ret += "debug  " + this.action.status + "\n";
                        return ret;
                },
                isItemsMax:function(){
@@ -2005,10 +2399,165 @@ window.onload = function(){
                clearSearchObject:function(){
                        this.searchObjectMang.clear()
                },
+               setFaceImage: function(eface){
+                       var path = this.faceStatus[eface];
+                       this.face.image = game.assets[path];
+               },
+               myScale: function(_scaleX, _scaleY){
+                       this.formSprite.scale(_scaleX, _scaleY);
+                       // this.face.scale(_scaleX,_scaleY);
+                       // if(this.myCode === "REIMU"){
+                       //      // this.okazari.x = -this.okazari.width / 2;
+                       //      // this.okazari.y = -CHARA_HEIGHT  / 2 + (this.okazari.height * (1 - _scaleY)) / 2;
+                       // }else{
+                       //      // this.okazari.x = -CHARA_WIDTH /2;
+                       //      // this.okazari.y = -CHARA_HEIGHT / 2 - (CHARA_HEIGHT * _scaleY)/6;
+                       // }
+                       // if(this.sub1 != null){
+                       //      this.sub1.scale(_scaleX,_scaleY);
+                       // }
+
+                       // this.okazari.scale(_scaleX,_scaleY);
+                       // this.hear.scale(_scaleX,_scaleY);
+                       // this.scale(_scaleX,_scaleY);
+                       // if(this.shadow)this.shadow.scale(_scaleX, _scaleY);
+               },
+               send: function(targetYukkuri, object, callback){
+                       this.communicateYukkuri = targetYukkuri;
+                       targetYukkuri.recv(object, callback);
+               },
+               recv: function(object, callback){
+                       this.communicateYukkuri = object.yukkuri;
+                       this.tlPause();
+                       this.action.setStatus(object.actionStatus);
+
+                       // this.actionQueue.push({
+                       //      object : object,
+                       //      callback: callback
+                       // });
+               },
+               addExValue: function(eexskill, plus){
+                       this.exValueHash[eexskill] += plus;
+                       if(this.exValueHash[eexskill] >= 100){
+                               this.exLvHash[eexskill] = 1;
+                       }
+               },
+               getExValue: function(eexskill){
+                       return this.exValueHash[eexskill];
+               },
+               getExSkill: function(eexskill){
+                       return this.exLvHash[eexskill];
+               },
+
+               setMemory: function(ememory, value){
+                       this.memoryHash[ememory] = value;
+               },
+               getMemory: function(ememory){
+                       return this.memoryHash[ememory];
+               },
+               damage: function(edamage){
+                       if(edamage == EDamage.PICOHAN){
+                               mangMsg.output(this, EMsg.DAMAGE);
+                               this.setFaceImage(EFace.CRY1);
+                               this.addYukkuri(-1);
+                               //現在の行動パターンから躾対象かセレクトする
+                       }
+               },
+               addKuki: function(){
+                       for(var i=0;i<this.kukis.length;i++){
+                               if(this.kukis[i].opacity == 0){
+                                       this.kukis[i].opacity = 1.0;
+                                       var miMarisa = new MiMarisa(this.getX(), this.getY());
+                                       
+                                       // console.log(this.imgBody);
+                                       // this.imgBody.addChild(miMarisa);
+                                       this.kukis[i].addMiYukkuri(miMarisa);
+                                       break;
+                               }
+                       }
+               },
                destruct: function(){
 
                }
        });
+       // var MiYukkuri = enchant.Class.create(Yukkuri,{
+       //      initialize: function(x, y, grow){
+       //              Yukkuri.call(this,x,y, EGrow.FRUIT_BABY);
+       //              this.oldX = x;
+       //              this.oldY = y;
+       //      },
+       //      setOldY: function(){
+       //              this.imgGroup.y = this.oldY;
+
+       //      },
+       //      animX: function(x){
+       //              this.oldX = this.imgGroup.x;
+       //              this.imgGroup.x -= x;
+       //      },
+       //      animY: function(y){
+       //              this.imgGroup.y = this.oldY;
+       //              // this.oldY = this.imgGroup.y;
+       //              this.imgGroup.y -= y;
+       //      }
+       // }); 
+       // var MiMarisa = enchant.Class.create(MiYukkuri,{
+       //      initialize: function(x, y, grow){
+       //              MiYukkuri.call(this,x,y, EGrow.FRUIT_BABY);
+       //              this.classname = "MiMarisa";
+       //              this.myCode = "MIMARISA";
+       //              this.myName = "実まりさ";
+
+       //              this.param = new MarisaParam();
+       //              this.param.range = 0;
+       //              this.param.looks = ELooks.GOOD_YUKKURI;
+
+
+       //              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.faceStatus ={};
+       //              this.faceStatus[EFace.NORMAL] = EResPath.MARISA_FACE_NORMAL;
+       //              this.faceStatus[EFace.CRY1] = EResPath.MARISA_FACE_CRY1;
+       //              this.faceStatus[EFace.CRY2] = EResPath.MARISA_FACE_CRY2;
+       //              this.faceStatus[EFace.ANGRY] = EResPath.MARISA_FACE_ANGRY;
+       //              this.faceStatus[EFace.HAPPY1] = EResPath.MARISA_FACE_HAPPY1;
+       //              this.faceStatus[EFace.HAPPY2] = EResPath.MARISA_FACE_HAPPY2;
+       //              this.faceStatus[EFace.EAT1] = EResPath.MARISA_FACE_EAT1;
+       //              this.faceStatus[EFace.EAT2] = EResPath.MARISA_FACE_EAT2;
+       //              this.faceStatus[EFace.TIRED] = EResPath.MARISA_FACE_TIRED;
+       //              this.faceStatus[EFace.SLEEP] = EResPath.MARISA_FACE_SLEEP;
+
+       //              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);
+
+
+       //              // this.imgBody.addChild(this);
+       //              // this.imgBody.addChild(this.face);
+       //              // this.imgBody.addChild(this.hear);
+       //              // this.imgBody.addChild(this.okazari);
+       //              this.myScale(this.myScaleX, this.myScaleY)
+       //              // this.imgGroup.width = this.getWidth();
+       //              // this.imgGroup.height = this.getHeight();
+       //              // this.imgGroup.addChild(this.imgBody);
+       //              // this.imgGroup.flgMiYukkuri = true;
+       //              // backgroundMap.addChild(this.imgGroup);
+       //              this._tweet = new TTweet(148, 64);
+
+       //              this.imgGroup.addChild(this._tweet);
+       //              this.imgGroup.x = x;
+       //              this.imgGroup.y = y;
+
+       //              this.action = new Action(this);
+       //              ctl.addObj(this);
+       //      }
+
+       // });
        var Marisa = enchant.Class.create(Yukkuri,{
                initialize: function(x, y, grow){
                        Yukkuri.call(this,x,y, grow);
@@ -2017,8 +2566,10 @@ window.onload = function(){
                        this.myName = "まりさ";
 
                        // var xml = this.loadParamsXML("./data/marisa/params.xml");
-                       var json = net.load("./data/marisa/params.json");
-                       this.param = json.root.param;
+                       // var json = net.load("./data/marisa/params.json");
+                       // this.param = json.root.param;
+                       this.param = new MarisaParam();
+                       this.param.looks = ELooks.GOOD_YUKKURI;
                        if(this.grow == EGrow.BABY){
                                this.myName = "まりちゃ";
                                this.param.range /= 4;
@@ -2028,12 +2579,12 @@ window.onload = function(){
                        }
                        else if(this.grow == EGrow.SUBADULT){
                                this.param.range *= 0.8;
+                       }else{
                        }
                        this.shadow = new enchant.Sprite(64, 64);
                        this.shadow.image = game.assets[EResPath.YUKKURI_SHADOW];
                        this.shadow.x = 0 + this.x;
-                       this.shadow.y = this.getWidth() / 16 + this.x;
-                       this.shadow.image._element.style.zIndex = 2;
+                       this.shadow.y = this.getHeight() / 16 + this.y;
 
                        this._style.zIndex = 5;
 
@@ -2041,7 +2592,6 @@ window.onload = function(){
                        this.face.image = game.assets[EResPath.MARISA_FACE_NORMAL];
                        this.face.x = -CHARA_WIDTH / 2;
                        this.face.y = -CHARA_HEIGHT / 2;
-                       this.face._style.zIndex = 0;
 
                        this.faceStatus ={};
                        this.faceStatus[EFace.NORMAL] = EResPath.MARISA_FACE_NORMAL;
@@ -2060,73 +2610,84 @@ window.onload = function(){
                        this.hear.image = game.assets[EResPath.MARISA_HEAR];
                        this.hear.x = -CHARA_WIDTH / 2;
                        this.hear.y = -CHARA_HEIGHT / 2;
-                       this.hear._style.zIndex = 0;
 
                        this.okazari = new Okazari(this);
 
-                       // this.imgGroup._style.zIndex = 1;
-
-
-                       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.kukis = [];
+                       this.kukis[0] = new Kuki(this, 0, 0);
+                       this.kukis[1] = new Kuki(this, 10, 0);
+                       this.kukis[2] = new Kuki(this, 5, 5);
+                       this.kukis[3] = new Kuki(this, -5, 5);
+                       this._tweet = new TTweet(this, 148, 64);
+
+                       this.formSprite.addChild(this.shadow,0,{type:"shadow",shadowIndexFlg:true,scaleValue:this.myScaleY});
+                       this.formSprite.addChild(this, 1, {
+                               mainIndexFlg:true,
+                               type : "body",
+                               scaleValue:this.myScaleY
+                       });
+                       // this.formSprite.add(this.face,2,{type:"body",scaleValue:this.myScaleY});
+                       // this.formSprite.add(this.hear,3,{type:"body",scaleValue:this.myScaleY});
+                       // this.formSprite.add(this.okazari,4,{type:"body",scaleValue:this.myScaleY});
+                       // this.formSprite.add(this._tweet,6,{type:"tweet",scaleValue:this.myScaleY});
+                       // this.formSprite.addChildAll();
+                       this.formSprite.addChild(this.face,2,{type:"body",scaleValue:this.myScaleY});
+                       this.formSprite.addChild(this.hear,3,{type:"body",scaleValue:this.myScaleY});
+                       this.formSprite.addChild(this.okazari,4,{type:"body",scaleValue:this.myScaleY});
+                       this.formSprite.addChild(this._tweet,6,{type:"tweet",scaleValue:this.myScaleY});
+                       // this.formSprite.addChildAll();
+
+                       // App.backgroundMap.addChild(this._tweet);
+                       // this.imgGroup.addChild(this.shadow);
+                       // this.imgBody.addChild(this);
+                       // this.imgBody.addChild(this.face);
+                       // this.imgBody.addChild(this.hear);
+                       // this.imgBody.addChild(this.okazari);
+                       // for(var i=0;i<this.kukis.length;i++){
+                       //      this.imgBody.addChild(this.kukis[i]);
+                       //      this.kukis[i].opacity = 0;
+                       // }
+                       // this.kuki = ;
+                       // this.imgBody.addChild(new Kuki(this));
                        this.myScale(this.myScaleX, this.myScaleY)
                        if(this instanceof Player){
-                               // this.myScaleX = 0.5;
-                               // this.myScaleY = 0.5;
-
                                this.budge = new enchant.Sprite(16, 16);
                                this.budge.image = game.assets[EResPath.PLAYER_BADGE];
-                               this.imgBody.addChild(this.budge);
-                               this.budge.x -= this.getWidth()/2;
-                               this.budge.y -= this.getHeight()/2;
-                               this.budge.scale(this.myScaleX, this.myScaleX);
-                       }
-                       this.imgGroup.width = this.getWidth();
-                       this.imgGroup.height = this.getHeight();
-                       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.budge.x = -this.getWidth()/2;
+                               this.budge.y = -this.getHeight()/2;
+                               this.budge.scale(this.myScaleX, this.myScaleY);
+                               this.formSprite.addChild(this.budge,5, {type:"budge",scaleValue:this.myScaleY});
+                               this.formSprite.setX(x);
+                               this.formSprite.setY(y);
+                       }
+                       // this.imgGroup.width = this.getWidth();
+                       // this.imgGroup.height = this.getHeight();
+                       // 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.formSprite.setX(x);
+                       this.formSprite.setY(y);
                        this.animation();
                        this.action = new Action(this);
                        ctl.addObj(this);
-                       // this.imgGroup.scale(_scaleX,_scaleX);
-                       // this.scale(scale,scale);
-               },
-               myScale: function(_scaleX, _scaleY){
-                       this.face.scale(_scaleX,_scaleY);
-                       this.okazari.x = -32;
-                       this.okazari.y = -32 - this.getWidth()/6;
-                       this.okazari.scale(_scaleX,_scaleY);
-                       this.hear.scale(_scaleX,_scaleY);
-                       this.scale(_scaleX,_scaleY);
-                       this.shadow.scale(_scaleX, _scaleY);
-
-               },
-               setFaceImage: function(eface){
-                       var path = this.faceStatus[eface];
-                       this.face.image = game.assets[path];
                }
        });
        var Player = enchant.Class.create(Marisa,{
-               initialize: function(x, y){
+               initialize: function(x, y, grow){
                        // this.runEnterframe = function(){
                        // },
-                       Marisa.call(this, x, y, EGrow.ADULT);
+                       if(grow === undefined)grow = EGrow.ADULT;
+                       Marisa.call(this, x, y, grow);
                        this.classname = "Player";
-                       this.cmdQueue = [];
                        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);
                                }
@@ -2139,6 +2700,10 @@ window.onload = function(){
                                        this.direction = EDirection.LEFT;
                                }
                                if(game.input.right){
+                                       for(var i=0;i<this.formSprite.spriteArray.length;i++){
+                                               var spr = this.formSprite.spriteArray[i];
+                                               console.log(i+":spry:" + spr.y);
+                                       }
                                        this.moveX(10);
                                        this.direction = EDirection.RIGHT;
                                }
@@ -2166,8 +2731,115 @@ window.onload = function(){
                        });
                }
        });
+       var Reimu = enchant.Class.create(Yukkuri,{
+               initialize: function(x, y, grow){
+                       Yukkuri.call(this,x,y, grow);
+                       this.classname = "Reimu";
+                       this.myCode = "REIMU";
+                       this.myName = "れいむ";
+                       // var xml = this.loadParamsXML("./data/marisa/params.xml");
+                       // var json = net.load("./data/reimu/params.json");
+                       // this.param = json.root.param;
+                       this.param = new ReimuParam();
+                       if(this.grow == EGrow.BABY){
+                               this.myName = "れいみゅ";
+                               this.param.range /= 4;
+                       }
+                       else if(this.grow == EGrow.CHILD){
+                               this.param.range /= 3;
+                       }
+                       else if(this.grow == EGrow.SUBADULT){
+                               this.param.range *= 0.8;
+                       }
+                       this.shadow = new enchant.Sprite(64, 64);
+                       this.shadow.image = game.assets[EResPath.YUKKURI_SHADOW];
+                       this.shadow.x = 0 + this.x;
+                       this.shadow.y = this.getWidth() / 16 + this.x;
+
+
+                       this.face = new enchant.Sprite(64, 64);
+                       this.face.image = game.assets[EResPathReimu.FACE_NORMAL];
+                       this.face.x = -CHARA_WIDTH / 2;
+                       this.face.y = -CHARA_HEIGHT / 2;
+                       this.face._style.zIndex = 0;
+
+                       this.faceStatus ={};
+                       this.faceStatus[EFace.NORMAL] = EResPathReimu.FACE_NORMAL;
+                       this.faceStatus[EFace.CRY1] = EResPathReimu.FACE_CRY1;
+                       this.faceStatus[EFace.CRY2] = EResPathReimu.FACE_CRY2;
+                       this.faceStatus[EFace.ANGRY] = EResPathReimu.FACE_ANGRY;
+                       this.faceStatus[EFace.HAPPY1] = EResPathReimu.FACE_HAPPY1;
+                       this.faceStatus[EFace.HAPPY2] = EResPathReimu.FACE_HAPPY2;
+                       this.faceStatus[EFace.EAT1] = EResPathReimu.FACE_EAT1;
+                       this.faceStatus[EFace.EAT2] = EResPathReimu.FACE_EAT2;
+                       this.faceStatus[EFace.TIRED] = EResPathReimu.FACE_TIRED;
+                       this.faceStatus[EFace.SLEEP] = EResPathReimu.FACE_SLEEP;
+
+
+                       this.hear = new enchant.Sprite(64, 64);
+                       this.hear.image = game.assets[EResPathReimu.HEAR];
+                       this.hear.x = -CHARA_WIDTH / 2;
+                       this.hear.y = -CHARA_HEIGHT / 2;
+
+                       this.sub1 = new enchant.Sprite(64, 64);
+                       this.sub1.image = game.assets[EResPathReimu.SUB1];
+                       this.sub1.x = -CHARA_WIDTH / 2;
+                       this.sub1.y = -CHARA_HEIGHT / 2;
+
+
+                       this.okazari = new Okazari(this);
+                       this.formSprite.addChild(this.shadow,0,{type:"shadow",scaleValue:this.myScaleY});
+                       this.formSprite.addChild(this, 1, {
+                               mainIndexFlg:true,
+                               type : "body",
+                               scaleValue:this.myScaleY
+                       });
+                       this.formSprite.addChild(this.face,2,{type:"body",scaleValue:this.myScaleY});
+                       this.formSprite.addChild(this.hear,3,{type:"body",scaleValue:this.myScaleY});
+                       this.formSprite.addChild(this.okazari,4,{type:"body",scaleValue:this.myScaleY,spname:"reimu"});
+                       this.formSprite.addChild(this.sub1,5,{type:"body",scaleValue:this.myScaleY});
+                       // this.formSprite.addChild(this._tweet,6,{type:"tweet",scaleValue:this.myScaleY});
+
+                       // this.imgGroup.addChild(this.shadow);
+                       // this.imgBody.addChild(this.okazari);
+                       // this.imgBody.addChild(this);
+                       // this.imgBody.addChild(this.face);
+                       // this.imgBody.addChild(this.hear);
+                       // this.imgBody.addChild(this.sub1);
+                       this.myScale(this.myScaleX, this.myScaleY)
+                       if(this instanceof Player){
+                               this.budge = new enchant.Sprite(16, 16);
+                               this.budge.image = game.assets[EResPath.PLAYER_BADGE];
+                               this.imgBody.addChild(this.budge);
+                               this.budge.x -= this.getWidth()/2;
+                               this.budge.y -= this.getHeight()/2;
+                               this.budge.scale(this.myScaleX, this.myScaleX);
+                       }
+                       // this.imgGroup.width = this.getWidth();
+                       // this.imgGroup.height = this.getHeight();
+                       // this.imgGroup.addChild(this.imgBody);
+                       // backgroundMap.addChild(this.imgGroup);
+                       this._tweet = new TTweet(this, 148, 64);
+                       backgroundMap.addChild(this._tweet);
+
+
+                       // this.imgGroup.addChild(this._tweet);
+                       // this.imgGroup.x = x;
+                       // this.imgGroup.y = y;
+
+                       this.formSprite.setX(x);
+                       this.formSprite.setY(y);
+                       this.animation();
+                       this.action = new Action(this);
+                       ctl.addObj(this);
+                       this.exLvHash[EExSkill.KEKKAI] = 1;
+                       this.exValueHash[EExSkill.KEKKAI] = 100;
+               }
+       });
+
        game.onload = function(){
                def.Food = Food;
+               def.Unun = Unun;
                def.Place = Place;
                def.ObjSprite = ObjSprite;
                def.Yukkuri = Yukkuri;
@@ -2194,7 +2866,6 @@ window.onload = function(){
                windowSurface.context.fillStyle = '#000';
                windowSurface.context.fillRect(0 + 20, EFieldPos.HEIGHT - 60, EFieldPos.WIDTH - 40, EFieldPos.HEIGHT);
 
-
                menuSurface.context.fillStyle = '#000';
                menuSurface.context.fillRect(0, 0, EMenuPos.WIDTH, EMenuPos.HEIGHT);
                menuBg.image = menuSurface;
@@ -2204,7 +2875,9 @@ window.onload = function(){
                mangIcon = new MangIcon(ctl, menuBg);
 
                game.rootScene.addChild(backgroundMap);
-               game.rootScene.addChild(windowFront);
+               // game.rootScene.addChild(windowFront);
+               // game.rootScene.addChild(gwindow);
+               // var gwindow = new GWindow(ctl, {}, 0, 0, 80, 80);
                game.rootScene.addChild(menuBg);
 
                // var labelGroup = new LabelGroup();
@@ -2221,14 +2894,81 @@ window.onload = function(){
                // var food = new def.Food("apple", 200, 250);
                backgroundMap.addChild(foodGroup);
                // backgroundMap.addChild(placeGroup);
-               var player = new Player(PALYER_INIT_X, PALYER_INIT_Y);
+               var player = new Player(PALYER_INIT_X + 200, PALYER_INIT_Y + 200, EGrow.ADULT);
+               // var player = new Player(0, 0);
+               // console.log(player.getX());
+               // player.addKuki();
+               // player.createKuki();
                // new Marisa(PALYER_INIT_X + 50, PALYER_INIT_Y + 200, EGrow.ADULT);
                // new Marisa(PALYER_INIT_X + 100, PALYER_INIT_Y + 200, EGrow.SUBADULT);
                // new Marisa(PALYER_INIT_X + 150, PALYER_INIT_Y + 200, EGrow.CHILD);
                // new Marisa(PALYER_INIT_X + 200, PALYER_INIT_Y + 200, EGrow.BABY);
+               //new Reimu(PALYER_INIT_X + 100, PALYER_INIT_Y + 100, EGrow.ADULT);
+               // new Reimu(PALYER_INIT_X + 350, PALYER_INIT_Y + 400, EGrow.SUBADULT);
+               // new Reimu(PALYER_INIT_X + 300, PALYER_INIT_Y + 400, EGrow.CHILD);
+               // new Reimu(PALYER_INIT_X + 250, PALYER_INIT_Y + 400, EGrow.BABY);
                // new Unun(100, 100);
-               new Place("tree", PALYER_INIT_X, PALYER_INIT_Y - 50);
+               // new Place("tree", PALYER_INIT_X, PALYER_INIT_Y - 50);
                var touchX = 0;
+               // var input = new Label("<form name='hoge' style='background-color:#ff0000;'>" +
+               //              "<input type='text' name='text'>" +
+               //              // "<select name='input_item' id='input_item'><option name='none'>りんご</option></select>" +
+               //              "</from>");
+               // input.y = 0;
+               // input.element.innerHTML = "<form name='hoge' style='background-color:#ff0000;'>" +
+               //              "<input type='text' name='text'>" +
+               //              // "<select name='input_item' id='input_item'><option name='none'>りんご</option></select>" +
+               //              "</from>";
+               // menuBg.addChild(input);
+               // game.rootScene.addChild(input);
+               // var inputEvent = new Label('');
+               // output.y = 64;
+               // game.rootScene.addChild(output);
+               // output.onenterframe = function(e) {
+               //              output.text = document.hoge.text.value;
+               //      };
+               // };
+               // enchant.Node.GAddEvent = function(){
+               // }
+               var popupStatus = null;
+               var testFlg = false;
+               var iconText = [];
+               game._element.addEventListener('mousemove', function (e) {
+                       var mang = mangTouch.get(ctl.getCurrentCommand());
+                       if(EMenuPos.X < e.layerX){
+                               var ex = e.layerX - EMenuPos.X;
+                               var ey = e.layerY;
+                               var hitFlg = false;
+                               for(var i=0;i<mangIcon.cmdIcons.length;i++){
+                                       var icon = mangIcon.cmdIcons[i];
+                                       if(icon.x <= ex && ex <= (icon.x + ICON_WIDTH)
+                                               && icon.y <= ey && ey <= (icon.y + ICON_HEIGHT)
+                                               ){
+                                               hitFlg = true;
+                                               if(popupStatus !== i){
+                                                       ctl.popup.renew(game.rootScene, EMenuPos.X + 5, e.layerY + ICON_HEIGHT / 2, 80, 80);
+                                                       ctl.popup.setText(icon.text);
+                                                       popupStatus = i;
+                                                       break;
+                                               }
+                                       }
+                               }
+
+                               if(hitFlg){
+                                       ctl.popup.opacity = 0.9;
+                                       ctl.popup.drawText();
+                               }
+                               else {
+                                       ctl.popup.opacity = 0;
+                               }
+                               // console.log(e.layerX + ":" + e.layerY);
+                       }
+               });
+               // enchant.Core.instance._element.addEventListener('mousemove', function(e) {
+
+               // game.rootScene.addEventListener('mousemove', function (e) {
+               //      console.log("mmmmmmmmm");
+               // });
 
 
                game.rootScene.addEventListener('touchstart', function (e) {
@@ -2247,13 +2987,13 @@ window.onload = function(){
                });
 
 
-               game.rootScene.addEventListener('enterframe', function(){
+               game.rootScene.addEventListener('enterframe', function(e){
                        //main frame
                        mangLabel.draw(player);
                        if(this.age%BASE_FPS == 0 ){
                                ctl.calcTime();
                        }
-                       ctl.time++;
+                       ctl.time += TIME_SPEED;
                });
                this.addEventListener('enterframe', function(){
                        //The priority processing of display instead of z-index
@@ -2264,3 +3004,5 @@ window.onload = function(){
        };
        game.start();
 };
+
+