Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > CopperCube Open discussion
Make player run when pressed key?

crackyourspeaker
Registered User
Quote
2017-05-01 10:13:20

i tried figuring this out but not sure if this can be done but I wanna make my player run with I press a key, any help?


bracer
Registered User
Quote
2017-05-01 17:00:56

ccbRegisterKeyDownEvent

http://www.ambiera.com/coppercube/doc/cnt_javascriptref.htmlccbRegisterKeyDownEvent


ccbRegisterKeyDownEvent(funcstr)

Note: This function is not available in the editor, and only in the Windows and Mac OS X app target. For getting key events, use the behavior functions onKeyEvent().

Registers a function for receiving a key down event. The function registered must take one parameter which will be the key code.
Examples:

ccbRegisterKeyDownEvent("keyPressedDown");

function keyPressedDown(keyCode)
{
print("A key was pressed down:" + keyCode); //In your case, call Run action.
}

Prints which key was pressed when it is pressed.


crackyourspeaker
Registered User
Quote
2017-05-02 01:56:27

Thanks I'll try this out


Zoo
Guest
Quote
2017-05-30 04:10:34

Here you go, quick tutorial

marshtownmadness.com/?page_id=362&preview=true

@crackyourspeaker


Zoo
Guest
Quote
2017-05-30 04:11:29

Woops, here is the correct link

http://marshtownmadness.com/runn...


crackyourspeaker
Registered User
Quote
2017-06-02 03:40:35

Sweet thanks


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact