Commenti
discussione: Karoshi: Suicide Salaryman
The code below is the actionscript applied to the boss stage frame of the game's swf file. It shows that each time a jump is made, Math.random() is used to generate a random integer from 0 to 704, which is used as the x-coordinate of the fall position. The origin of the boss's coordinates is in the upper left corner, and the width of the boss is about 150. This means that if you are standing at x-coordinates between 150 and 704 (using the gray rectangle in the background as a guide, the fourth to eleventh from the left), you have the highest probability of being crushed.
function randRange(min, max)
{
var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
return _loc1_;
}
function UpdateHits()
{
_root.Hearts.counter.text = "x " + int(_root.Hits + 1);
_root.Cookie.data.EndbossLives = _root.Hits;
}
function HeartBehaviour()
{
this._x += this.xspeed;
this._y += this.yspeed;
if(this.hitTest(_root.man) == true && _root.man.dying != true)
{
_root.PlaySound("_root.SND_BossHeart");
_root.Hits += _root.Hits >= 9 ? 0 : 1;
UpdateHits();
delete this.onEnterFrame;
removeMovieClip(this);
}
if(this._y > 500)
{
delete this.onEnterFrame;
removeMovieClip(this);
}
}
function DoLevelCustomBehaviour(action)
{
if(action == "onload")
{
endboss.gravity = 0;
endboss.groundticks = 0;
endboss.AnimationOver = false;
heart.ticks = 0;
UpdateHits();
_root.MiscLevelObjects.push(endboss,heart);
}
else if(action == "loop")
{
_root.NextLevel = _root.Hits != 0 ? 52 : 666;
if(_root.Hits == -1)
{
_root.KillMan();
}
}
}
var Hits = _root.Hits <= 0 ? (!(_root.Cookie.data.EndbossLives != undefined && _root.Cookie.data.EndbossLives != -1) ? new Number(0) : _root.Cookie.data.EndbossLives) : _root.Hits;
var lock = new Boolean(true);
heart.onEnterFrame = function()
{
this.ticks = this.ticks + 1;
if(this.ticks % 50 == 0)
{
this.duplicateMovieClip("heart" + this.ticks,_root.getNextHighestDepth());
elem = eval("heart" + this.ticks);
elem.xspeed = randRange(-4,4);
elem.yspeed = randRange(2,4);
elem._alpha = 100;
elem._yscale = elem._xscale = randRange(50,80);
elem.onEnterFrame = HeartBehaviour;
_root.MiscLevelObjects.push(elem);
}
};
endboss.onEnterFrame = function()
{
this.gravity += this.gravity <= 40 ? 1 : 0;
this._y += this.gravity;
this._y = this._y <= 229 ? this._y : 229;
this._x = this._y >= -150 ? this._x : randRange(0,704);
lock = this._y >= -150 ? lock : false;
this.lock = this._y >= -150 ? this.lock : false;
if(this.AnimationOver == true)
{
_root.PlaySound("_root.SND_BossJump");
this.gravity = -50;
this.AnimationOver = false;
}
else if(this._y == 229 && this.groundticks > 120 && this._currentframe == 1)
{
this.gotoAndPlay(2);
this.groundticks = 0;
}
else if(this._y == 229)
{
this.groundticks = this.groundticks + 1;
if(lock == false)
{
_root.PlaySound("_root.SND_BossDrop");
lock = true;
}
}
if(this.hitTest(_root.man) == true && prevy != 229 && this.lock == false && _root.manCanJump == true)
{
_root.Hits -= 1;
UpdateHits();
this.lock = true;
_root.KillMan();
}
prevy = this._y;
};
level = new Array("0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","3","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t17","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5","t5");
_root.DrawLevel(level,52,52,2);
stop();
MrMonsh piace questo
Mostrando 1 a 1 di 1
Info su void_kyun
Iscritto
Online
Runs
0
Giochi seguiti