PDA

View Full Version : [ElectricGrandpa Entry 1] - ThinkFast Game



ElectricGrandpa
January 15th, 2006, 07:51 PM
This is my first entry, a game named ThinkFast.

It's 24 lines long and fully playable. It even stores your best score in a shared object.



//ThinkFast
//Created by Matt Rix(ElectricGrandpa) for the '25 Line AS Contest' on www.kirupa.com
//
//1
var tf_so:SharedObject = SharedObject.getLocal("tf_personalBest");
//2
(tf_so.data.score == undefined) ? tf_so.data.score=0 : null;
MovieClip.prototype.drawShape = function(p_x:Number, p_y:Number, p_thickness:Number, p_color:Number, p_alpha:Number, p_coordinates:Array) {
//3
this.lineStyle(p_thickness, p_color, p_alpha);
//4
for (var d:Number = 0; d<p_coordinates.length; d++) {
//5
this.lineTo(p_x+p_coordinates[d][0], p_y+p_coordinates[d][1]);
}
};
function countDown(p_level:Number):Void {
//6
this.status_txt.text = "Click on the shape that's been rotated! You've only got "+(timer-1)+" "+(((timer-1) == 1) ? " second " : " seconds ")+"left! Level "+p_level+" Your personal best is "+(tf_so.data.score);
//7
timer--;
//8
(timer == 0) ? startRound(1) : null;
}
function startRound(p_level:Number) {
//9
itemHolder_mc = this.createEmptyMovieClip("itemHolder_mc", 10);
//10
itemHolder_mc["item"+0+"_mc"] = itemHolder_mc.createEmptyMovieClip("item"+0+"_mc", 0);
//11
itemHolder_mc["item"+0+"_mc"].drawShape(0, 0, 2, random(Math.min(14000000, ((p_level*p_level)*500)+random((p_level*p_level)*5 00))), 100, [[random(100)-100/2, random(100)-100/2], [random(100)-100/2, random(100)-100/2], [random(100)-100/2, random(100)-100/2], [random(100)-100/2, random(100)-100/2], [random(100)-100/2, random(100)-100/2]]);
//12
for (var i:Number = random(p_level)+3; i>=0; i--) {
//13
(i != 0) ? itemHolder_mc["item"+0+"_mc"].duplicateMovieClip("item"+i+"_mc", i, {_x:50+random(700), _y:80+random(180), _alpha:Math.max(50, (100-random(p_level*.1))), level:p_level}) : itemHolder_mc["item"+0+"_mc"].removeMovieClip();
}
//14
itemHolder_mc["item"+1+"_mc"]._rotation = 50+random(260);
//15
(tf_so.data.score<itemHolder_mc["item"+1+"_mc"].level) ? tf_so.data.score=itemHolder_mc["item"+1+"_mc"].level : null;
//16
timer = 6;
//17
clearInterval(countDownInterval);
//18
countDownInterval = setInterval(this, "countDown", 1000, p_level);
//19
countDown(p_level);
}
this.onMouseDown = function():Void {
//20
((Math.sqrt(Math.pow((this._xmouse-itemHolder_mc.item1_mc._x), 2)+Math.pow((this._ymouse-itemHolder_mc.item1_mc._y), 2)))<50) ? startRound(itemHolder_mc["item"+1+"_mc"].level+1) : startRound(1);
};
//21
this.createTextField("status_txt", 20, 5, 0, 800, 20);
//22
this.status_txt.selectable = false;
//23
Stage.scaleMode = "noScale";
//24
startRound(1);


Try it out, let me know what you think! My best score so far is around 125(although with a little luck and perseverance, it'd be possible to break 1000).

-Matt

kdd
January 15th, 2006, 08:37 PM
that's cool...
edit: best 19... uhhh, that green color... :P

ElectricGrandpa
January 15th, 2006, 09:25 PM
haha, yeah the colours get harder as you go, but it's all kinda randomized.

ElectricGrandpa
January 15th, 2006, 09:32 PM
Oh yeah, and if you come to a hard one, take almost the full 5 seconds to make sure you're right... It gets harder than just the colours too, after a while everything starts to fade a bit, and of course there are more objects... I've tested it on level 1000 and it's still possible to beat the levels, I got from about 1000 to 1013 before messing up.

hybrid101
January 16th, 2006, 06:45 AM
nice game, couldn't go past 10..

NiñoScript
January 16th, 2006, 08:58 AM
good game :)
i reached 34, but in that level all looked the same :P

mayur.bais
January 16th, 2006, 09:06 AM
too good...:)

ahmed
January 16th, 2006, 09:15 AM
haha yeah that's too good :)

very nice work

ElectricGrandpa
January 16th, 2006, 11:55 AM
Yeah it takes some practice, it basically all comes down to pattern recognition, but it's true, some levels could be nearly impossible.

kathari
January 17th, 2006, 03:54 PM
I stopped at 28 then nothing happened and I sincerely think I must have been right about some of them:puzzled:Ah now I understand... Fun

Jeff Wheeler
January 17th, 2006, 04:39 PM
My friend's best is 22. I got 3 :(

lunatic
January 17th, 2006, 04:50 PM
I got to 52. :) But then there were so many of them and they started to overlap and I couldn't pick out the different one.

Very nice EG - that was fun. :thumb:

ElectricGrandpa
January 17th, 2006, 05:50 PM
Thanks :) Yeah you have to look really closely for overlapping lines on the later levels. Remember to take the full 4-5 seconds if you can... you shouldn't really ever have to guess.

Oh, and 52 is really good :)

lunatic
January 17th, 2006, 05:57 PM
Thanks!

I meant guessing as in - I could see one that was different but it was in a big pile of ones that were correct and I ran out of time trying to pick it out from the tangle. :D

Gonna try again when I get home.

The first time I played I thought one was drawn different so I couldn't get above 6 (and those must have been lucky guesses)! :P I finally caught on when you said something about pattern recognition.

ElectricGrandpa
January 17th, 2006, 06:19 PM
yeah they were originally going to be drawn differently, and I don't think I ever changed the wording...

lunatic
January 17th, 2006, 08:52 PM
88. That's a fun game. :D

ElectricGrandpa
January 18th, 2006, 12:09 AM
Awesome score :D I'll have to practice to beat that one, I have a feeling that my score of 125 was a huge fluke because I haven't been able to get anywhere close since...

lunatic
January 18th, 2006, 01:18 PM
lol, its all about letting your eyes go fuzzy isn't it? just trying to find that one line that zags when all the others zig. I'm glad your hit test is very forgiving - especially when they get really piled up!

Funny, after awhile the ones with fewer choices are harder than the ones where there are many!

DDD
January 18th, 2006, 01:49 PM
I got to 25 on luck alone. SOmetimes I just chose one. Ingenious game, never saw anything like this one.

ElectricGrandpa
January 18th, 2006, 02:00 PM
Yeah the hittest is very forgiving, I think as long as you're within 50 pixels or so, you're fine, and the ones with 3 choices mess me up too after a while, because you have to think a bit harder to figure out which shape is different :D

lunatic
January 18th, 2006, 03:08 PM
Yeah and add to that the super bright green and super bright blue ones. I can hardly look at the screen! :P

dbarbarian
January 18th, 2006, 03:13 PM
At first I thought this game was a too hard, so I never bothered to try harder.
BUT, that was before I read that the shapes are actually not drawn differently but rahter positioned differently. I had such a hard time trying to figure out which one was drawn differenlty....no wonder I could never win.

Now that I know how to actually play, this game is actually very addicting.
Great job! I just wish there was some notice or a change in color of the background that tells you when you have lost.
I got really far into it one second, and after a while i looked up at the score and it was 12. I never knew I messed up.
:thumb2:

lunatic
January 18th, 2006, 03:24 PM
lol the exact same thing happenned to me. I got to the point where i was so determined to beat my high score (52 at the time) that I kept losing seconds checking me score. Or I'd think I was doing great only to realize that it got easier because I had started over. :P

ElectricGrandpa
January 18th, 2006, 08:32 PM
Yeah I'm going to be going over the code to make it much more efficient, I'm hoping to eliminate 5-10 lines... Then I'm going to put in some code to increase the usability(loss notification), and code to make it look pretty, because right now it's quite ugly... A lot of which is caused by the ugly font... so I'll have to see.

lunatic
January 18th, 2006, 08:34 PM
Awesome. Can't wait to see the finale. :thumb:

SimplyArun
January 25th, 2006, 02:11 PM
this is pretty addictive and it's an original idea. hat's off to you dude :thumb2:

my best was 39

calvintage
January 25th, 2006, 09:12 PM
72 here... cool stuff.

aphello
January 26th, 2006, 05:44 PM
Wow...played for 25 minutes straight... Addictive man.
hit 92 once!
Sad thing is that my xbox is sitting 10 feet away.... haha

GPP
January 29th, 2006, 09:16 PM
Addicting!

ElectricGrandpa
January 31st, 2006, 11:32 PM
Thanks everyone!

Unfortunately I've been so busy with work that I haven't had time to make the improved version of this game, or any of the other 25 line ideas I've had :( Ah well, maybe next time.