mirror of
https://github.com/PfandBoss/SemesterGameJam2022.git
synced 2025-11-12 04:16:12 +01:00
Yippi
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
[gd_scene load_steps=20 format=3 uid="uid://md2ofbviios3"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://md2ofbviios3"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Train.gd" id="1_0x664"]
|
||||
[ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="3_1ix85"]
|
||||
[ext_resource type="PackedScene" uid="uid://vwjd5od63jgh" path="res://Nodes/Player.tscn" id="3_in6up"]
|
||||
[ext_resource type="PackedScene" uid="uid://c1mymb38wqdg6" path="res://Nodes/train.tscn" id="3_jmv6b"]
|
||||
[ext_resource type="PackedScene" uid="uid://cet80w4yr8rse" path="res://Storage.tscn" id="4_5jw5g"]
|
||||
@@ -123,3 +124,6 @@ currentType = 2
|
||||
|
||||
[node name="Cannon" parent="." instance=ExtResource("5_vgxqe")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.4817, 1.2303, 0.0486939)
|
||||
|
||||
[node name="Engine" parent="." instance=ExtResource("3_1ix85")]
|
||||
transform = Transform3D(-6.55671e-08, 0, 1.5, 0, 1.5, 0, -1.5, 0, -6.55671e-08, -3.45639, 1.1688, 9)
|
||||
|
||||
17
Nodes/engine.tscn
Normal file
17
Nodes/engine.tscn
Normal file
@@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bhivunrkj87cy"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Modules/Engine.gd" id="1_8ew0t"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_qba77"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_wu8t1"]
|
||||
|
||||
[node name="Engine" type="StaticBody3D"]
|
||||
script = ExtResource("1_8ew0t")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0)
|
||||
shape = SubResource("BoxShape3D_qba77")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_wu8t1")
|
||||
@@ -29,7 +29,7 @@ _global_script_classes=[{
|
||||
"language": &"GDScript",
|
||||
"path": "res://scripts/Logic/MapNode.gd"
|
||||
}, {
|
||||
"base": "Node",
|
||||
"base": "StaticBody3D",
|
||||
"class": &"Module",
|
||||
"language": &"GDScript",
|
||||
"path": "res://scripts/Modules/Module.gd"
|
||||
|
||||
@@ -16,18 +16,23 @@ func _ready():
|
||||
currentState = STATE.RUNNING
|
||||
#TODO: FINISH
|
||||
func interact(player):
|
||||
if player.getResource() != 2:
|
||||
return
|
||||
if currentState == STATE.RUNNING:
|
||||
if (train.current_speed + refuelRate) <= maxSpeed:
|
||||
train.current_speed += refuelRate
|
||||
player.clearInventory()
|
||||
if train.current_speed >= maxSpeed:
|
||||
train.current_speed = maxSpeed
|
||||
return
|
||||
#TODO: Repair Train
|
||||
currentState = STATE.RUNNING
|
||||
|
||||
#
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
func _process(delta):
|
||||
if not train.is_dead():
|
||||
train.current_speed -= 0.1 * delta
|
||||
print(train.current_speed)
|
||||
|
||||
|
||||
|
||||
@@ -91,9 +91,10 @@ func fill_inventory(type):
|
||||
|
||||
|
||||
func getResource():
|
||||
return self.resource
|
||||
return resource
|
||||
|
||||
func clearInventory():
|
||||
inventory = 0
|
||||
walking = "walking"
|
||||
idle = "idle"
|
||||
$AnimatedSprite3D.play(idle)
|
||||
|
||||
Reference in New Issue
Block a user