home *** CD-ROM | disk | FTP | other *** search
- function levels()
- {
- cursor.swapDepths(_root.k++);
- cursor._rotation = (cursor._x - 275) / 6;
- }
- function drawing()
- {
- if(tool == true)
- {
- tap = Math.round(Math.random() * 16777215);
- var _loc1_ = new Color(cursor.crayon.cray);
- _loc1_.setRGB(tap);
- drawingArea.holder.moveTo(prevx,prevy);
- drawingArea.holder.lineStyle(3,tap,70);
- drawingArea.holder.lineTo(cursor._x,cursor._y);
- drawingArea.holder.moveTo(prevx,prevy);
- drawingArea.holder.lineStyle(6,tap,20);
- drawingArea.holder.moveTo(prevx,prevy);
- drawingArea.holder.lineStyle(8,tap,10);
- drawingArea.holder.lineTo(cursor._x + random(6) - 3,cursor._y + random(6) - 3);
- }
- prevx = cursor._x;
- prevy = cursor._y;
- }
- function clearDrawing()
- {
- trace("Drawing Cleared!");
- drawingArea.removeMovieClip();
- attachMovie("drawingArea","drawingArea",_root.k++);
- }
- function attachLevel()
- {
- shell.removeMovieClip();
- if(_root.level > 20)
- {
- _root.nextFrame();
- _root.cstatus = 0;
- }
- else
- {
- attachMovie("cut_" + level,"shell",_root.k++);
- level++;
- levelDisp = "Level " + (level - 1) + " of 20";
- runOnce = true;
- currentStar = 0;
- levCounter = 0;
- levSubSeconds = 0;
- levSeconds = 0;
- }
- }
- function numbered()
- {
- i = 0;
- while(i < totalStars)
- {
- shell[i].num = i + 1;
- i++;
- }
- }
- function resetStars()
- {
- trace("reset stars");
- j = 0;
- while(j <= i)
- {
- shell[j].gotoAndStop(1);
- j++;
- }
- currentStar = 0;
- cleared = true;
- clearDrawing();
- }
- function hitStar()
- {
- i = 0;
- while(i < totalStars)
- {
- if(shell[i].hitTest(cursor.point))
- {
- if(i == currentStar)
- {
- currentStar++;
- shell[i].play();
- currentSound = new Sound(this);
- currentSound.attachSound(i + 1);
- currentSound.start(0,1);
- j = 0;
- while(j < 10)
- {
- b = attachMovie("miniStar","miniStar" + k,k++);
- b._x = shell[i]._x;
- b._y = shell[i]._y;
- b._rotation = random(360);
- b._xscale = random(50);
- b._yscale = b._xscale;
- j++;
- }
- if(i < totalStars - 1)
- {
- b = attachMovie("starOutline","starOutline",k++);
- b._x = shell[i + 1]._x;
- b._y = shell[i + 1]._y;
- }
- if(currentStar == totalStars)
- {
- winLevel();
- }
- }
- else if(shell[i]._currentframe == 1)
- {
- b = attachMovie("starOutline2","starOutline2",k++);
- b._x = shell[currentStar]._x;
- b._y = shell[currentStar]._y;
- resetStars();
- badSound.start(0,1);
- tool = "false";
- }
- }
- i++;
- }
- }
- function winLevel()
- {
- goodSound.start(0,1);
- w = 0;
- while(w < 20)
- {
- a = _root.attachMovie("miniStar","miniStar" + k,k++);
- a._x = shell[currentStar - 1]._x;
- a._y = shell[currentStar - 1]._y;
- a._rotation = random(360);
- a._xscale = random(400);
- a._yscale = a._xscale;
- tap = Math.round(Math.random() * 16777215);
- var _loc2_ = new Color(a);
- _loc2_.setRGB(tap);
- w++;
- }
- tool = "false";
- drawingArea.play();
- f = _root.attachMovie("levelTime","levelTime",k++);
- levelTimeDisp = levSeconds + "." + levSubSeconds + " Seconds!";
- }
- function timer()
- {
- counter++;
- levCounter++;
- subSeconds += 2;
- levSubSeconds += 2;
- if(counter == 50)
- {
- counter = 0;
- subSeconds = 0;
- seconds++;
- }
- if(levCounter == 50)
- {
- levCounter = 0;
- levSubSeconds = 0;
- levSeconds++;
- }
- secondsDisp = seconds + "." + subSeconds;
- }
- trace("///////////////////////////////////////////////////////////");
- trace("//Scribble //");
- trace("//By jmtb02, protected by copyright and the CC license //");
- trace("//For more information, visit http://www.jmtb02.com/ //");
- trace("//Contact John Cooney, jmtb02@gmail.com //");
- trace("///////////////////////////////////////////////////////////");
- trace(" ");
- trace(" ");
- cursor.startDrag(true);
- Mouse.hide();
- _root.cstatus = 1;
- badSound = new Sound(this);
- badSound.attachSound("badHit");
- goodSound = new Sound(this);
- goodSound.attachSound("coin");
- temp = 0;
- totalStars = 9;
- runOnce = false;
- k = 10;
- done = false;
- prevx = cursor._x;
- prevy = cursor._y;
- tool = false;
- level = 1;
- levelDisp = "Level " + (level - 1) + " of 20";
- var counter = 0;
- var seconds = 0;
- var subSeconds = 0;
- var levCounter = 0;
- var levSeconds = 0;
- var levsubSeconds = 0;
- var num = 0;
- var finalScore;
- attachLevel();
- attachMovie("drawingArea","drawingArea",_root.k++);
- onEnterFrame = function()
- {
- if(_root.cstatus == 1)
- {
- timer();
- drawing();
- levels();
- numbered();
- if(tool == true)
- {
- hitStar();
- cleared = false;
- }
- if(tool == false)
- {
- if(cleared == false)
- {
- cleared = true;
- clearDrawing();
- }
- }
- }
- };
- onMouseDown = function()
- {
- if(cursor.point.hitTest(shell["0"]))
- {
- tool = true;
- trace("tool on--------------------->");
- }
- };
- onMouseUp = function()
- {
- if(currentStar < totalStars && tool == true)
- {
- resetStars();
- tool = false;
- }
- trace("tool off------------------------>");
- };
- stop();
-