From ed6e3db4b800da15cc66f828eb0a04e8ebd57a4e Mon Sep 17 00:00:00 2001 From: Luna Brovchuk Date: Sun, 1 Oct 2023 21:43:39 +0200 Subject: [PATCH] Change Rats' Spawn Position --- src/models/enemies/rat/rat.gd | 2 ++ src/scenes/game/Game.tscn | 14 ++++++++- src/scenes/game/sprites/hatch1.png | Bin 0 -> 1903 bytes src/scenes/game/sprites/hatch1.png.import | 35 ++++++++++++++++++++++ src/scenes/game/sprites/hatch2.png | Bin 0 -> 1904 bytes src/scenes/game/sprites/hatch2.png.import | 35 ++++++++++++++++++++++ 6 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 src/scenes/game/sprites/hatch1.png create mode 100644 src/scenes/game/sprites/hatch1.png.import create mode 100644 src/scenes/game/sprites/hatch2.png create mode 100644 src/scenes/game/sprites/hatch2.png.import diff --git a/src/models/enemies/rat/rat.gd b/src/models/enemies/rat/rat.gd index 1e2ba26..57c7e67 100644 --- a/src/models/enemies/rat/rat.gd +++ b/src/models/enemies/rat/rat.gd @@ -4,6 +4,8 @@ var velocity = Vector2.ZERO var speed = 24 func _ready(): + randomize() + global_position = [Vector2(33, 50), Vector2(287, 70)][randi()%2] hp = 15 func _physics_process(delta): diff --git a/src/scenes/game/Game.tscn b/src/scenes/game/Game.tscn index 220d1d4..7ef2729 100644 --- a/src/scenes/game/Game.tscn +++ b/src/scenes/game/Game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=2] +[gd_scene load_steps=19 format=2] [ext_resource path="res://src/scenes/menu/background/background.png" type="Texture" id=1] [ext_resource path="res://src/scenes/game/sprites/background_houses.png" type="Texture" id=2] @@ -12,6 +12,8 @@ [ext_resource path="res://src/scenes/game/sprites/player_icon.png" type="Texture" id=10] [ext_resource path="res://src/scenes/game/game.gd" type="Script" id=11] [ext_resource path="res://src/scenes/game/sprites/ui_background.png" type="Texture" id=12] +[ext_resource path="res://src/scenes/game/sprites/hatch1.png" type="Texture" id=13] +[ext_resource path="res://src/scenes/game/sprites/hatch2.png" type="Texture" id=14] [ext_resource path="res://src/scenes/game/spell_recharge_bar.gd" type="Script" id=16] [sub_resource type="RectangleShape2D" id=2] @@ -65,6 +67,16 @@ shape = SubResource( 3 ) position = Vector2( 160, 109.875 ) shape = SubResource( 3 ) +[node name="Hatches" type="Node2D" parent="View/Background"] + +[node name="Hatch1" type="Sprite" parent="View/Background/Hatches"] +position = Vector2( 287, 70 ) +texture = ExtResource( 13 ) + +[node name="Hatch2" type="Sprite" parent="View/Background/Hatches"] +position = Vector2( 33, 50 ) +texture = ExtResource( 14 ) + [node name="Player" parent="View" instance=ExtResource( 5 )] position = Vector2( 46, 42 ) z_index = 1 diff --git a/src/scenes/game/sprites/hatch1.png b/src/scenes/game/sprites/hatch1.png new file mode 100644 index 0000000000000000000000000000000000000000..2275d23b6fbd0e884b3f5d5ff87093ed098e1257 GIT binary patch literal 1903 zcmcIlUu+ab9Ns2a5G_W1(D-21C9xR0x3jyqce`t^Qkrsmqvoo`Io8IoM zyW8Hi5fi~iO!Nf|jo?3wJRq^*1xdg}QKLSX5Ya@m;Q?Pvj1)}_4~oRu`v)4ReesgL zoxS_!`+f6$znyt$bY!q={X^?Hj_b+~<;K{31H0~9*U7%8c3zR$?M{DaN62w^-5*~a z+@aSWMG`gFXK0S=-CXk_nj#Tzk&@$Ogezx05_kt^gbA$x z3VuH+J415;8J`;|qPZz#U}19~-&->oflDID*W8L1nzf8j=QY_l{#g?EIwYFP2-&zG zKUo;%`)NS+upp+%>o zjKHKe*5LYWS}$z+#2k}q(3j){h}YBt778mvUAK)6qk$P#rK$Ip#9?vPC(;-R>2!d| zzzp%CjjdvSnMO1$)7xlk|NRez7_|%f(?O+f4@MHH5SMX>3@g|5`DTAWU_^r=rIl7v zqpga(q9!zc(}d$;S`8nI6*VW29E?atV5zaZfC%KGqL=`fYU**IvOxn{V2yxb1Xl;9 z*s*6<11%KHycb5$LnNQe2uxJMajf_Sl-t_S|^b-tE~#`@A3?TWY{ggI~JG7uiY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qgSS9SH}ZA*Xh z56^z^`E$1xUwfQYKY8bepH3d_JG;95mm~FKJAYm|@YNp&>wi5Gy}$9z%hH94v(mLl zrndLL{`B6hrv`pId%v;r#e2`BhA#G;J2j`Vvs+)d`2DvhiqcfPC+3Dnv#0kw@$BDJ CJaM`J literal 0 HcmV?d00001 diff --git a/src/scenes/game/sprites/hatch2.png.import b/src/scenes/game/sprites/hatch2.png.import new file mode 100644 index 0000000..dffaed8 --- /dev/null +++ b/src/scenes/game/sprites/hatch2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/hatch2.png-bc69695aedcadc7dd6f9b26c59de8255.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/scenes/game/sprites/hatch2.png" +dest_files=[ "res://.import/hatch2.png-bc69695aedcadc7dd6f9b26c59de8255.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