Added player car with janky controls and janky camera
This commit is contained in:
parent
f9917528dc
commit
49e4957c84
6 changed files with 162 additions and 2 deletions
32
src/game/player.tscn
Normal file
32
src/game/player.tscn
Normal file
|
@ -0,0 +1,32 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://ckau5s2tsb3oc"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/player_controller.gd" id="1_g4ij8"]
|
||||
[ext_resource type="Texture2D" uid="uid://d1t1g7hyil82v" path="res://assets/spracer.png" id="2_xal47"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w2nj7"]
|
||||
size = Vector2(36, 20)
|
||||
|
||||
[node name="player" type="StaticBody2D" node_paths=PackedStringArray("camera")]
|
||||
script = ExtResource("1_g4ij8")
|
||||
dec = 15.0
|
||||
max_speed = 50.0
|
||||
turn_speed = 2.0
|
||||
brake_strength = 12.0
|
||||
camera = NodePath("Camera2D")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, 3.09944e-05)
|
||||
rotation = 1.5708
|
||||
scale = Vector2(0.0489796, 0.0489796)
|
||||
texture = ExtResource("2_xal47")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-1, 0)
|
||||
shape = SubResource("RectangleShape2D_w2nj7")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
rotation = 1.5708
|
||||
ignore_rotation = false
|
||||
position_smoothing_enabled = true
|
||||
rotation_smoothing_enabled = true
|
||||
rotation_smoothing_speed = 10.0
|
Loading…
Add table
Add a link
Reference in a new issue