GRASS : './data/system/grass.png',
PLAYER_BADGE : './data/system/player_badge.png',
KUKI : './data/system/kuki.png',
+ MIYUKKURI : './data/system/miyukkuri.png',
// PLACE_TREE : './data/system/rapture.png',
};
var EResPathReimu = {
var bodyValue = 37;
var tweetValue = 288;
var kukiValue = 143;
+ var miYukkuriValue = 363;
if(a.type == "shadow"){
ay += shadowValue * a.scaleValue;
ay += kukiValue * a.scaleValue - a.anim.cnt;
}
+
if(b.type == "shadow"){
by += shadowValue * b.scaleValue;
}
}
+
if(a instanceof SpriteGroup){
ay = a.y;
ay += a.height/2;
by = b.y;
by += b.height /2;
}
+ if(a instanceof MiYukkuri){
+ ay += miYukkuriValue * a.scaleValue - a.anim.cnt;
+ }
+ if(b instanceof MiYukkuri){
+ console.log("M");
+ by += miYukkuriValue * b.scaleValue - b.anim.cnt;
+ }
if(a instanceof Place){
ay += Math.round(a.height * 0.7);
this.miYukkuris = [];
},
addMiYukkuri: function(miYukkuri){
- miYukkuri.setX(miYukkuri.getX() + 30);
- miYukkuri.setY(miYukkuri.getY() - 30);
+ // miYukkuri.setX(miYukkuri.getX() + 30);
+ // miYukkuri.setY(miYukkuri.getY() - 30);
this.miYukkuris.push(miYukkuri);
},
+ getMiYukkuris: function(){
+ return this.miYukkuris;
+ },
getX : function(){
return this.x;
},
if(this.param.yukkuri <= 0)this.param.yukkuri = 0;
else if(this.param.yukkuri >= this.param.maxYukkuri)this.param.yukkuri = this.param.maxYukkuri;
+
+ var x = this.getX();
+ var y = this.getY();
+
+ var kukiLength = this.kukis.length;
+ var yukkuris = [];
+ if(kukiLength > 0){
+ for(var i=0;i<kukiLength;i++){
+ var kuki = this.kukis[i];
+ yukkuris = kuki.getMiYukkuris();
+ var yukkuriLength = yukkuris.length;
+ for(var j=0;j<yukkuriLength;j++){
+ var yukkuri = yukkuris[j];
+ yukkuri.setX(x);
+ yukkuri.setY(y);
+ }
+ }
+
+ }
},
runHungry: function(){
if(this.age%50 === 0 && this.age !== 0)this.param.hungry += ADD_HUNGRY;
//現在の行動パターンから躾対象かセレクトする
}
},
- 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());
- var miMarisa = new MiMarisa(100, 100);
+ // 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());
+ // var miMarisa = new MiMarisa(100, 100);
- // console.log(this.imgBody);
- // this.imgBody.addChild(miMarisa);
- this.kukis[i].addMiYukkuri(miMarisa);
- break;
- }
- }
+ // // console.log(this.imgBody);
+ // // this.imgBody.addChild(miMarisa);
+ // this.kukis[i].addMiYukkuri(miMarisa);
+ // break;
+ // }
+ // }
+ // },
+ addKuki: function(kuki){
+ this.kukis.push(kuki);
+ var length = this.kukis.length;
+ this.formSprite.addChild(kuki,1000 + length,{type:"kuki",scaleValue:this.myScaleY});
},
- addAAA: function(kuki){
- this.formSprite.addChild(this.kukis[0],7,{type:"kuki",scaleValue:this.myScaleY});
+ addMiYukkuri: function(index){
+ var kuki = this.kukis[index];
+ var miYukkuri = new MiMarisa(this, 10, -30);
+ // var x = this.getX();
+ // var y = this.getY();
+ kuki.addMiYukkuri(miYukkuri);
+
},
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;
+ var MiYukkuri = enchant.Class.create(ObjSprite, {
+ initialize: function(param){
+ ObjSprite.call(this,14,14);
+ // this.oldX = x;
+ // this.oldY = y;
+
+ this.classname = "MiYukkuri";
+ this.image = game.assets[EResPath.MIYUKKURI];
+ this.x = param.x;
+ this.y = param.y;
+ this.addX = param.addX;
+ this.addY = param.addY;
+ this.scaleValue = 1;
+ backgroundMap.addChild(this);
+ this.anim = {};
+ this.anim.cnt = 0;
+
+ },
+ setX : function(x){
+ this.x = x + this.addX;
+ },
+ setY : function(y){
+ this.y = y + this.addY;
},
setOldY: function(){
this.imgGroup.y = this.oldY;
}
});
var MiMarisa = enchant.Class.create(MiYukkuri,{
- initialize: function(x, y, grow){
- Yukkuri.call(this,x,y, EGrow.FRUIT_BABY);
- this.classname = "Marisa";
- this.myCode = "MARISA";
- this.myName = "実まりさ";
-
- this.param = new MarisaParam();
- this.param.looks = ELooks.GOOD_YUKKURI;
+ initialize: function(parentYukkuri, addX, addY){
+ var x = parentYukkuri.getX();
+ var y = parentYukkuri.getY();
+ if(addX === undefined){
+ x += addX;
+ }
+ if(addY === undefined){
+ y += addY;
+ }
+ MiYukkuri.call(this, {x:x, y:y,addX:addX, addY:addY});
+ this.classname = "MiMarisa";
+ this.myCode = "MI_MARISA";
this.myName = "実まりちゃ";
- this.param.range /= 4;
- 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._tweet = new TTweet(this, 148, 64);
-
- this.formSprite.addChild(this, 1, {
- mainIndexFlg:true,
- type : "body",
- scaleValue:this.myScaleY
- });
+ // this.classname = "Marisa";
+ // this.myCode = "MARISA";
+ // this.myName = "実まりさ";
+
+ // this.param = new MarisaParam();
+ // this.param.looks = ELooks.GOOD_YUKKURI;
+ // this.myName = "実まりちゃ";
+ // this.param.range /= 4;
+
+ // 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._tweet = new TTweet(this, 148, 64);
+
+ // 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});
- this.formSprite.addChild(this._tweet,6,{type:"tweet",scaleValue:this.myScaleY});
- 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.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.formSprite.setX(x);
- this.formSprite.setY(y);
- this.animation();
- this.action = new Action(this);
- ctl.addObj(this);
+ // 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.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.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.formSprite.setX(x);
+ // this.formSprite.setY(y);
+ // this.animation();
+ // this.action = new Action(this);
+ // ctl.addObj(this);
}
});
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.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});
// backgroundMap.addChild(placeGroup);
// var mimarisa = new MiMarisa(PALYER_INIT_X + 100, PALYER_INIT_Y + 100, EGrow.FRUIT_BABY);
var player = new Player(PALYER_INIT_X + 200, PALYER_INIT_Y + 200, EGrow.ADULT);
+ ;
+ player.addMiYukkuri(0);
// var player = new Player(0, 0);
// console.log(player.getX());
// player.addKuki();
// player.addMiYukkuri(mimarisa)
// player.createKuki();
new Marisa(PALYER_INIT_X + 50, PALYER_INIT_Y + 200, EGrow.ADULT);
+
// new Marisa(PALYER_INIT_X + 150, PALYER_INIT_Y + 200, EGrow.ADULT);
// new Marisa(PALYER_INIT_X + 250, PALYER_INIT_Y + 200, EGrow.ADULT);
// new Marisa(PALYER_INIT_X + 100, PALYER_INIT_Y + 200, EGrow.SUBADULT);