Rewriting ships: Movement system
This commit is contained in:
parent
828f4c52c7
commit
e2b9fa6c69
10 changed files with 208 additions and 0 deletions
6
scenes/Ships/Modules/Engines/engine.tscn
Normal file
6
scenes/Ships/Modules/Engines/engine.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://mw4kwxoeqch3"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Ship/engine.gd" id="1_e4bt7"]
|
||||
|
||||
[node name="Engine" type="Node2D"]
|
||||
script = ExtResource("1_e4bt7")
|
||||
16
scenes/Ships/Modules/Hulls/hull.tscn
Normal file
16
scenes/Ships/Modules/Hulls/hull.tscn
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bsu4eqwdfewwi"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Ship/hull.gd" id="1_7nfg8"]
|
||||
[ext_resource type="Texture2D" uid="uid://beb76cssb3knp" path="res://sprites/ship.png" id="2_vhl4r"]
|
||||
|
||||
[node name="Hull" type="RigidBody2D"]
|
||||
position = Vector2(0.5, 0)
|
||||
gravity_scale = 0.0
|
||||
angular_damp = 1.0
|
||||
script = ExtResource("1_7nfg8")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_vhl4r")
|
||||
|
||||
[node name="Collision" type="CollisionPolygon2D" parent="."]
|
||||
polygon = PackedVector2Array(-45.5, 14, -45.5, 64, -44.5, 64, 81.5, 1, 81.5, -1, -44.5, -64, -45.5, -64, -45.5, -14, -67.5, -14, -81.5, -28, -82.5, -28, -82.5, 28, -81.5, 28, -67.5, 14)
|
||||
21
scenes/Ships/player_ship.tscn
Normal file
21
scenes/Ships/player_ship.tscn
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://dok3i8u5t1ka4"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bjkshql8ut6hk" path="res://scenes/Ships/ship.tscn" id="1_6x7bu"]
|
||||
[ext_resource type="Shader" path="res://shaders/ship.gdshader" id="2_dbojl"]
|
||||
[ext_resource type="Script" path="res://scripts/Ship/player_input_controller.gd" id="3_0e84a"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_u1mh3"]
|
||||
resource_local_to_scene = true
|
||||
resource_name = "Shield Material"
|
||||
shader = ExtResource("2_dbojl")
|
||||
shader_parameter/wave_centers = PackedVector2Array()
|
||||
shader_parameter/wave_distances = PackedFloat32Array(-1)
|
||||
shader_parameter/color = Color(1, 0, 0, 1)
|
||||
shader_parameter/max_distance = 20.0
|
||||
shader_parameter/bublic_size = 20.0
|
||||
|
||||
[node name="PlayerShip" instance=ExtResource("1_6x7bu")]
|
||||
material = SubResource("ShaderMaterial_u1mh3")
|
||||
|
||||
[node name="InputController" type="Node2D" parent="." index="2"]
|
||||
script = ExtResource("3_0e84a")
|
||||
14
scenes/Ships/ship.tscn
Normal file
14
scenes/Ships/ship.tscn
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bjkshql8ut6hk"]
|
||||
|
||||
[ext_resource type="Material" uid="uid://cw0827vwv7pc1" path="res://shaders/materials/ship_material.tres" id="1_ibfis"]
|
||||
[ext_resource type="Script" path="res://scripts/Ship/ship.gd" id="2_n14ml"]
|
||||
[ext_resource type="PackedScene" uid="uid://bsu4eqwdfewwi" path="res://scenes/Ships/Modules/Hulls/hull.tscn" id="3_upgeg"]
|
||||
[ext_resource type="PackedScene" uid="uid://mw4kwxoeqch3" path="res://scenes/Ships/Modules/Engines/engine.tscn" id="4_adr14"]
|
||||
|
||||
[node name="Ship" type="Node2D"]
|
||||
material = ExtResource("1_ibfis")
|
||||
script = ExtResource("2_n14ml")
|
||||
|
||||
[node name="Hull" parent="." instance=ExtResource("3_upgeg")]
|
||||
|
||||
[node name="Engine" parent="." instance=ExtResource("4_adr14")]
|
||||
Loading…
Add table
Add a link
Reference in a new issue