STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228089
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/50011740?noj=FRM50011740-4DC" width="1" height="1"></div>

simpleballmovement.swf

This is the info page for
Flash #69977

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
movieClip 4 { } movieClip 7 { } movieClip 18 { } movieClip 21 { } movieClip 23 { } movieClip 27 { } movieClip 28 { } movieClip 31 { } movieClip 35 { } movieClip 38 { } movieClip 39 { } movieClip 41 { } movieClip 42 { } movieClip 43 { } button 46 { on (release) { getURL('http://www.newgrounds.com', '_blank'); } } movieClip 48 { frame 40 { stop(); } } movieClip 73 { } button 74 { on (release) { startMovie(); } } movieClip 75 { frame 1 { function timerHandler() { if (!loadingComplete) { var v4 = _root.getBytesLoaded() / _root.getBytesTotal(); bar._xscale = 100 * v4; if (v4 == 1) { loadingComplete = true; if (AUTO_PLAY) { startMovie(); } else { gotoAndStop('loaded'); } return undefined; } } dt = getTimer() - time; time += dt; frameAccum += dt; var v3 = 0; for (;;) { if (!(frameAccum >= FRAME_TIME && v3 < MAX_FRAME_SKIP)) break; advanceFrame(tankLogo, true, true); advanceFrame(loadingText, false, true); advanceFrame(barGfx, false, true); if (loadingComplete) { advanceFrame(this, false, false); } frameAccum -= FRAME_TIME; v3++; } updateAfterEvent(); } function advanceFrame(clip, recurse, loop) { if (!clip) { return undefined; } clip.stop(); if (clip._currentframe == clip._totalframes) { if (loop) { clip.gotoAndStop(1); } } else { clip.nextFrame(); } if (recurse) { for (childName in clip) { if (typeof clip[childName] == 'movieclip') { advanceFrame(clip[childName], recurse, loop); } } } } function startMovie() { clearInterval(intervalId); _root.play(); } _root.stop(); stop(); var FRAME_TIME = 33.33333333333334; var AUTO_PLAY = false; var MAX_FRAME_SKIP = 5; var loadingComplete; var intervalId; var time; var frameAccum; loadingComplete = false; intervalId = setInterval(this, 'timerHandler', FRAME_TIME / 2); frameAccum = 0; time = getTimer(); timerHandler(); } } frame 2 { function moveBall() { if (Key.isDown(39)) { Xspeed += ballSpeed; } if (Key.isDown(37)) { Xspeed -= ballSpeed; } if (Key.isDown(40)) { Yspeed += ballSpeed; } if (Key.isDown(38)) { Yspeed -= ballSpeed; } } function applyMovement() { ball._x += Xspeed; ball._y += Yspeed; ball._rotation += Xspeed; } function ballFriction() { if (Xspeed > 0) { Xspeed -= friction; } if (Xspeed < 0) { Xspeed += friction; } if (Yspeed > 0) { Yspeed -= friction; } if (Yspeed < 0) { Yspeed += friction; } } function ballGravity() { Yspeed += gravity; } function boundries() { if (ball._x >= 525) { Xspeed = -Xspeed; } if (ball._x <= 25) { Xspeed = -Xspeed; } if (ball._y >= 375) { Yspeed = -Yspeed; } if (ball._y <= 25) { Yspeed = -Yspeed; } if (ball._x >= 526) { ball._x -= 3; } if (ball._x <= 24) { ball._x += 3; } if (ball._y >= 376) { ball._y -= 3; } if (ball._y <= 24) { ball._y += 3; } } stop(); var Xspeed = 0; var Yspeed = 0; var friction = 0.15; var gravity = 0.7; var ballSpeed = 1.24; onEnterFrame = function () { moveBall(); applyMovement(); ballFriction(); ballGravity(); boundries(); }; } movieClip 77 { } instance ball of movieClip 77 { onClipEvent (enterFrame) { if (!touchingGround) { ++grav; this._y += grav; } else { grav = 0; } if (_root.ground.hitTest(_x, _y, true)) { touchingGround = true; } else { touchingGround = false; } } onClipEvent (load) { var touchingGround = false; } } movieClip 79 { }




http://swfchan.com/14/69977/info.shtml
Created: 10/4 -2019 04:33:05 Last modified: 10/4 -2019 04:33:05 Server time: 04/05 -2024 04:36:42