STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229595 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
This is the info page for Flash #14217 |
0 |
<p align="center"><font face="Verdana_10pt_st" size="10" color="#666666"><a href="mailto:rens.rongen@gmail.com&subject=Gravity test&body=VERSION 10-08-05"><b>rens.rongen@gmail.com</b></a></font></p> |
Gravity based movement | |
INFO |
INFO |
This started out as an experiment, but I thought it looked funny how the elements, each having it's own gravitational field, create the illusion of chasing after eachother. So I added a few features allowing them to eliminate others, growing stronger with each succesful 'assassination'. It's quite simple: - Click to add a new element. - Hold SHIFT & click to add a player element, use arrow keys to control. - Hold SPACE to pause. - The number on each element refers to it's level. Adding alot of elements will result in something like a battle, where mighty elements might appear from. I'm also aware of the fact that this doesn't make any sense, just use your 'imagination'. Anyway, i'm too lazy to make an actual game of this, but I hope you enjoy it nontheless. |
ActionScript [AS1/AS2]
Frame 1function createGravityObject(newObj) { var _local2 = "go_" + VARS.go_cnt; var _local3 = {cx:newObj.x, cy:newObj.y, V:{x:newObj.V.x, y:newObj.V.y}, p:newObj.p}; gravObj[_local2] = new GravityObject(newObj.g, newObj.s, newObj.o, _local3, newObj.c); activeObjects[activeObjects.length] = gravObj[_local2]; if (_local3.p) { VARS.p = activeObjects[activeObjects.length - 1]; VARS.p.rotation = 0; } VARS.go_cnt++; } function renderGravity() { var _local1 = 0; if (pathLines.length > 100) { pathLines[0].clip.removeMovieClip(); pathLines.splice(0, 1); } pathLines[pathLines.length] = {}; pathLines[pathLines.length - 1].clip = VARS.lineRoot.createEmptyMovieClip(["l_" + VARS.lc], VARS.lc); VARS.lc++; var _local11 = 0; while (_local11 < pathLines.length) { pathLines[_local11].clip._alpha = pathLines[_local11].clip._alpha - 1; _local11++; } while (_local1 < activeObjects.length) { var _local2 = 0; pathLines[pathLines.length - 1].clip.moveTo(activeObjects[_local1].cx, activeObjects[_local1].cy); pathLines[pathLines.length - 1].clip.lineStyle(activeObjects[_local1].kills + 1, activeObjects[_local1].hex, 50); while (_local2 < activeObjects.length) { if (activeObjects[_local1] != activeObjects[_local2]) { var _local9 = activeObjects[_local1].cx - activeObjects[_local2].cx; var _local10 = activeObjects[_local1].cy - activeObjects[_local2].cy; var _local14 = Math.sqrt((_local9 * _local9) + (_local10 * _local10)); if (activeObjects[_local1] == VARS.p) { var _local12 = (activeObjects[_local1].grav / (_local14 * VARS.eff)) + (Key.isDown(38) ? 0.5 : ((Key.isDown(40) ? -0.5 : 0))); var _local13 = _local12 - (VARS.drag * _local12); activeObjects[_local1].rotation = VARS.p.rotation; var _local6 = activeObjects[_local1].rotation * (Math.PI/180); var _local16 = Math.sin(_local6) * _local13; var _local15 = (Math.cos(_local6) * _local13) * -1; } else { var _local12 = activeObjects[_local1].grav / (_local14 * VARS.eff); var _local13 = _local12 - (VARS.drag * _local12); var _local6 = ((Math.atan2(_local10, _local9) * 57.2957795130823) + 90) * (Math.PI/180); var _local16 = Math.sin(_local6) * _local13; var _local15 = (Math.cos(_local6) * _local13) * -1; } if (_local14 < (25 + (activeObjects[_local1].kills * 5))) { for (a in activeObjects[_local1].clip.sub) { activeObjects[_local1].clip.sub.localToGlobal((hTst = {x:activeObjects[_local1].clip.sub[a]._x, y:activeObjects[_local1].clip.sub[a]._y})); var _local4 = hTst.x - activeObjects[_local2].cx; var _local3 = hTst.y - activeObjects[_local2].cy; var _local5 = Math.pow((_local4 * _local4) + (_local3 * _local3), 0.5); if (_local5 < (10 + (activeObjects[_local2].kills * 2))) { activeObjects[_local2].life = activeObjects[_local2].life - activeObjects[_local1].damage; activeObjects[_local2].clip._alpha = (((40 + activeObjects[_local2].life) > 100) ? 100 : (60 + activeObjects[_local2].life)); VARS.effectRoot.attachMovie("def", ["e_" + VARS.ec], VARS.ec); VARS.effectRoot["e_" + VARS.ec]._x = hTst.x; VARS.effectRoot["e_" + VARS.ec]._y = hTst.y; VARS.ec++; if (activeObjects[_local2].life <= 0) { activeObjects[_local1].kills++; activeObjects[_local1].life = ((activeObjects[_local1].life < 100) ? (40 + (activeObjects[_local1].kills * 5)) : 100); activeObjects[_local1].damage = activeObjects[_local1].damage + 0.2; activeObjects[_local1].tclip.lvl.text = activeObjects[_local1].kills; activeObjects[_local1].clip._alpha = 100; activeObjects[_local1].clip._xscale = activeObjects[_local1].clip._xscale + 10; activeObjects[_local1].clip._yscale = activeObjects[_local1].clip._yscale + 10; activeObjects[_local2].clip.gotoAndPlay(2); activeObjects[_local2].tclip.removeMovieClip(); activeObjects.splice(_local2, 1); _local1 = _local1 - ((_local2 < _local1) ? 1 : 0); _local2--; } } } } if (_local14 < (15 + (activeObjects[_local1].kills * 1.5))) { activeObjects[_local1].V.x = activeObjects[_local1].V.x - ((_local16 < 0) ? 1 : -1); activeObjects[_local1].V.y = activeObjects[_local1].V.y - ((_local15 < 0) ? 1 : -1); } else { activeObjects[_local1].V.x = activeObjects[_local1].V.x - _local16; activeObjects[_local1].V.y = activeObjects[_local1].V.y - _local15; activeObjects[_local1].V.x = activeObjects[_local1].V.x / 1.01; activeObjects[_local1].V.y = activeObjects[_local1].V.y / 1.01; } } _local2++; } if (activeObjects.length == 1) { var _local9 = activeObjects[_local1].cx - VARS.clipRoot._xmouse; var _local10 = activeObjects[_local1].cy - VARS.clipRoot._ymouse; var _local14 = Math.sqrt((_local9 * _local9) + (_local10 * _local10)); var _local6 = ((Math.atan2(_local10, _local9) * 57.2957795130823) + 90) * (Math.PI/180); var _local12 = (2 * _local14) / (_local14 * VARS.eff); var _local13 = _local12 - (VARS.drag * _local12); var _local16 = Math.sin(_local6) * _local13; var _local15 = (Math.cos(_local6) * _local13) * -1; activeObjects[_local1].V.x = activeObjects[_local1].V.x - _local16; activeObjects[_local1].V.y = activeObjects[_local1].V.y - _local15; activeObjects[_local1].cx = activeObjects[_local1].cx + activeObjects[_local1].V.x; activeObjects[_local1].cy = activeObjects[_local1].cy + activeObjects[_local1].V.y; } else { if (activeObjects[_local1].cx < 0) { activeObjects[_local1].cx = 500; moved = true; } if (activeObjects[_local1].cx > 500) { activeObjects[_local1].cx = 0; moved = true; } if (activeObjects[_local1].cy < 0) { activeObjects[_local1].cy = 500; moved = true; } if (activeObjects[_local1].cy > 500) { activeObjects[_local1].cy = 0; moved = true; } if (moved) { pathLines[pathLines.length - 1].clip.moveTo(activeObjects[_local1].cx, activeObjects[_local1].cy); } } if ((activeObjects[_local1] == VARS.p) && (activeObjects.length > 1)) { var _local6 = activeObjects[_local1].rotation + 90; } else { var _local6 = Math.atan2(activeObjects[_local1].V.y, activeObjects[_local1].V.x) * 57.2957795130823; } activeObjects[_local1].clip._rotation = 90 + _local6; activeObjects[_local1].cx = activeObjects[_local1].cx + activeObjects[_local1].V.x; activeObjects[_local1].cy = activeObjects[_local1].cy + activeObjects[_local1].V.y; var moved = false; activeObjects[_local1].setClip(); pathLines[pathLines.length - 1].clip.lineTo(activeObjects[_local1].cx, activeObjects[_local1].cy); _local1++; } } _global.SETTINGS = {paused:false}; _global.VARS = {lineRoot:_root.createEmptyMovieClip("space0", 1), clipRoot:_root.createEmptyMovieClip("space", 2), tclipRoot:_root.createEmptyMovieClip("space2", 3), effectRoot:_root.createEmptyMovieClip("space3", 4), go_cnt:0, drag:0.05, eff:3, lc:0, ec:0, p:false}; _global.gravObj = {}; _global.activeObjects = []; _global.pathLines = []; _global.hexArray = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; GravityObject = function (grav, shape, solid, state, c, player) { this.grav = grav; this.solid = solid; this.shape = this.applyShape(shape); this.applyState(state); this.c = c; this.getClip(clip); this.life = 40; this.damage = 1; this.kills = 0; this.player = player; this.hex = "0x"; var _local2 = 0; while (_local2 <= 6) { this.hex = this.hex + hexArray[Math.round(Math.random() * hexArray.length)]; _local2++; } }; GravityObject.prototype.applyShape = function (newShape) { var _local1 = []; if (newShape.length == 0) { return(1); } return(_local1); }; GravityObject.prototype.applyState = function (s) { this.cx = s.cx; this.cy = s.cy; this.V = {x:s.V.x, y:s.V.y}; this.p = s.p; }; GravityObject.prototype.getClip = function (clip) { this.clip = VARS.clipRoot.attachMovie(this.c, ["goc_" + VARS.go_cnt], VARS.go_cnt); this.clip._x = this.cx; this.clip._y = this.cy; this.clip.sub.gotoAndStop(((this.c == "clip1") ? 2 : 1)); this.tclip = VARS.tclipRoot.attachMovie("txtMc", "txtMc", VARS.go_cnt); this.tclip._x = this.cx - 5; this.tclip._y = this.cy - 10; }; GravityObject.prototype.setClip = function () { this.clip._x = this.cx; this.clip._y = this.cy; this.tclip._x = this.cx - 5; this.tclip._y = this.cy - 10; }; _root.onEnterFrame = function () { if ((!Key.isDown(32)) || (SETTINGS.paused)) { renderGravity(); } if (Key.isDown(37)) { VARS.p.rotation = VARS.p.rotation - 5; } if (Key.isDown(39)) { VARS.p.rotation = VARS.p.rotation + 5; } }; _root.onMouseDown = function () { myObj1 = {g:10 + (Math.random() * 50), s:[], o:false, x:VARS.clipRoot._xmouse + ((activeObjects.length == 0) ? (Math.random() * 10) : 0), y:VARS.clipRoot._ymouse + ((activeObjects.length == 0) ? (Math.random() * 10) : 0), V:{x:-3 + (Math.random() * 6), y:-3 + (Math.random() * 6)}}; if (Key.isDown(16)) { myObj1.p = true; myObj1.c = "clip1"; } else { myObj1.p = false; myObj1.c = "clip2"; } if (activeObjects.length == 0) { myObj1.V.x = -5 + (Math.random() * 10); myObj1.V.y = -5 + (Math.random() * 10); } createGravityObject(myObj1); };Symbol 8 MovieClip [clip1] Frame 1stop();Symbol 8 MovieClip [clip1] Frame 10if (Key.isDown(32) || (SETTINGS.paused)) { this.gotoAndPlay(2); } else { removeMovieClip(this); }Symbol 11 MovieClip [clip2] Frame 1stop();Symbol 11 MovieClip [clip2] Frame 10if (Key.isDown(32) || (SETTINGS.paused)) { this.gotoAndPlay(2); } else { removeMovieClip(this); }Symbol 17 MovieClip [def] Frame 10if (!Key.isDown(32)) { removeMovieClip(this); }
Library Items
Symbol 1 Graphic | Used by:8 | |
Symbol 2 Graphic | Used by:5 | |
Symbol 3 MovieClip | Used by:5 | |
Symbol 4 Graphic | Used by:5 | |
Symbol 5 MovieClip | Uses:2 3 4 | Used by:8 11 |
Symbol 6 ShapeTweening | Used by:8 | |
Symbol 7 Graphic | Used by:8 11 | |
Symbol 8 MovieClip [clip1] | Uses:1 5 6 7 | |
Symbol 9 Graphic | Used by:11 | |
Symbol 10 ShapeTweening | Used by:11 | |
Symbol 11 MovieClip [clip2] | Uses:9 5 10 7 | |
Symbol 12 Font | Used by:13 | |
Symbol 13 EditableText | Uses:12 | Used by:14 |
Symbol 14 MovieClip [txtMc] | Uses:13 | |
Symbol 15 ShapeTweening | Used by:17 | |
Symbol 16 Graphic | Used by:17 | |
Symbol 17 MovieClip [def] | Uses:15 16 | |
Symbol 18 Graphic | Used by:Timeline | |
Symbol 19 Font | Used by:20 21 23 26 | |
Symbol 20 EditableText | Uses:19 | Used by:Timeline |
Symbol 21 Text | Uses:19 | Used by:Timeline |
Symbol 22 Graphic | Used by:28 | |
Symbol 23 Text | Uses:19 | Used by:28 |
Symbol 24 Font | Used by:25 | |
Symbol 25 Text | Uses:24 | Used by:28 |
Symbol 26 Text | Uses:19 | Used by:27 |
Symbol 27 MovieClip | Uses:26 | Used by:28 |
Symbol 28 Button | Uses:22 23 25 27 | Used by:Timeline |
Instance Names
"info" | Frame 1 | Symbol 28 Button |
"sub" | Symbol 8 MovieClip [clip1] Frame 1 | Symbol 5 MovieClip |
"sub" | Symbol 11 MovieClip [clip2] Frame 1 | Symbol 5 MovieClip |
"lvl" | Symbol 14 MovieClip [txtMc] Frame 1 | Symbol 13 EditableText |
Special Tags
ExportAssets (56) | Timeline Frame 1 | Symbol 8 as "clip1" |
ExportAssets (56) | Timeline Frame 1 | Symbol 11 as "clip2" |
ExportAssets (56) | Timeline Frame 1 | Symbol 14 as "txtMc" |
ExportAssets (56) | Timeline Frame 1 | Symbol 17 as "def" |
|