How do I create a Starting Countdown like Racing Game?

Get help using Construct 2

Post » Tue Oct 25, 2016 8:25 am

Hello Construct 2 Experts,

I'm trying to make a racing game using Construct 2, usually in racing game, before they started the race, they have a countdown like " 3 , 2 , 1 , GO!! " right ??... So any idea how to make that countdown?

Currently my game, after press "PLAY" button in the start page, the car usually straight to move. But now i want it to pause for a while until the countdown is done then the car will move.

Hope you guys get the picture and understand what i intend to do.
Looking forward for your reply.

Kindly Regards,
Razuan
Beginner Game Developer
B
3
Posts: 8
Reputation: 187

Post » Tue Oct 25, 2016 8:43 am

There are two ways that spring to mind:

Either when racing starts you use [ System>Set time scale ] to set the time scale to 0 - which will pause the game. You can then update the counter (either a sprite with animation frames, or a text object) using [ System>Every X Seconds ], and when the counter hits 'Go' or 'Race' or whatever, set the timescale back to 1. The disadvantage here is that animations won't run whilst the timer counts down.

Alternatively, you could disable the parts of your game that allow racing to take place (so disable the car behaviour on the player and other racers, and hold any timers you might be running, until the timer has counted down. At which point you enable the car behaviours etc. This way animations can still be run - but depending on the complexity of your game this could be a lot more work.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 247
Reputation: 2,318

Post » Tue Oct 25, 2016 9:20 am

For a more accurate answer, consider posting your actual capx because we don't know how your car is set up and how to "pause" it.

A solution though should be to have a "InGame" global variable which is by default set to 0 and an event that says that if InGame=0, then car is paused (as well as any other element of your game that need to be "paused" in whatever way this can be done).
At the end of your countdown, set InGame to 1 and so your car will move.

A global timescale is some idea, but could prevent the actual countdown from going on.
Although you can always set a specific object timescale to 1 thanks to the "Set object time scale" system action.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Tue Oct 25, 2016 2:54 pm

Hi mrtumbles & Kyatric, thank you for your reply. Im really sorry but i think i coudnt imagine or get the memo how to do it just like you guys told.

The way you said, is it i need to do a different Event Sheet ? or the same Game Sheet.

Yes, maybe i will post along my .capx so that you guys could see my game. Actually the idea i get from Flappy Bird. I made this for my assignment actually.
B
3
Posts: 8
Reputation: 187

Post » Tue Oct 25, 2016 2:56 pm

Message: RazHarmy can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Kyatric wrote:For a more accurate answer, consider posting your actual capx because we don't know how your car is set up and how to "pause" it.

A solution though should be to have a "InGame" global variable which is by default set to 0 and an event that says that if InGame=0, then car is paused (as well as any other element of your game that need to be "paused" in whatever way this can be done).
At the end of your countdown, set InGame to 1 and so your car will move.

A global timescale is some idea, but could prevent the actual countdown from going on.
Although you can always set a specific object timescale to 1 thanks to the "Set object time scale" https://www.scirra.com/manual/125/system-actions system action.


Hi Kyatric, how to upload my .capx ? i coudnt find the way to upload it.
B
3
Posts: 8
Reputation: 187

Post » Tue Oct 25, 2016 4:57 pm

Host it on a service like dropbox or google drive and put the link in your post as plain text.
Be sure to try and get enough reputation to prevent the spam filter from removing links from your post.

And yes, this is all done through the event sheet.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Thu Oct 27, 2016 4:56 am

Message: RazHarmy can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://drive.google.com/open?id=0B99xo ... kxDVHJ2dTg

Hi, sorry for the late reply, above is my capx file. You can view it and hope you could imagine how i intend to do. Hope you could help. Looking forward for your reply. Thank you.
B
3
Posts: 8
Reputation: 187

Post » Thu Oct 27, 2016 7:42 am

Notice how your URL is not complete => Can't download your capx.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Thu Oct 27, 2016 5:52 pm

Message: RazHarmy can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Kyatric wrote:Notice how your URL is not complete => Can't download your capx.


Im so sorry, my bad. Hope this one works.
https://drive.google.com/open?id=0B99xolF29i2vNnp0bkxDVHJ2dTg
B
3
Posts: 8
Reputation: 187

Post » Fri Oct 28, 2016 9:46 am

Fixed capx

For the explanation refer to the previous posts and the quick comments in the code.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests