This commit sets up the initial project configuration including: - Window size and scaling settings - Input mappings for player controls - Default texture filtering settings - Import of game asset pack with sprites and UI elements - Set of signals for tracking player bullets
19 lines
542 B
GDScript
19 lines
542 B
GDScript
extends Area2D
|
|
|
|
@export var speed = 150
|
|
@onready var screensize = get_viewport_rect().size
|
|
|
|
func _process(delta):
|
|
var input = Input.get_vector("left", "right", "up", "down")
|
|
if input.x > 0:
|
|
$Ship.frame = 2
|
|
$Ship/Boosters.animation = "right"
|
|
elif input.x < 0:
|
|
$Ship.frame = 0
|
|
$Ship/Boosters.animation = "left"
|
|
else:
|
|
$Ship.frame = 1
|
|
$Ship/Boosters.animation = "forward"
|
|
position += input * speed * delta
|
|
position = position.clamp(Vector2(8, 8), screensize-Vector2(8, 8))
|
|
|