Combined Code
frame 1 {
function sanicrightMovement() {
SANIC._x += speed;
}
function sanicleftMovement() {
SANIC._x -= speed;
}
function sanicupMovement() {
SANIC._y -= speed;
}
function sanicdownMovement() {
SANIC._y += speed;
}
function rightMovement() {
RING._x += speedx;
}
function leftMovement() {
RING._x -= speedx;
}
function upMovement() {
RING._y -= speedx;
}
function downMovement() {
RING._y += speedx;
}
stop();
water = 8;
speed = 16;
SANIC.onEnterFrame = function () {
if (Key.isDown(37)) {
sanicleftMovement();
SANIC.gotoAndStop(1);
}
if (Key.isDown(39)) {
sanicrightMovement();
SANIC.gotoAndStop(2);
}
if (Key.isDown(38)) {
sanicupMovement();
SANIC.gotoAndStop(3);
}
if (Key.isDown(40)) {
sanicdownMovement();
SANIC.gotoAndStop(4);
}
};
speedx = 4;
RING.onEnterFrame = function () {
if (Key.isDown(65)) {
leftMovement();
}
if (Key.isDown(68)) {
rightMovement();
}
if (Key.isDown(87)) {
upMovement();
}
if (Key.isDown(83)) {
downMovement();
}
};
}
movieClip 3 {
}
movieClip 5 {
}
// unknown tag 88 length 146
movieClip 16 {
}
movieClip 25 {
}
movieClip 36 {
}
movieClip 47 {
}
movieClip 48 {
frame 1 {
stop();
}
}
instance SANIC of movieClip 48 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.barrier)) {
this._x -= 18;
}
if (this.hitTest(_root.wall)) {
this._y += 18;
}
if (this.hitTest(_root.wall2)) {
this._y -= 18;
}
if (this.hitTest(_root.wall3)) {
this._x += 18;
}
if (this.hitTest(_root.wall4)) {
this._x -= 18;
}
if (this.hitTest(_root.barrier2)) {
this._x += 18;
}
if (this.hitTest(_root.barrier3)) {
this._y -= 18;
}
if (this.hitTest(_root.barrier4)) {
this._y += 18;
}
if (this.hitTest(_root.barrier5)) {
this._x -= 18;
}
if (this.hitTest(_root.barrier6)) {
this._x += 18;
}
if (this.hitTest(_root.barrier7)) {
this._y -= 18;
}
if (this.hitTest(_root.barrier8)) {
this._y += 18;
}
if (this.hitTest(_root.booster)) {
this._x += 288;
}
if (this.hitTest(_root.rock2)) {
_parent.gotoAndStop(5);
}
if (this.hitTest(_root.rock)) {
_parent.gotoAndStop(5);
}
if (this.hitTest(_root.goal)) {
_parent.gotoAndStop(2);
}
}
}
movieClip 50 {
}
movieClip 52 {
}
movieClip 54 {
}
movieClip 56 {
}
movieClip 58 {
}
movieClip 60 {
}
instance rock2 of movieClip 60 {
}
movieClip 61 {
}
movieClip 62 {
}
movieClip 63 {
}
movieClip 66 {
}
movieClip 68 {
}
movieClip 70 {
frame 1 {
function camControl() {
rp.x = _x;
rp.y = _y;
var v5 = camH * (_yscale * 0.01);
var v6 = camW * (_xscale * 0.01);
var v3 = sH / v5;
var v4 = sW / v6;
_x2 = (v6 / 2) * v4;
_y2 = (v5 / 2) * v3;
_xscale2 = v4 * 100;
_yscale2 = v3 * 100;
_rotation2 = -_rotation;
_parent.filters = this.filters;
_parent.transform.colorTransform = this.transform.colorTransform;
}
function reset() {
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
_parent._rotation = 0;
_parent._visible = true;
}
function set_x2(value) {
var v2 = {'x': rp.x, 'y': rp.y};
_parent.localToGlobal(v2);
_parent._x += value - v2.x;
}
function get_x2() {
var v2 = {'x': rp.x, 'y': rp.y};
_parent.localToGlobal(v2);
return v2.x;
}
function set_y2(value) {
var v2 = {'x': rp.x, 'y': rp.y};
_parent.localToGlobal(v2);
_parent._y += value - v2.y;
}
function get_y2() {
var v2 = {'x': rp.x, 'y': rp.y};
_parent.localToGlobal(v2);
return v2.y;
}
function get_xscale2() {
return _parent._xscale;
}
function set_xscale2(value) {
setProperty2('_xscale', value);
}
function get_yscale2() {
return _parent._yscale;
}
function set_yscale2(value) {
setProperty2('_yscale', value);
}
function get_rotation2() {
return parent.rotation;
}
function set_rotation2(value) {
setProperty2('_rotation', value);
}
function setProperty2(prop, n) {
var v3 = {'x': rp.x, 'y': rp.y};
_parent.localToGlobal(v3);
_parent[prop] = n;
var v2 = {'x': rp.x, 'y': rp.y};
_parent.localToGlobal(v2);
_parent._x -= v2.x - v3.x;
_parent._y -= v2.y - v3.y;
}
_visible = false;
addProperty('_x2', get_x2, set_x2);
addProperty('_y2', get_y2, set_y2);
addProperty('_xscale2', get_xscale2, set_xscale2);
addProperty('_yscale2', get_yscale2, set_yscale2);
addProperty('_rotation2', get_rotation2, set_rotation2);
var oldScaleMode = stage.scaleMode;
stage.scaleMode = 'exactFit';
var sW = Stage.width;
var sH = Stage.height;
stage.scaleMode = oldScaleMode;
var bounds_obj = this.getBounds(this);
var camH = Math.abs(bounds_obj.yMax - bounds_obj.yMin);
var camW = Math.abs(bounds_obj.xMax - bounds_obj.xMin);
var rp = {'x': this._x, 'y': this._y};
onEnterFrame = function () {
camControl();
};
this.onUnload = reset;
}
}
instance of movieClip 70 {
onClipEvent (enterFrame) {
_y = _y + (_root.SANIC._y - _y) / 4;
_x = _x + (_root.SANIC._x - _x) / 4;
}
}
instance SANIC of movieClip 48 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.barrier)) {
this._x -= 18;
}
if (this.hitTest(_root.wall)) {
this._y += 18;
}
if (this.hitTest(_root.wall2)) {
this._y -= 18;
}
if (this.hitTest(_root.wall3)) {
this._x += 18;
}
if (this.hitTest(_root.wall4)) {
this._x -= 18;
}
if (this.hitTest(_root.barrier2)) {
this._x += 18;
}
if (this.hitTest(_root.barrier3)) {
this._y -= 18;
}
if (this.hitTest(_root.barrier4)) {
this._y += 18;
}
if (this.hitTest(_root.barrier5)) {
this._x -= 18;
}
if (this.hitTest(_root.barrier6)) {
this._x += 18;
}
if (this.hitTest(_root.barrier7)) {
this._y -= 18;
}
if (this.hitTest(_root.barrier8)) {
this._y += 18;
}
if (this.hitTest(_root.booster)) {
this._y += 288;
}
if (this.hitTest(_root.rock2)) {
_parent.gotoAndStop(5);
}
if (this.hitTest(_root.rock)) {
_parent.gotoAndStop(5);
}
}
}
frame 5 {
stop();
}
// unknown tag 88 length 63
movieClip 109 {
frame 39 {
stop();
_parent.gotoAndStop(5);
}
}
button 112 {
on (release) {
gotoAndStop(1);
}
}
instance of movieClip 70 {
onClipEvent (enterFrame) {
_y = _y + (_root.SANICDEATH._y - _y) / 4;
_x = _x + (_root.SANICDEATH._x - _x) / 4;
}
}