Change Controls at Run Time

For questions about using Classic.

Post » Mon Dec 10, 2012 4:02 pm

[QUOTE=MrMiller]
But I'm wondering if just switching player control commands might do the trick. Like, if the global global variable 0 it would activate player 1's controls that are WASD keys and disable player 2. And if the global variable is 1 it would activate player 2's controls that are Arrow keys and disable player 1. If it's a one-player game you'd be using the same keyboard for both player settings.

... I dunno just an idea, I've never actually tried it before.[/QUOTE]

Woah, that's an awesome idea. I'll give it a spin! Thanks for the suggestion
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Mon Dec 10, 2012 4:06 pm

If you try it and can get that to work, please post an example .cap, because I'm very interested in how well this would operate.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Mon Dec 10, 2012 4:21 pm

Will Do
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Tue Dec 11, 2012 1:12 am

Silver, I believe I've got it. Check this out:

-I took a sprite and attached two platform objects to it.

-For the first platform object I set the "Control" name as "Player 1". For the second platform object I set the "Control" name as "Player 2".

-I then went into the Properties menu and went to the "Controls" sub menu and set the controls for Arrows keys for Player 1 (P1), and then set the controls for WASD for Player 2 (P2).

-I then created a Global variable called "Controls"

-I then went into the event sheet and created the following events in order to test it:



.Cap = https://rapidshare.com/files/3520367228/WASD-Arrow%20Movement.cap

Press '0' for Arrow control. Press '1' for WASD control (I only put W, A, and D in, you can fill in the rest with what you need).

It works.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Tue Dec 11, 2012 9:46 pm

I think I love you

Took quite a long time to reorganize and amend my event sheets to account for three different Player sprites, but it works perfectly.

If I was the King of England I'd offer you a Knighthood. Sadly, I'm not, so a simple thank you will have to suffice

Cheers Mr. Miller, I really appreciate the help!
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Tue Dec 11, 2012 11:33 pm

I have to say that after the day I just had your message really changed the whole mood of it to positive. I really needed that!

Like I said from the beginning, I think you're onto something with this game. There is just something interesting about that wolf, and I'm looking forward to seeing how it all unfolds.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests