need Help please!!

Game Editor comments and discussion.

need Help please!!

Postby XXGamexGodXX » Mon Jul 16, 2007 10:18 pm

I want to make a countDOWN timer...could someone please show me how to do this
XXGamexGodXX
 
Posts: 5
Joined: Thu Jul 12, 2007 2:11 am
Score: 1 Give a positive score

Postby d-soldier » Tue Jul 17, 2007 12:28 am

You cloud create a text actor and in it's create actor script put:
textNumber = 30;
and add a createtimer event for every 1000 ms (which would be 1 second)
then in the timer event for that timer put:
textNumber -= 1;

and in the text actor's draw actor event put:
if(textNumber == 00)
{
insert what you want to happen here;
}

Also, follow the forum rules and avoid using subject titles like "need help!" and such so people searching the forum can tell what each topic is about without having to click on it.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Jay S. » Tue Jul 17, 2007 12:33 am

Create an integer Variable called "count" and set it to how many seconds you want the player to have. Example:
Code: Select all
count=100;

Then, on a Create Actor event for an actor, select "Create Timer." Assuming you want your timer to count down in seconds, make "Time (ms)" 1000, and set "Repeat" to "Specify Quantity" and have "Count" to 1. Now, on a "Timer" event for the actor, select your timer and then in Script Editor type:
Code: Select all
count-=1;

Now on a Draw Actor event for an actor, type in Script Editor:
Code: Select all
if(count<=0)
{
    //your actions here...
}


If you would like to have the player see how many seconds they have left, create a text actor and in Draw Actor event for this actor, type in Script Editor:
Code: Select all
text_actor.textNumber=count;


EDIT: d-soldier beat me. :roll:

:lol:
User avatar
Jay S.
 
Posts: 118
Joined: Thu Apr 26, 2007 6:51 pm
Location: My computer desk. :P
Score: 9 Give a positive score

Postby d-soldier » Tue Jul 17, 2007 1:51 am

I beat you sure, but I think your way is probably better. :D
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby XXGamexGodXX » Tue Jul 17, 2007 2:35 am

okay i will keep the rules in mind...and thank you for the help
XXGamexGodXX
 
Posts: 5
Joined: Thu Jul 12, 2007 2:11 am
Score: 1 Give a positive score

Re: need Help please!!

Postby paperboy321 » Mon Jun 09, 2008 11:32 pm

d-soldier I am making a game where you have a score and a timer countdown. You have to push the right arrow key as many times as you can before the timer goes to zero. I followed your instructions and it worked.I set the timer for 15 sec, I want the key down(the right key ) to be disabled when the timer reaches zero, but you can still push the right arrow key to get more points. Can you tell me how to disable the ability to push the right arrow key (get more points).
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: need Help please!!

Postby Caaz Games » Mon Jun 09, 2008 11:35 pm

this was posted like a year ago and i dont thing dsd gets online here anymore.
You are welcome to join my forum. 4 active members lol but it's a cool place. active... much talking :D it's fun!
http://caaz.freeforums.org/
User avatar
Caaz Games
 
Posts: 729
Joined: Wed Feb 14, 2007 9:09 am
Location: California....knows how to party!
Score: 25 Give a positive score

Re: need Help please!!

Postby paperboy321 » Tue Jun 10, 2008 12:04 am

:( yeah I know
PaPeR BoY
User avatar
paperboy321
 
Posts: 67
Joined: Mon Jun 09, 2008 11:08 pm
Score: 0 Give a positive score

Re: need Help please!!

Postby DST » Tue Jun 10, 2008 2:38 am

simple way: multiplier.
Multiplier is a very simple way to enable/disable without using a lot of code. Create another variable, and use it on your scoring. You don't need to use count variable in that manner either. All you need is the timer.

Like this

KeyDown>KeyRight
Code: Select all
Score+=value*enable;


That sure was simple, eh?

So score is your score variable, the one that your text actor will display. Value is how many points the player scores each time he hits the right key. and enable is a variable that's either 1 or 0. You set it to 1 whenever you want the player to be able to use keydown>keyright.

And on the timer
Code: Select all
enable=0;


Technically the player can still push right, and get a score, but the points are worth 0.

Of course if you have other actions on key right, and you want to disable them all, then you can still use if (enable>0){};

Same effect.

But the nice thing about the multiplier is you can use it for bonuses. Like if a player gets 10 in a row, points suddenly are worth double.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron