How do I make custom changable controlls ?

Get help using Construct 2

Post » Tue May 24, 2016 3:29 pm

Hi guys, how can I change my controlls in the game and save them ?
Thanks:)
B
37
S
16
G
2
Posts: 447
Reputation: 4,860

Post » Tue May 24, 2016 4:01 pm

Hi there,

Can you be more specific about what you want to accomplish?
B
8
S
2
Posts: 59
Reputation: 686

Post » Tue May 24, 2016 4:46 pm

for example: if the defaoult are the arrows...but i like to change them and save the controlls to asdw keys...
B
37
S
16
G
2
Posts: 447
Reputation: 4,860

Post » Tue May 24, 2016 6:39 pm

The expression Keyboard.LastKeyCode will give you the code for that key. So make a interface and let the user press keys.

Store that code a variables, in a dictionary, in an array, in a list .... whats best for you.
Use Local Storage Object.

Keyboard.StringFromKeyCode(Keyboard.LastKeyCode) will give you a key as a string. Use that to show the user what he has pressed.

If you do this, you wil have to use the conditions 'Key code is down', 'On key code pressed' and 'On key code released' solutions, and compare them with you variables.
B
33
S
18
G
27
Posts: 2,436
Reputation: 20,336

Post » Tue May 24, 2016 6:42 pm

mariogamer wrote:for example: if the defaoult are the arrows...but i like to change them and save the controlls to asdw keys...


Well if the question is only: how do i use other keys then de default keys ...
See here:
viewtopic.php?f=147&t=79175
B
33
S
18
G
27
Posts: 2,436
Reputation: 20,336

Post » Tue May 24, 2016 8:31 pm

thanks a lot... I need the storage/change key thing...since I am not good in coding... I would ask u gently to show me a simple capx file if that is ok 4 U. You would really save me !

thanks so much ! I searched 3 days long... U R my hope to achieve that hard thing for me
B
37
S
16
G
2
Posts: 447
Reputation: 4,860

Post » Wed May 25, 2016 12:08 am

Do you have a game to go with it ?

https://
drive.google.com/open?id=0B1SSuCVV8v74SnBseHRpUXRfSEU
B
33
S
18
G
27
Posts: 2,436
Reputation: 20,336

Post » Wed May 25, 2016 6:10 am

WOOOOOWWWWWWWWWWWWWWW that was amazingly kind ! THANK U SO MUCH !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
B
37
S
16
G
2
Posts: 447
Reputation: 4,860


Return to How do I....?

Who is online

Users browsing this forum: luck1210, RedBlackSpade and 7 guests