How do I block out a second player?

Get help using Construct 2

Post » Sat Oct 01, 2016 10:42 pm

Message: Twincade can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi everyone!

I'm working on a quiz show game that uses buzzers. I'm trying to set my game up so when I press "s" an image and sound appears that indicates player 1 has buzzed in and when a player hits letter "k" a different image and sound appears for player two.

This part is no problem. I just had the system spawn the image on keypress.

What I am having trouble with is making it so that when player 1 hits "s" player two is locked out from hitting "k"

I currently have it setup where an instance variable is set for each buzzer and defaults to true. After an opposing buzzer is pressed I have it set the value to false.

When I do this and add another condition that checks the instance variable both buzzers stop working?

I oploaded the capx at the link below if anyone can help!

http://www.Twincade.com/GameShow.capx

Thanks!
B
6
Posts: 14
Reputation: 278

Post » Sat Oct 01, 2016 11:06 pm

It's because you're using conditions for objects that haven't been created yet. I would use a global variable to block the players from buzzing.

https://dl.dropboxusercontent.com/u/495 ... wedit.capx
B
45
S
15
G
73
Posts: 2,007
Reputation: 43,396

Post » Sat Oct 01, 2016 11:20 pm

aww yea! Thanks!
B
6
Posts: 14
Reputation: 278

Post » Sun Oct 02, 2016 8:08 pm

Message: Twincade can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi!

I'm having a bit of trouble getting construct 2 to meet conditions.

I set the quiz show setup to where if player 1 is unable to answer a question the host can press "H" and control is relinquished to player 2 so that they can have a chance to answer. This also should work in reverse, when player 2 is unable to answer and the host hits "H" control should be given to player 1.

I set this up using global variables.

For some reason it works for player 2 but not for player 1.

Can anyone look and see what i'm doing wrong :PPPP

http://www.twincade.com/GameShow2.capx
B
6
Posts: 14
Reputation: 278

Post » Mon Oct 03, 2016 12:16 am

You've gotta be careful with the way that Construct 2 reads events from top to bottom. Event 8 sets Buzzer2 to 1, which makes event 9 true and runs event 9 making the game look the same as it was before. My standard is to add a short timer wait, even 0.1 secs before you set the new Buzzer1 and Buzzer2 variables, after the create object action.
B
45
S
15
G
73
Posts: 2,007
Reputation: 43,396

Post » Mon Oct 03, 2016 12:15 pm

I tried to add wait commands nearly everywhere and no luck
B
6
Posts: 14
Reputation: 278

Post » Mon Oct 03, 2016 12:28 pm

B
45
S
15
G
73
Posts: 2,007
Reputation: 43,396


Return to How do I....?

Who is online

Users browsing this forum: adamebastin, Bro7hers, ketramtu18 and 10 guests