Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
我想这个游戏是按住某个键时是行走的动作,同时按住两个键时是跑步的动作。比如按住 D 键是往前走的动作,同时按住 D 键和空格键时就是跑的动作。怎么写法,找了好久也找不到。单单写按住一个键就能,但是找不到同时按住两个键的。
@缓缓练缓缓练 给对象增加两个数字型值,一个命名为D走,一个命名为空格跑,初始值都为0。按住D键时,把D走值设置为1,松开D键时,把D走值设置为0。空格跑同理。当D走值为1,空格跑为0时,动画为走。当D走值为1,空格跑为1时,动画为跑。