Fast Key Pressing Game (Help Please)

Hello there, (if anyone can help me then it is you guys) can someone please help me here with my idea of a game (that I’m going to explain here) Here’s an overview of what I’ll be using:

  1. Flash MX

As for the game idea:

The aim of the game is to press a key (or just the mouse button over a particular spot) as fast as you can in order to see what will happen next (there is already an animation playing even before you start pressing the key or mouse) but the challenge is the computer is also “pressing” a key and is racing you to the total required. If you win, you go to a particular end cinema, and also if you lose to the computer.

ex.
Total needed = 1000
1 click or press = 100
computerclickrate = 1 every 2 seconds.
userclickrate = depends on how fast you press or click

You click or press a key 10 times in less than 20 seconds. This makes you win (given the case in our example) and in effect, this gives you your Winning End screen (or if I want to make the game longer, I’ll just give the total needed a new value).

If you fail to press it 10 times in less than 20 seconds then you lose, and you go to the Losing End screen.

Anyway, here are some more conditions I don’t exactly know how to implement using flash.

a. The Computer assesses your clicking or pressing rate. If you are 10 clicks/presses faster than it, then it would adjust its clicking rate to 1 click faster than yours. If you are not 10 clicks/presses faster than it’s clicking or pressing rate, then it won’t change its clicking rate.


So that’s the general idea of the game. So to sum it up, I want your help to make a game that tries to beat the players clicking speed by adjusting its own rate, then upon reaching a total value (either by you or the computer) a specific animation plays.

Just in case you want to know how I picture the game in my mind:

A. Animation of 2 guys fighting it out.

B. If you are clicking faster than the computer’s clicking rate, then the animation to play is the one where your character is beating up the computer’s character.

C. If the computer’s clicking rate is faster than yours then the animation played is the one where the computer is beating up your character.

D. If the total is reached, then a specific animation will play, THEN a new higher total is set, and the computer’s clicking rate becomes 1.5 times faster than the value it had before. Also, new fighting animations replace the previous ones.

Well, thanks for your time guys, I really hope you could help me out with this project of mine=)

You mean… Something like this ?? :smiley:

pom 0]

You can get it here : membres.lycos.fr/museebra…ckRate.fla

The principle is easy : You increment the number of clicks onMouseDown, you get the time elapsed since the beginning, and you divide one by the other.

  _root.onLoad = function () {
        nbClick = 0 ;
        rate = 0 ;
}

_root.onMouseDown = function () {
        nbClick ++ ;
        this.onEnterFrame = function () {
                time = getTimer () ;
                now = (time - start)/1000 ;
                rate = Math.round(nbClick/now*100)/100 ;
                pressRate = rate + " clicks ps" ;
        }
}

pressRate is my textbox. And I initialize the variable ‘start’ with the button.

pom 0]

Your post is very helpful! Thanks again, maybe I’ll show you later on what the output will look like hehehe… thanks again and have a fun time…

well I’ve been wondering about how we can make it in flash mx so that when my rate is faster than the computer’s current rate, the computer will adjust so that it will beat the user’s clicking rate? Thanks again…

*I’m just wondering if we can actually use if-then statements here in flash, as well as other styles… hmmm

Create a textbox named compRate and then add this code at the end of the previous one :

   if (rate>compRate) compRate += 0.1 ;

pom 0]

Should give something like this :

Hey thanks a lot for the tip… now I can continue on my happy coding lol… have a nice time.

Hi again… now I’ve been trying to implement a timer countdown in the game. I tried setting a variable in it, then adding a “gtout --” (gtout is the name of my timer)
but it quickly becomes a negative number.

  1. I need to make it count down 1 number every second (like one round lasts for 5 seconds, I want to see the 5 seconds slowly count down while I’m mashing on the clickable button to raise my click rate).

Then after the timer reaches zero, I’ll play a new animation showing who gets hurt, then the timer will reset back to 5 seconds and we continue playing.

Thanks again in advance…

Check this, it might help you… pub40.ezboard.com/fkirupa…=837.topic

pom 0]

I’ve finally gotten it lol! Thanks for the help heheh…