Added GunPowder Animation

This commit is contained in:
Arthur
2022-12-10 17:27:56 +01:00
parent c99a1530a2
commit 57c19def26
9 changed files with 95 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://lvlbpfnwlngv"] [gd_scene load_steps=18 format=3 uid="uid://md2ofbviios3"]
[ext_resource type="Script" path="res://scripts/Train.gd" id="1_0x664"] [ext_resource type="Script" path="res://scripts/Train.gd" id="1_0x664"]
[ext_resource type="PackedScene" uid="uid://vwjd5od63jgh" path="res://Nodes/Player.tscn" id="3_in6up"] [ext_resource type="PackedScene" uid="uid://vwjd5od63jgh" path="res://Nodes/Player.tscn" id="3_in6up"]
@@ -7,9 +7,11 @@
[ext_resource type="Texture2D" uid="uid://dsphpbpt27t1i" path="res://a3TCqhg.png" id="4_c3xfc"] [ext_resource type="Texture2D" uid="uid://dsphpbpt27t1i" path="res://a3TCqhg.png" id="4_c3xfc"]
[ext_resource type="Texture2D" uid="uid://d1m2jplf8u0h0" path="res://Nodes/walking_ball1.png" id="5_rgwud"] [ext_resource type="Texture2D" uid="uid://d1m2jplf8u0h0" path="res://Nodes/walking_ball1.png" id="5_rgwud"]
[ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="5_vgxqe"] [ext_resource type="PackedScene" uid="uid://byo1m0n20yl45" path="res://Nodes/cannon.tscn" id="5_vgxqe"]
[ext_resource type="Texture2D" uid="uid://d35iaj0nq122a" path="res://walking_powder1.png" id="6_kfxv2"]
[ext_resource type="Texture2D" uid="uid://eg0k8esm2scp" path="res://p5lFkJY.png" id="6_m0hj7"] [ext_resource type="Texture2D" uid="uid://eg0k8esm2scp" path="res://p5lFkJY.png" id="6_m0hj7"]
[ext_resource type="Texture2D" uid="uid://du7d6fk4dabd7" path="res://cVOQuID.png" id="7_d8go0"] [ext_resource type="Texture2D" uid="uid://du7d6fk4dabd7" path="res://cVOQuID.png" id="7_d8go0"]
[ext_resource type="Texture2D" uid="uid://ctbxpx6p36bdi" path="res://walking_ball2.png" id="8_0u1e2"] [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"]
[sub_resource type="BoxShape3D" id="BoxShape3D_okaqh"] [sub_resource type="BoxShape3D" id="BoxShape3D_okaqh"]
size = Vector3(1, 3.77669, 24) size = Vector3(1, 3.77669, 24)
@@ -35,6 +37,11 @@ animations = [{
"name": &"idle_ball", "name": &"idle_ball",
"speed": 1.0 "speed": 1.0
}, { }, {
"frames": [ExtResource("6_kfxv2")],
"loop": true,
"name": &"idle_powder",
"speed": 1.0
}, {
"frames": [ExtResource("6_m0hj7"), ExtResource("7_d8go0")], "frames": [ExtResource("6_m0hj7"), ExtResource("7_d8go0")],
"loop": true, "loop": true,
"name": &"walking", "name": &"walking",
@@ -44,6 +51,11 @@ animations = [{
"loop": true, "loop": true,
"name": &"walking_ball", "name": &"walking_ball",
"speed": 2.0 "speed": 2.0
}, {
"frames": [ExtResource("6_kfxv2"), ExtResource("10_a137a")],
"loop": true,
"name": &"walking_powder",
"speed": 2.0
}] }]
[node name="Train1" type="Node3D"] [node name="Train1" type="Node3D"]
@@ -86,7 +98,7 @@ transform = Transform3D(1, 0, -3.55271e-15, 0, 1, 0, 3.55271e-15, 0, 1, 3.19744e
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="CharacterBody3D"] [node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="CharacterBody3D"]
transform = Transform3D(0.3, 0, 0, 0, -1.31134e-08, 0.3, 0, -0.3, -1.31134e-08, 0, -2, 0) transform = Transform3D(0.3, 0, 0, 0, -1.31134e-08, 0.3, 0, -0.3, -1.31134e-08, 0, -2, 0)
frames = SubResource("SpriteFrames_6p0y6") frames = SubResource("SpriteFrames_6p0y6")
animation = &"idle_ball" animation = &"walking_powder"
speed_scale = 2.0 speed_scale = 2.0
playing = true playing = true

View File

@@ -2,9 +2,9 @@
[ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_iox18"] [ext_resource type="Script" path="res://scripts/Logic/Game.gd" id="1_iox18"]
[ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="2_61aog"] [ext_resource type="PackedScene" uid="uid://bqe8ucbruto1j" path="res://Nodes/StartNode.tscn" id="2_61aog"]
[ext_resource type="PackedScene" uid="uid://lvlbpfnwlngv" path="res://Nodes/Train_P1.tscn" id="3_0be5n"] [ext_resource type="PackedScene" path="res://Nodes/Train_P1.tscn" id="3_0be5n"]
[ext_resource type="PackedScene" uid="uid://cys06pnxfjl2m" path="res://Nodes/UI.tscn" id="4_kxuy0"] [ext_resource type="PackedScene" uid="uid://cys06pnxfjl2m" path="res://Nodes/UI.tscn" id="4_kxuy0"]
[ext_resource type="PackedScene" uid="uid://ckkn7rha3voqv" path="res://Nodes/Train_P2.tscn" id="4_lmu0s"] [ext_resource type="PackedScene" path="res://Nodes/Train_P2.tscn" id="4_lmu0s"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ghq3e"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ghq3e"]
sky_top_color = Color(0.662745, 0.356863, 0.129412, 1) sky_top_color = Color(0.662745, 0.356863, 0.129412, 1)

View File

@@ -13,7 +13,6 @@ grow_vertical = 2
script = ExtResource("1_hyw8p") script = ExtResource("1_hyw8p")
[node name="ColorRect" type="ColorRect" parent="."] [node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
@@ -22,7 +21,6 @@ grow_vertical = 2
color = Color(0.513726, 0.403922, 0.27451, 1) color = Color(0.513726, 0.403922, 0.27451, 1)
[node name="VBoxContainer" type="VBoxContainer" parent="."] [node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8 anchors_preset = 8
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@@ -69,7 +67,6 @@ offset_bottom = 156.0
text = "Quit" text = "Quit"
[node name="FullScreen" type="Button" parent="VBoxContainer"] [node name="FullScreen" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Fullscreen" text = "Fullscreen"
[connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"] [connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"]

View File

@@ -2,10 +2,13 @@ extends Module
class_name Storage class_name Storage
enum TYPE {AMMO, GUNPOWDER, FUEL} enum TYPE {CANNONBALL, GUNPOWDER, COAL}
@export var currentType: TYPE @export var currentType: TYPE
#------------Methods-------------# #------------Methods-------------#
func _ready(): func _ready():
var root = get_tree().root.get_child(0) var root = get_tree().root.get_child(0)

View File

@@ -84,4 +84,6 @@ func fill_inventory(type):
0: 0:
walking = "walking_ball" walking = "walking_ball"
idle = "idle_ball" idle = "idle_ball"
1:
walking = "walking_powder"
idle = "idle_powder"

BIN
walking_powder1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d35iaj0nq122a"
path.s3tc="res://.godot/imported/walking_powder1.png-1a1e28f4d96f4b0ad232054892f24904.s3tc.ctex"
path.etc2="res://.godot/imported/walking_powder1.png-1a1e28f4d96f4b0ad232054892f24904.etc2.ctex"
metadata={
"imported_formats": ["s3tc", "etc2"],
"vram_texture": true
}
[deps]
source_file="res://walking_powder1.png"
dest_files=["res://.godot/imported/walking_powder1.png-1a1e28f4d96f4b0ad232054892f24904.s3tc.ctex", "res://.godot/imported/walking_powder1.png-1a1e28f4d96f4b0ad232054892f24904.etc2.ctex"]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

BIN
walking_powder2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

View File

@@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ckdlv6b7okseq"
path.s3tc="res://.godot/imported/walking_powder2.png-5a113d581eccb8a91f2adb6e40a561d4.s3tc.ctex"
path.etc2="res://.godot/imported/walking_powder2.png-5a113d581eccb8a91f2adb6e40a561d4.etc2.ctex"
metadata={
"imported_formats": ["s3tc", "etc2"],
"vram_texture": true
}
[deps]
source_file="res://walking_powder2.png"
dest_files=["res://.godot/imported/walking_powder2.png-5a113d581eccb8a91f2adb6e40a561d4.s3tc.ctex", "res://.godot/imported/walking_powder2.png-5a113d581eccb8a91f2adb6e40a561d4.etc2.ctex"]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0