我对AS3是个新手,我真的很喜欢学习它。我的问题是我需要将一个角色从一个帧移动到另一个帧。
我知道如何移动他,让他用箭头键移动到一个生命点,让他从一帧转到下一帧,但我不知道怎么做。
如果角色走到舞台的尽头,他应该出现在下一帧的左侧。如果他走到舞台的左边,他应该出现在前一个场景的右边。
任何帮助都是最好的,谢谢大家。
发布于 2012-10-21 07:02:58
您可以在按键事件处理程序中添加条件:
// Here you set a new `x` value for the character
// If the redistration point is in the left top corner
if (myCharacter.x > stage.width)
myCharacter.x = -myCharacter.width;
else if (myCharacter.x < -myCharacter.width)
myCharacter.x = stage.width;https://stackoverflow.com/questions/12993234
复制相似问题