keybords keys

New releases and general discussions.

Post » Tue Jan 20, 2009 11:40 am

Hi thank you for this master piece of software !! and excuse my english( i m from Paris)

i m trying to control a sprite using Python scripting.how can i call the keyboard function ? for now , if i want to rotate a sprite , i use :

if MouseKeyboard.KeyDown(R):
Sprite.Angle=Sprite.Angle+1

but it doesn t seems to work !

what i m doing wrong ?

Thx
B
1
G
3
Posts: 9
Reputation: 843

Post » Tue Jan 20, 2009 2:02 pm

Use events... I'm not sure Python works right now.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Tue Jan 20, 2009 4:19 pm

This will work for pressing the letter keys, just change "k" to whatever letter key you want to check.

if MouseKeyboard.KeyDown(ord("k")-62):
Sprite.Angle += 1
B
2
S
1
G
5
Posts: 59
Reputation: 1,518


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests