Advertisement
Advertisement
| 08.13.2008 at 11:02PM PDT, ID: 23647174 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: |
_root.super_charge = 0;
_root.boomIscoming = 0;
// define the bounds of the movie.
_root.xmax = 850;
_root.xmin = -50;
_root.ymax = 400;
_root.ymin = 10;
//
var hitting_sound_x = new Sound();
hitting_sound_x.attachSound("rocket_loop3");
// initialize a variable "a" to keep count of our asteroids and depths.
this.a = 0;
// initialize a variable "f" to keep count of our lasers
this.f = 0;
// all the code that will make up the "ship"
function makeShip(depth) {
createEmptyMovieClip("ship",depth);
this.ship._x = this.ship._y=200;
this.ship._xscale = this.ship._yscale=50;
with (this.ship) {
ship.attachMovie("theShip","instance1",10);
}
}
function createShip() {
this.makeShip("ship",1);
this.ship.angle = 0;
this.ship.xv = 0;
this.ship._x = Stage.width/2;
this.ship._y = Stage.height/2;
this.ship.yv = 0;
this.ship.xa = 0;
this.ship.ya = 0;
this.ship.v = 0;
this.ship.visc = 0.02;
this.ship.drag = 0;
this.ship.score = 0;
this.ship.timer = 0;
_root.bullets = new Array();
this.ship.onEnterFrame = function() {
if (_root.gamePause == false) {
// ship enterframe activities begin...
if (this.timer>0) {
this.timer--;
}
if (Key.isDown(Key.SPACE) && this.timer == 0 && _root.lockship != 1) {
//
this.timer = 6;
// BEGIN firing -- lock and load :)
trace(" Shooting ");
if (_root.bullets.length<1) {
bullets.push(_root.createEmptyMovieClip("f"+_root.bl, 1000+ ++_root.bl));
var id = bullets.length-1;
var bullet = bullets[id];
bullet.id = id;
if (_root.bl>100) {
_root.bl = 0;
}
bullet.lineStyle(1,0xcccccc,100);
bullet.beginFill(0xcccccc,100);
bullet.moveTo(-2,-2);
bullet.lineTo(2,-2);
bullet.lineTo(2,2);
bullet.lineTo(-2,2);
bullet.lineTo(-2,-2);
bullet.endFill();
bullet.angle = this.angle;
bullet.alive = 20;// alive is what we use so your lasers don't continue perpetually.
bullet._x = this._x;
bullet._y = this._y;
bullet.onEnterFrame = function() {
if (this.alive>0) {
this.alive--;
this._y += -15*Math.cos(Math.PI/180*this.angle);
this._x += 15*Math.sin(Math.PI/180*this.angle);
if (this._x<=_root.xmin) {
this._x += _root.xmax-10;
}
if (this._x>=_root.xmax) {
this._x -= _root.xmax-10;
}
if (this._y<=_root.ymin) {
this._y += _root.ymax-10;
}
if (this._y>=_root.ymax) {
this._y -= _root.ymax-10;
}
} else {
for (var k in _root.bullets) {
if (_root.bullets[k] == this) {
_root.bullets.splice(k,1);
}
}
this.removeMovieClip();
}
};
}
}
//
// BEGIN movement...
if (Key.isDown(Key.RIGHT)) {
this.torque = 5;
_root.NoScore = false;
} else if (Key.isDown(Key.LEFT)) {
this.torque = -5;
_root.NoScore = false;
} else {
this.torque = 0;
}
this.rtorque = 0.5*this.AngVelocity;
this.AngAcceleration = this.torque-this.rtorque;
this.AngVelocity += this.AngAcceleration;
this.angle += this.AngVelocity;
if (this.angle<0) {
this.angle += 360;
}
// constrain theta 0 < 360
if (this.angle>360) {
this.angle -= 360;
}
this.v = Math.sqrt((this.xv*this.xv)+(this.yv*this.yv));
this.drag = this.visc*this.v;
if (Key.isDown(Key.UP)) {
this.force = 1;
_root.thesuper_charge = 1;
_root.NoScore = false;
hitting_sound_x.start();
} else {
this.force = 0;
_root.thesuper_charge = 0;
hitting_sound_x.stop();
}
this.xa = ((this.drag*this.xv)*-1)+(this.force*Math.sin(Math.PI/180*this.angle));
this.ya = ((this.drag*this.yv)*-1)-(this.force*Math.cos(Math.PI/180*this.angle));
this.xv = this.xv+this.xa;
this.yv += this.ya;
if (this._x<=_root.xmin) {
this._x += _root.xmax-10;
}
if (this._x>=_root.xmax) {
this._x -= _root.xmax-10;
}
if (this._y<=_root.ymin) {
this._y += _root.ymax-10;
}
if (this._y>=_root.ymax) {
this._y -= _root.ymax-10;
}
if (_root.lockship != 1) {
this._y += this.yv;
this._x += this.xv;
this._rotation = this.angle;
}
}
// ... END movement
};
}
var shooting_sound = new Sound();
shooting_sound.attachSound("swarm_gun_08");
var keyListener_obj:Object = new Object();
keyListener_obj.onKeyDown = function() {
switch (Key.getCode()) {
case Key.SPACE :
shooting_sound.start();
break;
}
};
Key.addListener(keyListener_obj);
function Game() {
_root.NoScore = true;
_root.gamePause = false;
_root.gameOver = false;
for (i in _root) {
_root[i].removeMovieClip();
}
at = new Array();
initializeGame();
createShip();
//
}
foo = new Game();
stop();
|