STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229595 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2595 · P5190 |
A Very Merry Christmas! |
This is the info page for Flash #69023 |
CLICK TO START |
ActionScript [AS1/AS2]
Frame 1function addPiece() { var p = this.attachMovie("piece", "piece" + aPieceList.length, aPieceList.length); p._x = aPieceList[aPieceList.length - 1]._x; p._y = aPieceList[aPieceList.length - 1]._y; aPieceList.push(p); } function moveFood() { var moveIt = true; while (moveIt) { food._x = Math.floor(Math.random() * uwh) * unit; food._y = Math.floor(Math.random() * uwh) * unit; moveIt = false; var i = 0; while (i < aPieceList.length) { if ((aPieceList[i]._x == food._x) && (aPieceList[i]._y == food._y)) { moveIt = true; } i++; } } } function gameOver() { delete this.onEnterFrame; tScore.text = "You Lose. Score: " + score; canMove = false; } function startGame() { var i = (aPieceList.length - 1); while (i >= 0) { aPieceList[i].removeMovieClip(); aPieceList.pop(); i--; } score = 0; var p = this.attachMovie("piece", "piece" + aPieceList.length, aPieceList.length); aPieceList.push(p); p._x = 10 * unit; p._y = 10 * unit; var food = this.attachMovie("food", "food", -1); var c = 0; moveFood(); var startingLength = 3; var i = 1; while (i < startingLength) { addPiece(); i++; } this.onEnterFrame = function () { canMove = true; tScore.text = score; var i = (aPieceList.length - 1); while (i > 0) { aPieceList[i]._x = aPieceList[i - 1]._x; aPieceList[i]._y = aPieceList[i - 1]._y; i--; } if (dir == 0) { aPieceList[0]._y = aPieceList[0]._y - unit; } else if (dir == 1) { aPieceList[0]._x = aPieceList[0]._x - unit; } else if (dir == 2) { aPieceList[0]._y = aPieceList[0]._y + unit; } else if (dir == 3) { aPieceList[0]._x = aPieceList[0]._x + unit; } if ((aPieceList[0]._y / unit) == 20) { aPieceList[0]._y = 0; } else if ((aPieceList[0]._y / unit) == -1) { aPieceList[0]._y = 19 * unit; } else if ((aPieceList[0]._x / unit) == -1) { aPieceList[0]._x = 19 * unit; } else if ((aPieceList[0]._x / unit) == 20) { aPieceList[0]._x = 0; } if ((aPieceList[0]._x == food._x) && (aPieceList[0]._y == food._y)) { score = score + ((10 * aPieceList.length) / 2); moveFood(); addPiece(); } var i = 1; while (i < aPieceList.length) { if ((aPieceList[0]._x == aPieceList[i]._x) && (aPieceList[0]._y == aPieceList[i]._y)) { gameOver(); } i++; } }; } var unit = 15; var uwh = 20; var canMove = false; var dir = 2; var score = 0; aPieceList = new Array(); mouseListener = new Object(); mouseListener.onMouseDown = function () { if (!canMove) { canMove = true; startGame(); } }; Mouse.addListener(mouseListener); k = new Object(); k.onKeyDown = function () { var k = Key.getCode(); if (((k == 38) && (dir != 2)) && (canMove)) { dir = 0; canMove = false; } else if (((k == 37) && (dir != 3)) && (canMove)) { dir = 1; canMove = false; } else if (((k == 40) && (dir != 0)) && (canMove)) { dir = 2; canMove = false; } else if (((k == 39) && (dir != 1)) && (canMove)) { dir = 3; canMove = false; } }; Key.addListener(k);
Library Items
Symbol 1 Graphic | Used by:2 | |
Symbol 2 MovieClip [body] | Uses:1 | |
Symbol 3 Graphic | Used by:4 | |
Symbol 4 MovieClip [food] | Uses:3 | |
Symbol 5 Graphic | Used by:6 | |
Symbol 6 MovieClip [piece] | Uses:5 | |
Symbol 7 Graphic | Used by:Timeline | |
Symbol 8 Font | Used by:9 | |
Symbol 9 EditableText | Uses:8 | Used by:Timeline |
Symbol 10 Sound | Used by:Timeline |
Instance Names
"tScore" | Frame 1 | Symbol 9 EditableText |
Special Tags
ExportAssets (56) | Timeline Frame 1 | Symbol 2 as "body" |
ExportAssets (56) | Timeline Frame 1 | Symbol 4 as "food" |
ExportAssets (56) | Timeline Frame 1 | Symbol 6 as "piece" |
|