From f8f67c98391619f4aa2b7da9063cd1475b8da005 Mon Sep 17 00:00:00 2001 From: Just Dzhi Date: Sun, 1 Oct 2023 18:37:28 +0400 Subject: [PATCH] #TODO Rat --- res/shaders/colorize.tres | 4 +- src/models/enemies/rat/Rat.gd | 2 + src/models/enemies/rat/Rat.tscn | 23 ++++++++++++ src/models/enemies/rat/sprites/rat.png | Bin 0 -> 572 bytes src/models/enemies/rat/sprites/rat.png.import | 35 ++++++++++++++++++ .../enemies/rat/sprites/rat_spriteframes.tres | 27 ++++++++++++++ 6 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 src/models/enemies/rat/Rat.gd create mode 100644 src/models/enemies/rat/Rat.tscn create mode 100644 src/models/enemies/rat/sprites/rat.png create mode 100644 src/models/enemies/rat/sprites/rat.png.import create mode 100644 src/models/enemies/rat/sprites/rat_spriteframes.tres diff --git a/res/shaders/colorize.tres b/res/shaders/colorize.tres index dcdce01..f7d36b5 100644 --- a/res/shaders/colorize.tres +++ b/res/shaders/colorize.tres @@ -15,5 +15,5 @@ void fragment(){ [resource] shader = SubResource( 3 ) -shader_param/active = true -shader_param/color = Color( 1, 1, 1, 0 ) +shader_param/active = false +shader_param/color = Color( 1, 1, 1, 1 ) diff --git a/src/models/enemies/rat/Rat.gd b/src/models/enemies/rat/Rat.gd new file mode 100644 index 0000000..cf49cba --- /dev/null +++ b/src/models/enemies/rat/Rat.gd @@ -0,0 +1,2 @@ +extends KinematicBody2D + diff --git a/src/models/enemies/rat/Rat.tscn b/src/models/enemies/rat/Rat.tscn new file mode 100644 index 0000000..a359e3b --- /dev/null +++ b/src/models/enemies/rat/Rat.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://src/models/enemies/rat/sprites/rat_spriteframes.tres" type="SpriteFrames" id=1] +[ext_resource path="res://src/models/enemies/rat/Rat.gd" type="Script" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 8, 3 ) + +[node name="Rat" type="KinematicBody2D" groups=["enemy"]] +script = ExtResource( 2 ) + +[node name="Sprite" type="AnimatedSprite" parent="."] +frames = ExtResource( 1 ) +animation = "idle" +frame = 2 +playing = true +centered = false + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +position = Vector2( 12, 6 ) +shape = SubResource( 1 ) diff --git a/src/models/enemies/rat/sprites/rat.png b/src/models/enemies/rat/sprites/rat.png new file mode 100644 index 0000000000000000000000000000000000000000..93f6ff18d0b20199af2229343e3b695d143c7dc2 GIT binary patch literal 572 zcmV-C0>k}@P)Px$_DMuRR9J=WmN9GFP!Pxe7xD=jJSvMjc!>!Dt@#c@kAR>WN=J8br+f=RL1QKb zyx8aqbn5CLiYE{Cq|xBD<8`p^@gzODj;$sT^ao?<>E8Wx=ev6bdiCn{b|Sf8W~+f8 zx$=OrG(R6m^eVi6ao!8>@}(P%7XSccX-;jnU8v_BR%-{=9E%+Tz-GM#01QV14fP`z z$5d2XrM{GRD(AiNF7(RHJ(u6`BbT#ZA5D8UVZ+ft!)%Hv;X>^=ri1~YP`jql89eb{ zs2%*sZLC{gs)P6rasMZ;o<}pE<_IM}av8V#8~^rq#hFxzO)({$@xE%x1k!vl)6b?n zu~pQ`yeUs8rUU@&Tmr+GE?vZ@f)FYQC9Vdy%lI1cppi$-yr}IX`DAHM(#o6l7OQ1J z07xojv)*E}-cpw4^z+jrNu|seGg3iV@!8rH7G7<9P|4Nz=5rN_)w(at6v+kh9E>T+Y&*#-0NJJRA-5e3mtoKkD~CKOohjf)LL9 z0|21x6ij)t2O4KZooA{%GxR^TvFGq=Sav}Ir^dHh7FLGDrh*XHi>p?fUcGv~mi_`V#jSpHpq)qn0000< KMNUMnLSTZb(hLm% literal 0 HcmV?d00001 diff --git a/src/models/enemies/rat/sprites/rat.png.import b/src/models/enemies/rat/sprites/rat.png.import new file mode 100644 index 0000000..ee7c2f4 --- /dev/null +++ b/src/models/enemies/rat/sprites/rat.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/rat.png-e73e7b6a730462f71668a742e225b538.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/models/enemies/rat/sprites/rat.png" +dest_files=[ "res://.import/rat.png-e73e7b6a730462f71668a742e225b538.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/src/models/enemies/rat/sprites/rat_spriteframes.tres b/src/models/enemies/rat/sprites/rat_spriteframes.tres new file mode 100644 index 0000000..7fedab7 --- /dev/null +++ b/src/models/enemies/rat/sprites/rat_spriteframes.tres @@ -0,0 +1,27 @@ +[gd_resource type="SpriteFrames" load_steps=6 format=2] + +[ext_resource path="res://src/models/enemies/rat/sprites/rat.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 0, 0, 28, 11 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 1 ) +region = Rect2( 28, 0, 28, 11 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 1 ) +region = Rect2( 56, 0, 28, 11 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 1 ) +region = Rect2( 84, 0, 28, 11 ) + +[resource] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ) ], +"loop": true, +"name": "idle", +"speed": 12.0 +} ]