added moving backround

This commit is contained in:
PfandBoss
2022-12-11 02:58:09 +01:00
parent 597479a4a7
commit 54fcfe1866
7 changed files with 40 additions and 7 deletions

View File

@@ -112,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, 0, -11)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.63306, -0.159192, -10.7834)
currentType = 1
icon = ExtResource("19_5df2b")
audioClip = ExtResource("17_ajifv")
@@ -122,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 = 4
collision_layer = 2
[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

@@ -86,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 = 4
collision_layer = 2
[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)

13
Nodes/game.gdshader Normal file
View File

@@ -0,0 +1,13 @@
shader_type spatial;
render_mode unshaded;
uniform vec2 direction_and_speed = vec2(0.25, 0.00);
uniform vec2 scale = vec2(1.0);
uniform bool flip = false;
uniform sampler2D albedo;
void fragment() {
vec2 uv = UV * scale - direction_and_speed * TIME;
if (flip) { uv = 1.0 - uv; }
ALBEDO = texture(albedo, uv).rgb;
}

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=10 format=3 uid="uid://b8u4bo4mklj55"]
[gd_scene load_steps=14 format=3 uid="uid://b8u4bo4mklj55"]
[ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_dubwq"]
[ext_resource type="PackedScene" uid="uid://nxapkgcq2c70" path="res://Nodes/light_setup.tscn" id="2_1lh4t"]
[ext_resource type="PackedScene" 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"]
@@ -9,6 +9,19 @@
[ext_resource type="AudioStream" uid="uid://c5jhukuk8r3mf" path="res://Assets/Sounds/_MUSIC_/GameJamGameLoop.wav" id="7_wagg2"]
[ext_resource type="AudioStream" uid="uid://n4ynf7hg2pcl" path="res://Assets/Sounds/_SOUNDFX_/GleiseLoop.wav" id="8_c6uwu"]
[ext_resource type="AudioStream" uid="uid://dovvnflvxtqpi" path="res://Assets/Sounds/_SOUNDFX_/WindLoop.wav" id="9_q7v3t"]
[ext_resource type="Shader" path="res://Nodes/game.gdshader" id="10_s0qsw"]
[ext_resource type="Texture2D" uid="uid://cy6x8d3xe8lux" path="res://icon.svg" id="11_1bton"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_l0twu"]
render_priority = 0
shader = ExtResource("10_s0qsw")
shader_parameter/albedo = ExtResource("11_1bton")
shader_parameter/direction_and_speed = null
shader_parameter/flip = null
shader_parameter/scale = null
[sub_resource type="BoxMesh" id="BoxMesh_ygh83"]
material = SubResource("ShaderMaterial_l0twu")
[node name="Game" type="Node"]
script = ExtResource("1_dubwq")
@@ -44,3 +57,9 @@ autoplay = true
stream = ExtResource("9_q7v3t")
volume_db = -2.476
autoplay = true
[node name="Node3D" type="Node3D" parent="."]
[node name="MeshInstance3D" type="MeshInstance3D" parent="Node3D"]
transform = Transform3D(-3.93402e-06, 0, 90, 0, 1.168, 0, -90, 0, -3.93402e-06, 0, -1.88459, 0)
mesh = SubResource("BoxMesh_ygh83")

View File

@@ -33,6 +33,7 @@ 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

@@ -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"

View File

@@ -172,4 +172,4 @@ func fight():
emit_signal("shoot")
tween.tween_callback(func(): fight_state = FOUGHT).set_delay(0.7)
#Hallo
#Halloa