initial project with basic moevment setup

This commit is contained in:
Tabby 2025-06-07 16:13:21 +10:00
parent cabe78caf0
commit be880bd228
9 changed files with 178 additions and 2 deletions

18
ship.gd Normal file
View file

@ -0,0 +1,18 @@
extends RigidBody2D
@export var thrust_power : float = 1
@export var turn_power : float = 1
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var turning : float = Input.get_axis("turn_left","turn_right") * turn_power
var thrust : float = Input.get_action_strength("thrust") * thrust_power
apply_torque(turning)
apply_force(Vector2(-thrust,-thrust) * transform.y )