PDA

View Full Version : Type Tiny Tim To The Top!



squan
January 16th, 2006, 12:39 AM
Tiny Tim needs to visit his grandmother but he can 't reach the buttons, will you help him with your hacker-skills? Just type the upcoming characters as fast as you can to help Tiny Tim!



//------------------:::::::::::::::::::::::::::::::::-------------------\\
//-------------------:: Type Tiny Tim To The Top!!! ::--------------------\\
//--------------------:::::::::::::::::::::::::::::::::---------------------\\


//---------------:: Set-up ::---------------\\

//1
Stage.scaleMode = "noScale";
//2
this.createEmptyMovieClip("elevator_mc", this.getNextHighestDepth());
//3
elevator_mc.lineStyle(4, 0x000000, 100);
//4
elevator_mc.moveTo(-30,70);
//5
var elevator_arr:Array = [30,70, 30,40, 28,40, 28,36, 30,36, 30,38, 30,0, -30,0, -30,70, 5,70, 8,60, 8,53, 2,47, 8,53, 10,53, 10,49, 9,47, 10,45, 11,45, 12,47, 10,49, 12,53, 19,47, 12,53, 12,60, 15,70]
//6
for (i = 0; i < elevator_arr.length-1; i=i+2) {
//7
elevator_mc.lineTo(elevator_arr[i],elevator_arr[i+1]);
}
//8
this.createTextField("status_txt", this.getNextHighestDepth(), 10, 16, 280, 260);
//9
status_txt.html = true;
//10
status_txt.multiline = true;
//11
var keyListener:Object = new Object();
//12
Key.addListener(keyListener);


//---------------:: Functions ::---------------\\

setUp = function() {
//13
elevator_mc._y = 400;
//14
elevator_mc._x = 150;
//15
score = 0;
//16
charOutput();
}

charOutput = function() {
//17
elevator_mc._y -= elevator_mc._y/27;
//18
status_txt.htmlText = "<font face='Verdana, Arial, Helvetica' size='12'><b><font size='14'> Type Tiny Tim To The Top!!!</font></b><br><br><font size='10'><i>Tiny Tim wants to pay his grandmother a visit in the<br>hospital, but Tiny Tim faces a big problem! Tiny Tim<br>can 't reach the buttons of the elevator and grandma<br>is on the tenth floor! As Tiny Tim is desperately<br>trying to reach for the buttons, other people are<br>calling the elevator down. Luckily for Tiny Tim, you,<br>teh w0rld's m0st 133t-h@cK3r, are willing to help<br>Tiny Tim by hacking into the hospital's mainframe-<br>computer and overriding the elevator's commands.<br>Click Tiny Tim to start or replay, good luck!</i></font<br><br><br>|| score: " + score + " || next override-command: <b><font face='courier new' size='16' color='#FF0000'>" + String.fromCharCode(Math.round(Math.random()*(122-97)+97)) + "</font></b> ||<br><br>_________________| |________________<br> | | <br> | | <br> | | <br> |____________| </font>";
}

keyListener.onKeyDown = function() {
//19
(String(status_txt.text).charCodeAt(String(status_ txt.text).length-323) == Key.getAscii()) ? charOutput(score++): null;
}

elevator_mc.onRelease = function() {
//20
setUp();
//21
onEnterFrame = function() {
//22
(elevator_mc._y > (Stage.height - elevator_mc._height -5)) ? Key.removeListener() : elevator_mc._y += 0.4;
//23
(elevator_mc._y > (Stage.height - elevator_mc._height -5)) ? status_txt.htmlText = "<font face='Verdana, Arial, Helvetica' size='12'><b><font size='14'> Type Tiny Tim To The Top!!!</font></b><br><br><br><font size='10'><i>Aaawwhh, guess we weren't as 133t as we thought<br>we were huh ... Your <font color='#FF0000'><b>" + score + "</b></font> overrides just weren't enough<br>to help Tiny Tim reach his grandmother. He sure is a<br>sad sad little boy now ...<br><br>Play again by clicking on Tiny Tim.</i></font>" : null;
//24
(elevator_mc._y < (210)) ? status_txt.htmlText = "<font face='Verdana, Arial, Helvetica' size='12'><b><font size='14'> Type Tiny Tim To The Top!!!</font></b><br><br><br><font size='10'><i>You did it! Oh Jolly! You helped Tiny Tim visit his<br>grandmother, with only <font color='#FF0000'><b>" + score + "</b></font> overrides needed! Oh boy,<br>Tiny Tim sure was happy! Well at first he was that is,<br>turned out his grandmother just died that day ...<br>Ah well, sh*t happens I guess!<br><br>Play again by clicking on Tiny Tim.</i></font>" : null;
}
}

//25
setUp();

Let me know about the difficulty, too easy, too hard ... too boring ... :nerd:

EDIT: removed the capitals, as it was too hard for some this way :p

also findable @: Type Tiny Tim To The Top! (http://www.nindo.be/TTTTTT)

unchew
January 16th, 2006, 12:48 AM
That is awesome! ...except for the fact that I'm to lazy to keep changing the caps lock all the time :P

ElectricGrandpa
January 16th, 2006, 02:16 AM
Pretty sweet, but it might actually be more fun if there were no capital letters.

icio
January 16th, 2006, 05:28 AM
Doc "It's ok, son. Grandma's going to be just fine... thanks to l33t02-h4X0r, icio :thumb2:"

danulf
January 16th, 2006, 06:15 AM
It's a bit too hard with the capital letters :D Really fun though! Great if you want to learn to write without looking at the keyboard!

hybrid101
January 16th, 2006, 06:46 AM
take the capital letters out! it's pretty hard with those caps

squan
January 16th, 2006, 06:55 AM
Cool, taking out the capitals leaves me room for an extra line, rejoice! :)

My little brother inspired me to make this, as he is now learning to type. Glad you guys like it!

EDIT: btw, my record is 35 overrides only needed, feel free to post your highscores here. :p:

EDIT2: a friend of mine has the topscore for now, she only needed an insane 31 overrides, the freak. :)

Seb Hughes
January 16th, 2006, 12:02 PM
wow its har,d and its very nice, what happen when you get it into the thingy?

squan
January 16th, 2006, 12:05 PM
For me to know, for you to find out ;) But if you dig in the AS, you'll find it pretty easily.

It's not that hard imo, only if you can't type blind with both hands ... but think of it as a challenge/practice then. :)

lunatic
January 18th, 2006, 07:36 PM
Got it in 28. :D

At first it didn't work for me - elevator never went down and it kept going up until it was out of the browser window. I couldnt' figure out what was going on. Clicking on "tiny tim" a few times made it happen.

I seem to have trouble making it work in Firefox - text just disappears. Also, it would be great if there was a countdown to start after clicking on Tim. You waste a sec or two getting from mouse to keyboard. But that's a nitpicky thing.

Nice work! :thumb:

squan
January 18th, 2006, 09:00 PM
Got it in 28. :D

At first it didn't work for me - elevator never went down and it kept going up until it was out of the browser window. I couldnt' figure out what was going on. Clicking on "tiny tim" a few times made it happen.

I seem to have trouble making it work in Firefox - text just disappears. Also, it would be great if there was a countdown to start after clicking on Tim. You waste a sec or two getting from mouse to keyboard. But that's a nitpicky thing.

Nice work! :thumb:

Yeah, I had a line or 2 to spare so I coded in a bug that would mess up your browser and crash your HD eventually ... Thought that would be fun ...

j/k, that's just weird, seeing as it's just basic AS and that very little can go wrong ... :)


And 28!? Damn! Wait till I tell my friend and my sister, they both were so proud of their 29's! :d