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

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

2D Air Hockey.swf

This is the info page for
Flash #11779

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


Text
<P ALIGN="LEFT"><FONT FACE="Arial Black" SIZE="10" COLOR="#FFFFFF"><A HREF="http://www.2dplay.com" target = "_blank">www.2DPlay.com</A></FONT></P>

Loading

presents

0

0

0

0

-

Restart

<P ALIGN="RIGHT"><FONT FACE="Arial Black" SIZE="10" COLOR="#FFFFFF"><A HREF="http://www.2dplay.com" target = "_blank"> &nbsp;More free games by 2DPlay.com</A></FONT></P>

Goal

Goal

Sound

Start game

Start game

The first player to accumulate seven (7)
points wins the game.
When the puck enters and drops inside a
player's goal, the player's opponent receives
one point.
The player scored upon receives
possession of the puck for the next serve.
The puck may be struck with any part of
the mallet.

2d Air Hockey

DIFFICULTY

Easy

Medium

Hard

ActionScript [AS1/AS2]

Frame 1
_root.lev = 48; fscommand ("showmenu", false); _root.sunet = 1; stop(); logo.onEnterFrame = function () { if (_root.getBytesLoaded() == _root.getBytesTotal()) { _root.logo.play(); } else { tgFrame = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100); this.progress.gotoAndStop(tgFrame); } };
Frame 2
_root.scorMe = 0; _root.scorAi = 0;
Instance of Symbol 27 MovieClip "mVel" in Frame 2
onClipEvent (enterFrame) { newTime = getTimer(); newXMousePos = _root.b10._x; dXDistance = newXMousePos - oldXMousePos; newYMousePos = _root.b10._y; dYDistance = newYMousePos - oldYMousePos; dTime = Math.abs(oldTime - newTime); xVelocity = Math.round((dXDistance / dTime) * 50); yVelocity = Math.round((dYDistance / dTime) * 50); oldTime = getTimer(); oldXMousePos = _root.b10._x; oldYMousePos = _root.b10._y; }
Instance of Symbol 35 MovieClip "b0" in Frame 2
onClipEvent (enterFrame) { if (this._y > 290) { this._y = 288; } if (this._y < 75) { this._y = 77; } if (this._x < 68) { this._x = 70; } if (this._x > 482) { this._x = 480; } }
Instance of Symbol 37 MovieClip "b10" in Frame 2
onClipEvent (enterFrame) { this._x = _root.zz1._x; this._y = _root.zz1._y; }
Instance of Symbol 38 MovieClip "zz" in Frame 2
onClipEvent (load) { vx = 0; vy = 0; } onClipEvent (enterFrame) { if (_root.b0._x > 275) { this._x = this._x + ((_root.b0._x - this._x) / 8); vx = (_root.b0._x - this._x) / 8; } else { this._x = this._x + ((450 - this._x) / 8); vx = (_root.b0._x - this._x) / 8; } this._y = this._y + ((_root.b0._y - this._y) / _root.lev); vy = (_root.b0._y - this._y) / _root.lev; }
Instance of Symbol 40 MovieClip "b3" in Frame 2
onClipEvent (enterFrame) { this._x = _root.zz._x; this._y = _root.zz._y; }
Instance of Symbol 41 MovieClip "zz1" in Frame 2
onClipEvent (enterFrame) { if ((_root._xmouse > 80) && (_root._xmouse < 250)) { this._x = _root._xmouse; Mouse.hide(); } else if (_root._xmouse < 80) { this._x = 80; } else if (_root._xmouse > 250) { this._x = 250; } if ((_root._ymouse > 80) && (_root._ymouse < 280)) { this._y = _root._ymouse; Mouse.hide(); } else if (_root._ymouse < 80) { this._y = 80; Mouse.show(); } else if (_root._ymouse > 290) { this._y = 280; Mouse.show(); } }
Frame 3
stop(); controller.ballHittest = function (clip1, clip2) { xp = clip1._x - clip2._x; yp = clip1._y - clip2._y; dist = Math.sqrt((xp * xp) + (yp * yp)); r1 = clip1._width / 2; r2 = clip2._width / 2; if (dist <= (r1 + r2)) { return(true); } return(false); }; stop(); this.onEnterFrame = function () { txt1.text = scorMe; txt2.text = scorAi; }; controller.ballHittest = function (clip1, clip2) { xp = clip1._x - clip2._x; yp = clip1._y - clip2._y; dist = Math.sqrt((xp * xp) + (yp * yp)); r1 = clip1._width / 2; r2 = clip2._width / 2; if (dist <= (r1 + r2)) { return(true); } return(false); };
Instance of Symbol 51 MovieClip "controller" in Frame 3
onClipEvent (load) { function getDistanceSquare(clip, clip2) { var xp = (clip._x - clip2._x); var yp = (clip._y - clip2._y); return((xp * xp) + (yp * yp)); } ballsArray = []; ballsArray[2] = _root.b0; ballsArray[1] = _root.b3; ballsArray[0] = _root.b10; var k = 0; while (k < ballsArray.length) { ballsArray[k].dx = 0; ballsArray[k].dy = 0; ballsArray[k].moving = false; ballsArray[k].disabled = false; k++; } diameter = _root.b10._width; diameterSquare = diameter * diameter; bgLeft = 48 + (diameter / 2); bgRight = 502 - (diameter / 2); bgTop = 55 + (diameter / 2); bgBottom = 310 - (diameter / 2); } onClipEvent (enterFrame) { _root.b0.moving = true; _root.zz1.atins = 0; if (ballHittest(_root.b10, _root.b0)) { _root.zz1.atins = 1; oldTime2 = getTimer(); } _root.b10.dx = _root.mVel.xVelocity; _root.b10.dy = _root.mVel.yVelocity; if (Math.abs(_root.b10.dx) > 15) { _root.b10.dx = 15 * (_root.b10.dx / Math.abs(_root.b10.dx)); } if (Math.abs(_root.b10.dy) > 15) { _root.b10.dy = 15 * (_root.b10.dy / Math.abs(_root.b10.dy)); } _root.b10.frictionX = _root.b10.dx / 200; _root.b10.frictionY = _root.b10.dy / 200; _root.b10.moving = true; _root.b3.dx = _root.zz.vx; _root.b3.dy = _root.zz.vy; _root.b3.dx = 10 * (_root.b3.dx / Math.abs(_root.b3.dx)); _root.b3.dy = 10 * (_root.b3.dy / Math.abs(_root.b3.dy)); _root.b3.frictionX = _root.b3.dx / 200; _root.b3.frictionY = _root.b3.dy / 200; _root.b3.moving = true; if (fsec > 70) { return(undefined); } var k = 0; while (k < ballsArray.length) { clip = ballsArray[k]; if (clip.moving == false) { } else if (clip.disabled) { } else if (clip.bounced) { } else { var m = 0; while (m < ballsArray.length) { clip2 = ballsArray[m]; if ((m <= k) && (clip2.moving)) { } else if (clip2.disabled) { } else { xoff = clip2._x - clip._x; yoff = clip2._y - clip._y; if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) { } else { clip.moving = true; clip2.moving = true; _root.bouncer.bounce(clip, clip2); } } m++; } var m = 0; while (m < holesArray.length) { clip2 = holesArray[m]; xoff = clip2._x - clip._x; yoff = clip2._y - clip._y; if (((xoff * xoff) + (yoff * yoff)) > diameterSquare) { } else { fireN++; duplicateMovieClip (_root.fire, "fire" + fireN, fireN); _root["fire" + fireN].ball = clip; } m++; } } k++; } } onClipEvent (enterFrame) { t1 = getTimer(); fsec = t1 - t2; t2 = t1; var p = 0; while (p < ballsArray.length) { clip3 = ballsArray[p]; if (clip3.disabled) { } else if (clip3.moving == false) { } else { clip3.dx = clip3.dx - clip3.frictionX; clip3.dy = clip3.dy - clip3.frictionY; clip3._x = clip3._x + clip3.dx; clip3._y = clip3._y + clip3.dy; dx = clip3.dx; dy = clip3.dy; if (clip3._x < bgLeft) { clip3.dx = Math.abs(dx); clip3.frictionX = Math.abs(clip3.frictionX); if (_root.sunet == 1) { _root.son1.start(); } } else if (clip3._x > bgRight) { if (_root.sunet == 1) { } clip3.dx = -Math.abs(dx); clip3.frictionX = -Math.abs(clip3.frictionX); } if (clip3._y < bgTop) { if (_root.sunet == 1) { } clip3.dy = Math.abs(dy); clip3.frictionY = Math.abs(clip3.frictionY); } else if (clip3._y > bgBottom) { if (_root.sunet == 1) { } clip3.dy = -Math.abs(dy); clip3.frictionY = -Math.abs(clip3.frictionY); } if (((dx * dx) + (dy * dy)) < 0.003) { clip3.dx = 0; clip3.dy = 0; clip3.frictionX = 0; clip3.frictionY = 0; clip3.moving = false; } } p++; } }
Instance of Symbol 52 MovieClip "bouncer" in Frame 3
onClipEvent (load) { function bounce(clip, clip2) { var angle = Math.atan2(clip._y - clip2._y, clip._x - clip2._x); this._rotation = (angle * 180) / Math.PI; var pt2 = {x:clip2.dx * 10, y:clip2.dy * 10}; this.globalToLocal(pt2); var subVector2 = {x:pt2.x, y:0}; this.localToGlobal(subVector2); var pt = {x:clip.dx * 10, y:clip.dy * 10}; this.globalToLocal(pt); var subVector = {x:pt.x, y:0}; this.localToGlobal(subVector); if ((pt2.x <= 0) && (pt.x >= 0)) { return(undefined); } var xSub = ((subVector2.x - subVector.x) / 10); var ySub = ((subVector2.y - subVector.y) / 10); clip.dx = clip.dx + xSub; clip.dy = clip.dy + ySub; clip2.dx = clip2.dx - xSub; clip2.dy = clip2.dy - ySub; var ang = Math.atan2(clip.dy, clip.dx); clip.frictionX = Math.cos(ang) / 20; clip.frictionY = Math.sin(ang) / 20; var ang2 = Math.atan2(clip2.dy, clip2.dx); clip2.frictionX = Math.cos(ang2) / 20; clip2.frictionY = Math.sin(ang2) / 20; } }
Frame 4
if (_root.lev == 48) { bbx1._visible = 1; bbx2._visible = 0; bbx3._visible = 0; } if (_root.lev == 24) { bbx1._visible = 0; bbx2._visible = 1; bbx3._visible = 0; } if (_root.lev == 6) { bbx1._visible = 0; bbx2._visible = 0; bbx3._visible = 1; } if (_root.scorMe > _root.scorAi) { if (_root.lev == 48) { mesaj = "YOU WON! \nTry your skills with the medium difficulty level."; } if (_root.lev == 24) { mesaj = "YOU WON! \nTry your skills with the hard difficulty level."; } if (_root.lev == 6) { mesaj = "YOU WON!"; } } if (_root.scorAi > _root.scorMe) { if (_root.lev == 48) { mesaj = "YOU LOST! \nTry again."; } if (_root.lev == 24) { mesaj = "YOU LOST! \nTry with the easy difficulty level."; } if (_root.lev == 6) { mesaj = "YOU LOST! \nTry with the medium difficulty level."; } } if (_root.scorAi == _root.scorMe) { mesaj = "DRAW! \nTry Again."; } _root.mes.text = mesaj; son = new Sound(); son.attachSound("muzica"); son.setVolume(40); son1 = new Sound(); son1.attachSound("shot"); if (_root.kx == null) { son.start(1, 9999); _root.kx = 1; } stop(); Mouse.show(); but.onRelease = function () { _root.gotoAndPlay(2); }; if ((_root.scorMe - _root.scorAi) > _root.oldScore) { bMe.text = _root.scorMe; bAi.text = _root.scorAi; _root.oldScore = _root.scorMe - _root.scorAi; }
Symbol 11 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 84
stop();
Symbol 15 MovieClip Frame 358
_root.gotoAndStop(4);
Symbol 25 MovieClip Frame 1
tg1.onEnterFrame = function () { if (this.hittest(_root.b0)) { if ((getTimer() - oldTime1) > 2000) { oldTime1 = getTimer; _root.scorAi++; _root.scorer = "ai"; _root.scored.play(); } } if (_root.scorAi > 6) { _root.gotoAndStop(4); } }; tg2.onEnterFrame = function () { if (this.hittest(_root.b0)) { if ((getTimer() - oldTime2) > 2000) { oldTime2 = getTimer; _root.scorMe++; _root.scorer = "me"; _root.scored.play(); } } if (_root.scorMe > 6) { _root.gotoAndStop(4); } };
Symbol 35 MovieClip Frame 1
stop();
Symbol 44 Button
on (release) { _root.gotoAndStop(4); }
Symbol 59 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 2
_root.b0._x = 270; _root.b0._y = 180; _root.b0.dx = 0; _root.b0.dy = 0; if (_root.scorer == "me") { _root.b0.dx = 3; } if (_root.scorer == "ai") { _root.b0.dx = -3; } _root.b0.disabled = true; _root.b0._visible = 0;
Symbol 59 MovieClip Frame 55
_root.b0.disabled = false; _root.b0._visible = 1;
Symbol 62 Button
on (release) { if (_root.sunet == 0) { _root.sunet = 1; _root.son.start(0, 100); } else { _root.sunet = 0; _root.son.stop(); } }
Symbol 73 Button
on (release) { bbx1._visible = 1; bbx2._visible = 0; bbx3._visible = 0; _root.lev = 48; }
Symbol 75 Button
on (release) { bbx1._visible = 0; bbx2._visible = 1; bbx3._visible = 0; _root.lev = 24; }
Symbol 77 Button
on (release) { bbx1._visible = 0; bbx2._visible = 0; bbx3._visible = 1; _root.lev = 6; }

Library Items

Symbol 1 Sound [shot]
Symbol 2 Sound [muzica]
Symbol 3 GraphicUsed by:Timeline
Symbol 4 FontUsed by:5 14 45
Symbol 5 EditableTextUses:4 6 53 69Used by:Timeline
Symbol 6 FontUsed by:5 7 43 45 60
Symbol 7 TextUses:6Used by:15
Symbol 8 ShapeTweeningUsed by:11
Symbol 9 GraphicUsed by:11
Symbol 10 GraphicUsed by:11
Symbol 11 MovieClipUses:8 9 10Used by:15
Symbol 12 GraphicUsed by:13
Symbol 13 MovieClipUses:12Used by:15 25
Symbol 14 TextUses:4Used by:15
Symbol 15 MovieClipUses:7 11 13 14Used by:Timeline
Symbol 16 GraphicUsed by:Timeline
Symbol 17 GraphicUsed by:25
Symbol 18 GraphicUsed by:19
Symbol 19 MovieClipUses:18Used by:25
Symbol 20 GraphicUsed by:25
Symbol 21 GraphicUsed by:22
Symbol 22 MovieClipUses:21Used by:25
Symbol 23 GraphicUsed by:24
Symbol 24 MovieClipUses:23Used by:25
Symbol 25 MovieClipUses:17 13 19 20 22 24Used by:Timeline
Symbol 26 GraphicUsed by:27
Symbol 27 MovieClipUses:26Used by:Timeline
Symbol 28 FontUsed by:29 30 31 32 33 67
Symbol 29 EditableTextUses:28Used by:Timeline
Symbol 30 EditableTextUses:28Used by:Timeline
Symbol 31 EditableTextUses:28Used by:Timeline
Symbol 32 EditableTextUses:28Used by:Timeline
Symbol 33 TextUses:28Used by:Timeline
Symbol 34 GraphicUsed by:35
Symbol 35 MovieClipUses:34Used by:Timeline
Symbol 36 GraphicUsed by:37
Symbol 37 MovieClipUses:36Used by:Timeline
Symbol 38 MovieClipUsed by:Timeline
Symbol 39 GraphicUsed by:40
Symbol 40 MovieClipUses:39Used by:Timeline
Symbol 41 MovieClipUsed by:Timeline
Symbol 42 GraphicUsed by:44
Symbol 43 TextUses:6Used by:44
Symbol 44 ButtonUses:42 43Used by:Timeline
Symbol 45 EditableTextUses:4 6 53 69Used by:Timeline
Symbol 46 GraphicUsed by:Timeline
Symbol 47 GraphicUsed by:48
Symbol 48 MovieClipUses:47Used by:Timeline
Symbol 49 GraphicUsed by:Timeline
Symbol 50 GraphicUsed by:51
Symbol 51 MovieClipUses:50Used by:Timeline
Symbol 52 MovieClipUsed by:Timeline
Symbol 53 FontUsed by:5 45 54 55 64 65 68
Symbol 54 TextUses:53Used by:56
Symbol 55 TextUses:53Used by:56
Symbol 56 MovieClipUses:54 55Used by:59
Symbol 57 GraphicUsed by:58 66
Symbol 58 MovieClipUses:57Used by:59
Symbol 59 MovieClipUses:56 58Used by:Timeline
Symbol 60 TextUses:6Used by:62
Symbol 61 GraphicUsed by:62
Symbol 62 ButtonUses:60 61Used by:Timeline
Symbol 63 GraphicUsed by:Timeline
Symbol 64 TextUses:53Used by:66
Symbol 65 TextUses:53Used by:66
Symbol 66 MovieClipUses:57 64 65Used by:Timeline
Symbol 67 TextUses:28Used by:Timeline
Symbol 68 EditableTextUses:53Used by:Timeline
Symbol 69 FontUsed by:5 45 70 72 74 76 80
Symbol 70 TextUses:69Used by:Timeline
Symbol 71 GraphicUsed by:73 75 77
Symbol 72 TextUses:69Used by:73
Symbol 73 ButtonUses:71 72Used by:Timeline
Symbol 74 TextUses:69Used by:75
Symbol 75 ButtonUses:71 74Used by:Timeline
Symbol 76 TextUses:69Used by:77
Symbol 77 ButtonUses:71 76Used by:Timeline
Symbol 78 GraphicUsed by:79
Symbol 79 MovieClipUses:78Used by:Timeline
Symbol 80 EditableTextUses:69Used by:Timeline

Instance Names

"logo"Frame 1Symbol 15 MovieClip
"mVel"Frame 2Symbol 27 MovieClip
"txt1"Frame 2Symbol 29 EditableText
"txt2"Frame 2Symbol 30 EditableText
"bMe"Frame 2Symbol 31 EditableText
"bAi"Frame 2Symbol 32 EditableText
"b0"Frame 2Symbol 35 MovieClip
"b10"Frame 2Symbol 37 MovieClip
"zz"Frame 2Symbol 38 MovieClip
"b3"Frame 2Symbol 40 MovieClip
"zz1"Frame 2Symbol 41 MovieClip
"controller"Frame 3Symbol 51 MovieClip
"bouncer"Frame 3Symbol 52 MovieClip
"scored"Frame 3Symbol 59 MovieClip
"but"Frame 4Symbol 66 MovieClip
"bbx1"Frame 4Symbol 79 MovieClip
"bbx2"Frame 4Symbol 79 MovieClip
"bbx3"Frame 4Symbol 79 MovieClip
"mes"Frame 4Symbol 80 EditableText
"progress"Symbol 15 MovieClip Frame 1Symbol 11 MovieClip
"player"Symbol 25 MovieClip Frame 1Symbol 22 MovieClip
"player"Symbol 25 MovieClip Frame 1Symbol 22 MovieClip
"tg1"Symbol 25 MovieClip Frame 1Symbol 24 MovieClip
"tg2"Symbol 25 MovieClip Frame 1Symbol 24 MovieClip

Special Tags

ExportAssets (56)Timeline Frame 1Symbol 1 as "shot"
ExportAssets (56)Timeline Frame 1Symbol 2 as "muzica"




http://swfchan.com/3/11779/info.shtml
Created: 6/6 -2019 20:14:54 Last modified: 6/6 -2019 20:14:54 Server time: 22/12 -2024 22:46:45