📄 isoman.java
字号:
import java.awt.*;
public class IsoMan extends Actor2D
{
public IsoMan(ActorGroup2D grp)
{
super(grp);
}
public void update()
{
if(currAnimation == null)
{
currAnimation = group.getAnimationStrip(IsoManGroup.WALKING_NORTH);
}
if(frameWidth <= 0)
{
frameWidth = currAnimation.getFrameWidth();
}
if(frameHeight <= 0)
{
frameHeight = currAnimation.getFrameHeight();
}
if(! vel.equals(Vector2D.ZERO_VECTOR))
{
animate();
}
// 确保IsoMan的脚被设置为参考点
xform.setToTranslation(pos.getX()-frameWidth/2, pos.getY()-frameHeight);
updateBounds();
checkBounds();
}
} // IsoMan
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -