作者motocyclecle (waiting)
看板Flash
標題[問題] keycode 英文鍵盤
時間Tue Aug 17 17:17:48 2010
各位大大你們好,
我才剛開始學習AS3.0
我做了一個打地鼠的小遊戲
我想要以英文鍵盤來打擊
我數字是這樣寫
case Keyboard.NUMPAD_2:
trace(String.fromCharCode(e.charCode));
if
(mouse2.hitTestPoint(369,381)||mouse11.hitTestPoint(369,381)||mouse20.hitTestPoint(369,381))
{
score+=100;
gamescore.text=String(score);
那請問英文鍵盤的要如何改寫?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.131.95.173
→ dsmwang:是指英文字母嗎?就把keycode換掉就好了吧? 08/17 17:30
→ ericinttu:請問 Keyboard.NUMPAD_2 是什麼東西? 08/17 17:55
→ motocyclecle:Keyboard.NUMPAD_2 就是數字鍵的2,那請問把keycode 08/18 11:02
→ motocyclecle:換成什麼?像是按a鍵是65,那要怎麼加進去? 謝謝 08/18 11:03
→ ericinttu:你有用什麼找過什麼關鍵字了嗎? 08/18 13:02
推 etrexetrex:你就寫 case 65: 08/18 13:10
→ motocyclecle:謝謝大家,我找到我出錯的地方了。 08/19 15:47