预先设置
1.项目设置里 Display/Size 设置 Width, Height(游戏像素)
2.设置 Test Width, Test Heigh (测试时窗口大小)
3.设置 Stretch/mode 为2d (拉伸模式)
人物创建
创建结点
创建 KinematicBody2D ,挂载Sprite和CollisionShape2D作为贴图与碰撞检测
移动脚本
var velocity = Vector2.ZERO
const MAX_SPEED = 10
# 加速
const ACCELERATION = 80
# 摩擦力
const FRICTION = 80
func _physics_process(delta)