how can I supervise the movement of the keyboard?

Get help using Construct 2

Post » Mon Dec 17, 2012 3:43 am

    I'm making a game, in this game an event is that if more than 10 seconds no movement on keyboard it would notice the player with alarm sound.
how can I estimate that more than 10 seconds no movement on keyboard?
please help me..
B
6
Posts: 15
Reputation: 755

Post » Mon Dec 17, 2012 4:27 am


why "on any key pressed" event can't invert in my construct2?Golden_wang2012-12-17 04:29:05
B
6
Posts: 15
Reputation: 755

Post » Mon Dec 17, 2012 4:46 am

It would be very funny to detect or start anything on a "On no key is pressed".

Why not make a variable called "Timer".
On every 1.00 second, add 1 to Timer.
If any key is pressed, set Timer = 0.
If Timer = 10, play your alarm sound.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Mon Dec 17, 2012 7:49 am

Rory will work. you can also do

condition: on any keypress
alertTime = wallclocktime + 10


condition: every 1 second
condition: wallclocktime > alert time
-> do alert


B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon Dec 17, 2012 9:43 am

thanks a lot @Rory ! that's work
B
6
Posts: 15
Reputation: 755

Post » Mon Dec 17, 2012 4:45 pm

No problem :)
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Tue Dec 18, 2012 1:05 am

@Rory one more simple question but make me confused almost a whole day.How can I get the system date in C2?
B
6
Posts: 15
Reputation: 755

Post » Tue Dec 18, 2012 1:21 am

I'm not sure 'bout that but I think you can find them in the system expressions ... Nah , Nothing there !
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Tue Dec 18, 2012 5:46 am

I don't think you can, I think you'd have to ask the player at the start of the game, or make an ajax script which is basically a calendar and get the current date from that script?

EDIT: This is a plugin which can do what you asked Rory2012-12-18 05:48:08
B
36
S
10
G
6
Posts: 948
Reputation: 11,101


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Zebbi and 18 guests