This commit is contained in:
2022-12-11 02:19:40 +01:00
parent a852fe8894
commit 0d9acc5f47
11 changed files with 36 additions and 200 deletions

View File

@@ -10,7 +10,7 @@ radius = 0.808068
[node name="CharacterBody3D" type="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0)
collision_mask = 3
collision_mask = 3855
script = ExtResource("1_dta8q")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
@@ -18,7 +18,6 @@ transform = Transform3D(1.57581, 0, 0, 0, 2.16936, 0, 0, 0, 1.5749, 0, 0, 0)
shape = SubResource("CylinderShape3D_h8ivv")
[node name="HitBox" type="Area3D" parent="."]
collision_layer = 3
collision_mask = 3
[node name="CollisionShape3D" type="CollisionShape3D" parent="HitBox"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=27 format=3 uid="uid://md2ofbviios3"]
[gd_scene load_steps=26 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"]
@@ -15,7 +15,6 @@
[ext_resource type="Texture2D" uid="uid://ctbxpx6p36bdi" path="res://walking_ball2.png" id="8_0u1e2"]
[ext_resource type="Texture2D" uid="uid://ckdlv6b7okseq" path="res://walking_powder2.png" id="10_a137a"]
[ext_resource type="Texture2D" uid="uid://b5ioch3ad8y6r" path="res://walking_coal2.png" id="11_1jgcf"]
[ext_resource type="Texture2D" uid="uid://7qppu15lvd1j" path="res://Nodes/Keys.png" id="13_d8wle"]
[ext_resource type="Texture2D" uid="uid://bhmyyu0uhx541" path="res://Assets/Textures/Opera_senza_titolo (2).png" id="14_503dh"]
[ext_resource type="Texture2D" uid="uid://biyvvql2ufkdf" path="res://Assets/Textures/Opera_senza_titolo (1).png" id="15_dew1j"]
[ext_resource type="PackedScene" uid="uid://bkpnrgcfr1jgl" path="res://Nodes/Bin.tscn" id="16_q3kvk"]
@@ -91,27 +90,6 @@ animation = &"walking_coal"
speed_scale = 2.0
playing = true
[node name="MiniGameButton0" type="Sprite3D" parent="CharacterBody3D"]
transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 0, 6, 0)
texture = ExtResource("13_d8wle")
hframes = 5
vframes = 8
frame = 26
[node name="MiniGameButton1" type="Sprite3D" parent="CharacterBody3D"]
transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 1.5, 6, 0)
texture = ExtResource("13_d8wle")
hframes = 5
vframes = 8
frame = 26
[node name="MiniGameButton2" type="Sprite3D" parent="CharacterBody3D"]
transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 3, 6, 0)
texture = ExtResource("13_d8wle")
hframes = 5
vframes = 8
frame = 26
[node name="Storage" parent="." instance=ExtResource("4_5jw5g")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.31598, 0.0193453, -5.2771)
icon = ExtResource("14_503dh")
@@ -134,7 +112,7 @@ transform = Transform3D(-6.55671e-08, 0, 1.5, 0, 1.5, 0, -1.5, 0, -6.55671e-08,
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.70291, -0.287106, 10.1948)
[node name="Storage3" parent="." instance=ExtResource("4_5jw5g")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.63306, -0.159192, -10.7834)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 0, -11)
currentType = 1
icon = ExtResource("19_5df2b")
audioClip = ExtResource("17_ajifv")
@@ -144,7 +122,7 @@ transform = Transform3D(-6.55671e-08, 0, 1.5, 0, 1.5, 0, -1.5, 0, -6.55671e-08,
[node name="StaticBody3D2" type="StaticBody3D" parent="train"]
transform = Transform3D(-2.91409e-08, 0, -0.666667, 0, 0.666667, 0, 0.666667, 0, -2.91409e-08, 6, -0.137826, -1.33333)
collision_layer = 2
collision_layer = 4
[node name="CollisionShape3D2" type="CollisionShape3D" parent="train/StaticBody3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.5, 2, 4.23516e-22)

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=28 format=3 uid="uid://bikdn7ep2vpxw"]
[gd_scene load_steps=27 format=3 uid="uid://bikdn7ep2vpxw"]
[ext_resource type="Script" path="res://scripts/Train.gd" id="1_mcmgl"]
[ext_resource type="PackedScene" uid="uid://c1mymb38wqdg6" path="res://Nodes/train.tscn" id="2_xoa1a"]
@@ -14,7 +14,6 @@
[ext_resource type="Texture2D" uid="uid://ctssikrodjqvc" path="res://o_walking_powder2.png" id="11_eefgn"]
[ext_resource type="Texture2D" uid="uid://nctqw3vt5q0y" path="res://o_walking_coal2.png" id="12_581v4"]
[ext_resource type="PackedScene" uid="uid://bkpnrgcfr1jgl" path="res://Nodes/Bin.tscn" id="14_n2rwc"]
[ext_resource type="Texture2D" uid="uid://7qppu15lvd1j" path="res://Nodes/Keys.png" id="14_otf4l"]
[ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="15_sof53"]
[ext_resource type="PackedScene" uid="uid://cet80w4yr8rse" path="res://Storage.tscn" id="16_7dojn"]
[ext_resource type="PackedScene" uid="uid://bhivunrkj87cy" path="res://Nodes/engine.tscn" id="17_regf7"]
@@ -87,7 +86,7 @@ transform = Transform3D(1.96701e-07, 0, -1.5, 0, 1.5, 0, 1.5, 0, 1.96701e-07, -3
[node name="StaticBody3D2" type="StaticBody3D" parent="train"]
transform = Transform3D(-2.91409e-08, 0, -0.666667, 0, 0.666667, 0, 0.666667, 0, -2.91409e-08, 6, -0.137826, -1.33333)
collision_layer = 2
collision_layer = 4
[node name="CollisionShape3D2" type="CollisionShape3D" parent="train/StaticBody3D2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.5, 2, 4.23516e-22)
@@ -123,27 +122,6 @@ animation = &"walking_coal"
speed_scale = 2.0
playing = true
[node name="MiniGameButton0" type="Sprite3D" parent="CharacterBody3D"]
transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 0, 6, 0)
texture = ExtResource("14_otf4l")
hframes = 5
vframes = 8
frame = 26
[node name="MiniGameButton1" type="Sprite3D" parent="CharacterBody3D"]
transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 1.5, 6, 0)
texture = ExtResource("14_otf4l")
hframes = 5
vframes = 8
frame = 26
[node name="MiniGameButton2" type="Sprite3D" parent="CharacterBody3D"]
transform = Transform3D(8, 0, 0, 0, -3.93403e-07, 1, 0, -9, -4.37114e-08, 3, 6, 0)
texture = ExtResource("14_otf4l")
hframes = 5
vframes = 8
frame = 26
[node name="Bin" parent="." instance=ExtResource("14_n2rwc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.18577, 0.622175, 10.6544)

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=10 format=3 uid="uid://b8u4bo4mklj55"]
[ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_dubwq"]
[ext_resource type="PackedScene" path="res://Nodes/light_setup.tscn" id="2_1lh4t"]
[ext_resource type="PackedScene" uid="uid://nxapkgcq2c70" path="res://Nodes/light_setup.tscn" id="2_1lh4t"]
[ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="3_xcgy2"]
[ext_resource type="PackedScene" uid="uid://md2ofbviios3" path="res://Nodes/Train_P1.tscn" id="4_gg4ea"]
[ext_resource type="PackedScene" uid="uid://bikdn7ep2vpxw" path="res://Nodes/Train_P2.tscn" id="5_wi6pu"]
@@ -18,32 +18,26 @@ script = ExtResource("1_dubwq")
[node name="StartNode" parent="." instance=ExtResource("3_xcgy2")]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 43, 26.0132)
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 44, 25.0132)
current = true
fov = 30.0
size = 32.0
near = 0.041
[node name="Train1" parent="." instance=ExtResource("4_gg4ea")]
transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, -10, 0, 0)
transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, -11, 0, 0)
[node name="Train2" parent="." instance=ExtResource("5_wi6pu")]
transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, 9.90113, -0.0549407, -0.085681)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.875944, -0.294781, 0.381872, -0.106805, 0.65344, 0.749406, -0.470441, -0.697224, 0.540892, 0, 8.25958, 0)
visible = false
transform = Transform3D(1, 0, 3.55271e-15, 0, 1, 0, -3.55271e-15, 0, 1, 10.9011, -0.0549407, -0.085681)
[node name="Control" parent="." instance=ExtResource("6_eicse")]
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("7_wagg2")
volume_db = -27.238
autoplay = true
[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."]
stream = ExtResource("8_c6uwu")
volume_db = -10.0
autoplay = true
[node name="AudioStreamPlayer3" type="AudioStreamPlayer" parent="."]

View File

@@ -284,6 +284,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, -6)
[node name="TrainPillarWood12" parent="Walls" instance=ExtResource("7_hd70v")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 0, -6)
[node name="TrainPillarWood13" parent="Walls" instance=ExtResource("7_hd70v")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 0, 2)
[node name="TrainPillarWood" parent="Walls" instance=ExtResource("7_hd70v")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 2)

View File

@@ -33,7 +33,6 @@ shape = SubResource("CylinderShape3D_orr2n")
[node name="Sprite3D2" type="Sprite3D" parent="."]
transform = Transform3D(0.15, 0, 0, 0, -6.55671e-09, 0.15, 0, -0.15, -6.55671e-09, 0, 3.10039, 0)
visible = false
texture = ExtResource("3_ojyse")
[connection signal="body_entered" from="Area3D" to="." method="on_Player_enter"]

View File

@@ -9,11 +9,12 @@ resource_name = "Panner"
pan = 1.0
[resource]
bus/0/volume_db = -0.130497
bus/1/name = &"Left"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = 0.0
bus/1/volume_db = 0.398338
bus/1/send = &"Master"
bus/1/effect/0/effect = SubResource("AudioEffectPanner_bp6bg")
bus/1/effect/0/enabled = true
@@ -21,7 +22,7 @@ bus/2/name = &"Right"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = 0.0
bus/2/volume_db = -0.197157
bus/2/send = &"Master"
bus/2/effect/0/effect = SubResource("AudioEffectPanner_ns40o")
bus/2/effect/0/enabled = true

View File

@@ -29,7 +29,7 @@ _global_script_classes=[{
"language": &"GDScript",
"path": "res://scripts/Logic/MapNode.gd"
}, {
"base": "StaticBody3D",
"base": "Node",
"class": &"Module",
"language": &"GDScript",
"path": "res://scripts/Modules/Module.gd"

View File

@@ -156,7 +156,7 @@ func approach():
tween.tween_property(p1_train, "position", Vector3(p1_train.position.x, p1_train.position.y, p2_train.position.z), 0.7)
else:
tween.tween_property(p2_train, "position", Vector3(p2_train.position.x, p2_train.position.y, p1_train.position.z), 0.7)
emit_signal("shoot")
tween.tween_callback(func(): emit_signal("shoot")).set_delay(0.5)
tween.tween_callback(fight).set_delay(1)
func fight():

View File

@@ -17,6 +17,7 @@ func _ready():
currentStashValue = 10
$Sprite3D2.texture = icon
$AudioStreamPlayer.stream = audioClip
$Sprite3D2.visible = false
func interact(player):
if currentStashValue >= 1:

View File

@@ -24,104 +24,7 @@ var rng = RandomNumberGenerator.new()
func _ready():
walking = "walking"
idle = "idle"
#get_parent().find_child("CharacterBody3D").find_child("MiniGameButton0").hide()
#get_parent().find_child("CharacterBody3D").find_child("MiniGameButton1").hide()
#get_parent().find_child("CharacterBody3D").find_child("MiniGameButton2").hide()
func miniGameColor(input: int, red: int):
if(input == 0):
$MiniGameButton0.modulate = Color(1,1,red)
if(input == 1):
$MiniGameButton1.modulate = Color(1,1,red)
if(input == 2):
$MiniGameButton2.modulate = Color(1,1,red)
if(input == 3):
$MiniGameButton3.modulate = Color(1,1,red)
if(input == 4):
$MiniGameButton4.modulate = Color(1,1,red)
if(input == 5):
$MiniGameButton5.modulate = Color(1,1,red)
func miniGameReset():
MiniGamePos = 0
if(is_player1):
miniGameColor(0,1)
miniGameColor(1,1)
miniGameColor(2,1)
MiniGame[0] = rng.randi_range(0, 3)
miniGameSetArrow(0)
MiniGame[1] = rng.randi_range(0, 3)
miniGameSetArrow(1)
MiniGame[2] = rng.randi_range(0, 3)
miniGameSetArrow(2)
else:
miniGameColor(3,1)
miniGameColor(4,1)
miniGameColor(5,1)
MiniGame[0] = rng.randi_range(0, 3)
miniGameSetArrow(3)
MiniGame[1] = rng.randi_range(0, 3)
miniGameSetArrow(4)
MiniGame[2] = rng.randi_range(0, 3)
miniGameSetArrow(5)
func miniGameSetArrow(buttonNr: int):
if(buttonNr == 0):
$MiniGameButton0.frame = 26 + MiniGame[0]
if(buttonNr == 1):
$MiniGameButton1.frame = 26 + MiniGame[1]
if(buttonNr == 2):
$MiniGameButton2.frame = 26 + MiniGame[2]
if(buttonNr == 3):
$MiniGameButton3.frame = 26 + MiniGame[0]
if(buttonNr == 4):
$MiniGameButton4.frame = 26 + MiniGame[1]
if(buttonNr == 5):
$MiniGameButton5.frame = 26 + MiniGame[2]
func miniGameCheck(input : int):
if(is_player1):
if(input == MiniGame[MiniGamePos]):
miniGameColor(MiniGamePos, 0)
MiniGamePos = MiniGamePos +1
else:
miniGameReset()
if(MiniGamePos >= 3):
$MiniGameButton0.hide()
$MiniGameButton1.hide()
$MiniGameButton2.hide()
P1inMiniGame = 0
miniGameReset()
else:
if(input == MiniGame[MiniGamePos]):
miniGameColor(MiniGamePos+3, 0)
MiniGamePos = MiniGamePos +1
else:
miniGameReset()
if(MiniGamePos >= 3):
$MiniGameButton3.hide()
$MiniGameButton4.hide()
$MiniGameButton5.hide()
P2inMiniGame = 0
miniGameReset()
func _process(delta):
if Input.is_action_just_pressed("p1_extra"):
if(P1inMiniGame == 0):
P1inMiniGame = 1
$MiniGameButton0.show()
$MiniGameButton1.show()
$MiniGameButton2.show()
if Input.is_action_just_pressed("p2_extra"):
if(P2inMiniGame == 0):
P2inMiniGame = 1
$MiniGameButton3.show()
$MiniGameButton4.show()
$MiniGameButton5.show()
func _physics_process(delta):
if(velocity.length() > 0):
@@ -144,44 +47,24 @@ func _physics_process(delta):
func check_input():
if is_player1:
if(!P1inMiniGame):
if Input.is_action_pressed("p1_left"):
movement.x -= 1
if Input.is_action_pressed("p1_right"):
movement.x += 1
if Input.is_action_pressed("p1_up"):
movement.z -= 1
if Input.is_action_pressed("p1_down"):
movement.z += 1
else:
if Input.is_action_just_pressed("p1_up"):
miniGameCheck(0)
if Input.is_action_just_pressed("p1_right"):
miniGameCheck(1)
if Input.is_action_just_pressed("p1_down"):
miniGameCheck(2)
if Input.is_action_just_pressed("p1_left"):
miniGameCheck(3)
if Input.is_action_pressed("p1_left"):
movement.x -= 1
if Input.is_action_pressed("p1_right"):
movement.x += 1
if Input.is_action_pressed("p1_up"):
movement.z -= 1
if Input.is_action_pressed("p1_down"):
movement.z += 1
else:
if(!P2inMiniGame):
if Input.is_action_pressed("p2_left"):
movement.x -= 1
if Input.is_action_pressed("p2_right"):
movement.x += 1
if Input.is_action_pressed("p2_up"):
movement.z -= 1
if Input.is_action_pressed("p2_down"):
movement.z += 1
else:
if Input.is_action_just_pressed("p2_up"):
miniGameCheck(0)
if Input.is_action_just_pressed("p2_right"):
miniGameCheck(1)
if Input.is_action_just_pressed("p2_down"):
miniGameCheck(2)
if Input.is_action_just_pressed("p2_left"):
miniGameCheck(3)
if Input.is_action_pressed("p2_left"):
movement.x -= 1
if Input.is_action_pressed("p2_right"):
movement.x += 1
if Input.is_action_pressed("p2_up"):
movement.z -= 1
if Input.is_action_pressed("p2_down"):
movement.z += 1
func check_interaction():
var action
if is_player1: