大佬们,新人正尝试做一个弹幕射击游戏
遇到了玩家角色移动时射击速度变快的问题,尝试自己解决问题无果,还望大家指教。
玩家移动代码:
var velocity = Vector2(0,0)
var speed = 300
func _process(delta):
velocity.x = int(Input.is_action_pressed("move_right")) - int(Input.is_action_pressed("move_left"))
velocity.y = int(Input.is_action_pressed("move_down")) - int(Input.is_action_pressed("move_up"))
velocity = velocity.normalized()
global_position += velocity * speed * delta
子弹移动代码:
var velocity = Vector2(0, -1)
export var speed = 500
global_position += velocity * speed * delta

遇到了玩家角色移动时射击速度变快的问题,尝试自己解决问题无果,还望大家指教。
玩家移动代码:
var velocity = Vector2(0,0)
var speed = 300
func _process(delta):
velocity.x = int(Input.is_action_pressed("move_right")) - int(Input.is_action_pressed("move_left"))
velocity.y = int(Input.is_action_pressed("move_down")) - int(Input.is_action_pressed("move_up"))
velocity = velocity.normalized()
global_position += velocity * speed * delta
子弹移动代码:
var velocity = Vector2(0, -1)
export var speed = 500
global_position += velocity * speed * delta
