extends Sprite
#Godot游戏引擎 讨论QQ群 302924317
func _ready():
set_fixed_process(true)var SPEED = 50func _fixed_process(delta):
if Input.is_key_pressed(KEY_W):
var current_rotation = get_rot()
translate(Vector2(sin(current_rotation), cos(current_rotation)) * -SPEED * delta)
if Input.is_key_pressed(KEY_S):
var current_rotation = get_rot()
translate(Vector2(sin(current_rotation), cos(current_rotation)) * SPEED * delta)
if Input.is_key_pressed(KEY_A):
var current_rotation = get_rot()
set_rot(current_rotation+5*delta)
if Input.is_key_pressed(KEY_D):
var current_rotation = get_rot()
set_rot(current_rotation-5*delta)
#Godot游戏引擎 讨论QQ群 302924317
#Godot游戏引擎 讨论QQ群 302924317
func _ready():
set_fixed_process(true)var SPEED = 50func _fixed_process(delta):
if Input.is_key_pressed(KEY_W):
var current_rotation = get_rot()
translate(Vector2(sin(current_rotation), cos(current_rotation)) * -SPEED * delta)
if Input.is_key_pressed(KEY_S):
var current_rotation = get_rot()
translate(Vector2(sin(current_rotation), cos(current_rotation)) * SPEED * delta)
if Input.is_key_pressed(KEY_A):
var current_rotation = get_rot()
set_rot(current_rotation+5*delta)
if Input.is_key_pressed(KEY_D):
var current_rotation = get_rot()
set_rot(current_rotation-5*delta)
#Godot游戏引擎 讨论QQ群 302924317