Frame 1
function SharikDeath() {
_root.attachMovie("sharik_dead", "sharik_dead", 4, {_x:_root.sharik._x, _y:_root.sharik._y});
_root.sharik.swapDepths(_root.getNextHighestDepth());
_root.sharik.removeMovieClip();
stopAllSounds();
}
speed = 10;
score = 0;
frame = 0;
framerate = 24;
second = 0;
dogcounter = 0;
_root.onEnterFrame = function () {
frame++;
if (frame == framerate) {
second++;
frame = 0;
}
if (second == 5) {
second = 0;
dogcounter++;
nameDog = "dog" + dogcounter;
_root.attachMovie("dog", nameDog, dogcounter, {_x:_root.buda._x, _y:_root.buda._y});
_root[nameDog].onEnterFrame = function () {
this.speed = random(60) + 20;
this.speed = random(60) + 20;
this._x = this._x + ((_root.sharik._x - this._x) / this.speed);
this._y = this._y + ((_root.sharik._y - this._y) / this.speed);
if (sharik.hitTest(this)) {
SharikDeath();
}
};
}
};
Instance of Symbol 25 MovieClip "sharik" in Frame 1
onClipEvent (load) {
power = 7;
hit = 0;
frame = 0;
framerate = 12;
second = 0;
hunger = 0;
score = 0;
firste = 1;
kolbasa_score = 0;
_root.counter.text = score;
xscale = _root.sharik._width;
yscale = _root.sharik._height;
_root.hungerBar.text = hunger;
}
onClipEvent (enterFrame) {
if (_root.kolbasa.hitTest(this)) {
_root.score++;
_root.counter.text = score;
_root.kolbasa.onEnterFrame = function () {
this.speed = 5;
this._x = this._x + ((_root.sharik._x - this._x) / this.speed);
this._y = this._y + ((_root.sharik._y - this._y) / this.speed);
if (_root.garbidge.hitTest(this)) {
kolbasa_score++;
kolbasa_kolichestvo++;
_root.colbasa_c.text = kolbasa_score;
if (kolbasa_kolichestvo == 5) {
kolbasa_kolichestvo = 0;
hunger = hunger - 10;
score = score + 600;
_root.colbasa_c.text = kolbasa_score;
}
_root.kolbasa._x = random(550) + 1;
_root.kolbasa._y = random(400) + 1;
firste = 1;
_root.kolbasa.onEnterFrame = function () {
};
}
};
firste = 0;
}
if (_root.fish.hitTest(this)) {
_root.score++;
_root.fish._x = random(550) + 1;
_root.fish._y = random(400) + 1;
_root.counter.text = score;
hunger = hunger - 3;
score = score + 80;
}
if (_root.wall.hitTest(_x, _y, true)) {
_x = 120;
_y = 120;
}
_root.hungerBar.text = hunger;
frame++;
if (frame == framerate) {
second++;
frame = 0;
}
if (second == 1) {
hunger++;
second = 0;
}
if (hunger == 100) {
_root.SharikDeath();
}
if (hit == 1) {
_root.attachMovie("sharik_dead", "sharik_dead", 4, {_x:this._x, _y:this._y});
this.swapDepths(6);
this.removeMovieClip();
}
if (Key.isDown(37)) {
_x = (_x - power);
this._xscale = 90;
}
if (Key.isDown(39)) {
_x = (_x + power);
this._xscale = -90;
}
if (Key.isDown(38)) {
_y = (_y - power);
}
if (Key.isDown(40)) {
_y = (_y + power);
}
if (Key.isDown(8)) {
hit = 1;
}
}