function Scene_Frogger(){
this.initialize.apply(this, arguments);
}
Scene_Frogger.prototype = Object.create(Scene_Base.prototype);
Scene_Frogger.prototype.constructor = Scene_Frogger;
Scene_Frogger.prototype.initialize = function(){
Scene_Base.prototype.initialize.call(this);
};
Scene_Frogger.prototype.create = function(){
Scene_Base.prototype.create.call(this);
this.createBackground();
this.createTrunks();
this.createFrogHome();
this.createFrog();
this.createCars();
this.createTrucks();
this.createViper();
};
Scene_Frogger.prototype.start = function(){
Scene_Base.prototype.start.call(this);
SceneManager.clearStack();
};
Scene_Frogger.prototype.update = function(){
//刷新场景内的所有物品
if(this._frog.restFrame <= 0){
//1.刷新小汽车
this.updateCars();
//2.刷新大汽车
this.updateTrucks();
//3.刷新蛇(注:蛇的行动较为特殊,当青蛙纵向趴在草地上时,蛇看不见,但青蛙如横向移动,就会暴露给蛇)
this.updateViper();
//4.刷新木桩
this.updateTrunks();
//5.刷新青蛙
this.updateFrog();
}
Scene_Base.prototype.update.call(this);
};
//青蛙过河小游戏用到的图片位元--------------------------------------------------------
// Sprite_Cars
//
// 3.小汽车
//第一步:先命名
function Sprite_Cars(){
this.initialize.apply(this, arguments);
}
//第二步:规定其父类及调用方法
Sprite_Cars.prototype = Object.create(Sprite_FrogBase.prototype);
Sprite_Cars.prototype.constructor = Sprite_Cars;
//第三步:生成的时候做什么?(方向,x, y)
Sprite_Cars.prototype.initialize = function(direction, x, y){
Sprite_FrogBase.prototype.initialize.call(this);
this.kindId = Sprite_FrogBase.KIND_CAR;
this.direction = direction;
this.bitmap = ImageManager.loadSystem('Frogger01');
this.anchor.x = 0.5;
this.anchor.y = 0.5;
this.rotation = (direction == 1 ? Math.PI : 0);
this.x = x;
this.y = y;
this.collapseWidth = 96;
this.collapseHeight = 48;
};
//第四步:每帧刷新的时候做什么?
Sprite_Cars.prototype.update = function(){
Sprite_FrogBase.prototype.update.call(this);
};