Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 26th Jun 2015 14:36
Hi.

I want make a game that need use multi key for some action.
like Mortal kombat I want use multi key for run xustom animation.(for eg: left + right + A).

in mortal kombat for run custom animation, player should press require keys at Specified time, else action don't work.

please guide me to do it.

thanks.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Jun 2015 16:03 Edited at: 26th Jun 2015 16:07
It's all in the documentation. You should try looking it up before nagging the boards.

Anyway, here is a quick example for you:




There will of course be limitations to this (due to 'n-key rollover').

V2 T1 (Mostly)
Uzmadesign
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 26th Jun 2015 16:21 Edited at: 26th Jun 2015 16:23
Thanks CJB.

Quote: "It\'s all in the documentation. You should try looking it up before nagging the boards."


yes, I know. use several GetRawKeyState() or any commands is very basic.

Ithink you don\'t good understand my mean. I don\'t want press all keys at same time, I want Continuous press them.

1- Press left key
2- press right key
3- press A key

Then do action.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Jun 2015 16:35
1st press left, then press right, then finally press A. Got it. That's very simple to achieve. You have games published now. I'm going to let you figure this one out yourself. It's a good way to learn.

V2 T1 (Mostly)
Uzmadesign
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Jun 2015 16:36 Edited at: 26th Jun 2015 16:37
The answer is in the question. If you really are a programmer these are not questions you should ask, they are questions you should enjoy (and have no trouble) answering for yourself.

I wrote out a whole answer in pseudo code for you and deleted it because I just realised I was taking your question and rewriting it in code.

Check if the key is pressed, then check if the next key is pressed in time and so on...

You are effectively asking us how to tie your shoelaces and I'm genuinely sorry to berate you for it but you should know how to tie your shoelaces by now, you have released some pretty impressive looking apps already.

EDIT: Beat me by one minute CJB

Using AppGameKit V2 Tier 1
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Jun 2015 16:45
Hehe.

V2 T1 (Mostly)
Uzmadesign
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 26th Jun 2015 16:56
OK, I try more.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Jun 2015 17:51
Thanks, no offence intended

Using AppGameKit V2 Tier 1
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 26th Jun 2015 18:59
Thanks My Friend
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 26th Jun 2015 20:28
I wrote it and work very well.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 27th Jun 2015 00:09 Edited at: 27th Jun 2015 00:09
Huzzah! Show me teh codez

V2 T1 (Mostly)
Uzmadesign
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 27th Jun 2015 16:20 Edited at: 27th Jun 2015 16:32
Here is my code:

at less than 1 second should press:

1- down key
2- right key
3- A key

Then result is Print ("Hello").

Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 27th Jun 2015 21:49 Edited at: 27th Jun 2015 21:58
I'm pretty sure that's not what CJB meant

AGK V2 user - Tier 1 (mostly)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Jun 2015 00:17 Edited at: 28th Jun 2015 00:20
u should begin with the combo definition.
then something univeral detection what give u the result as name or number.
also do not use direct a input device.
make it flexible, keyboard,gamepad,touch input,mouse etc.

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Jun 2015 06:43
Quote: "u should begin with the combo definition.
then something univeral detection what give u the result as name or number."


I don't understand your mean Markus.

Quote: "also do not use direct a input device.
make it flexible, keyboard,gamepad,touch input,mouse etc."


your mean is (for e.g):

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Jun 2015 13:07
i mean its better to have a list of combos saved in a udt and array
or something.
then u can use this list and compare the input with the list and get
a result.
a new combo ist just a new data entry and u do not need to write
new if then else.

yes, that i mean,
its better to use a function with name InputDown InputA or InputJump InputKick
InputPunch InputCrouch and u will get a true/false result.

but it belongs the effort and benefit.

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Jun 2015 17:17
OK, Thanks Markus for Explanation.
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Jun 2015 20:28 Edited at: 28th Jun 2015 20:29
Markus can you give an example? I want do correct way.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 28th Jun 2015 20:34
And there it is!
As predictable as clockwork -Gimme Teh Codez!!!

I thought that Baxslash's message had got through to you and you had finally learned the fun of coding but I was wrong. You still want everyone to do it for you

AGK V2 user - Tier 1 (mostly)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Jun 2015 21:02 Edited at: 28th Jun 2015 21:03
Quote: "-Gimme Teh Codez!!!"


I don't understand what is your mean for this Sentence.

Quote: "You still want everyone to do it for you."


no, I wrote my code with myself method.
I don't work with UDT and Recursive functions. I need an example for start new method coding.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Jun 2015 01:32 Edited at: 29th Jun 2015 01:33
here a example, i made in one hour.
the analog input is a little bit special because there i not want a repeat.
and agk not support string as reference, so i used a string in a udt^^



AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 29th Jun 2015 17:43 Edited at: 29th Jun 2015 17:44
Thanks Markus for good example.

Login to post a reply

Server time is: 2024-04-19 11:22:33
Your offset time is: 2024-04-19 11:22:33