如何为游戏中的角色创建控件
how to create controls for a character in a game
我是一名初级程序员。我不明白如何在 swift.
中为游戏中的角色创建控件
游戏将包含按钮:左、右、跳和动作。
我玩累了touchesBegan
,但是左右键在常压下不工作
您还必须实施 touchesEnded
。
执行此操作的简单方法是在 touchesBegan 中将标志设置为 true,在 touchesEnded
中设置为 false。这样,只要他的标志设置为真 (touchesBegan
),您的循环就会 运行,当它设置为假 (touchesEnded
) 时就会停止。
希望这会有所帮助,如果您需要更多帮助,请告诉我。
我是一名初级程序员。我不明白如何在 swift.
中为游戏中的角色创建控件
游戏将包含按钮:左、右、跳和动作。
我玩累了touchesBegan
,但是左右键在常压下不工作
您还必须实施 touchesEnded
。
执行此操作的简单方法是在 touchesBegan 中将标志设置为 true,在 touchesEnded
中设置为 false。这样,只要他的标志设置为真 (touchesBegan
),您的循环就会 运行,当它设置为假 (touchesEnded
) 时就会停止。
希望这会有所帮助,如果您需要更多帮助,请告诉我。