From 096acaed54c7e4c56ce164f784a2cb1e26e7bb40 Mon Sep 17 00:00:00 2001 From: Luna Brovchuk Date: Mon, 2 Oct 2023 22:47:34 +0200 Subject: [PATCH] Fix Enemy Spawn Positions --- src/models/bullet/bullet.gd | 11 ++++++- src/models/enemies/bat/Bat.tscn | 2 +- src/models/enemies/bat/bat.gd | 34 +++++++++++---------- src/models/enemies/ghost/ghost.gd | 2 ++ src/models/explosion/Explosion.tscn | 35 ++++++++++++++++++++++ src/models/explosion/explosion.gd | 13 ++++++++ src/models/explosion/sprites/0.png | Bin 0 -> 2177 bytes src/models/explosion/sprites/0.png.import | 35 ++++++++++++++++++++++ src/models/explosion/sprites/1.png | Bin 0 -> 2049 bytes src/models/explosion/sprites/1.png.import | 35 ++++++++++++++++++++++ src/models/explosion/sprites/2.png | Bin 0 -> 2160 bytes src/models/explosion/sprites/2.png.import | 35 ++++++++++++++++++++++ src/models/explosion/sprites/3.png | Bin 0 -> 2161 bytes src/models/explosion/sprites/3.png.import | 35 ++++++++++++++++++++++ src/models/explosion/sprites/4.png | Bin 0 -> 2171 bytes src/models/explosion/sprites/4.png.import | 35 ++++++++++++++++++++++ src/models/player/player.gd | 1 + 17 files changed, 256 insertions(+), 17 deletions(-) create mode 100644 src/models/explosion/Explosion.tscn create mode 100644 src/models/explosion/explosion.gd create mode 100644 src/models/explosion/sprites/0.png create mode 100644 src/models/explosion/sprites/0.png.import create mode 100644 src/models/explosion/sprites/1.png create mode 100644 src/models/explosion/sprites/1.png.import create mode 100644 src/models/explosion/sprites/2.png create mode 100644 src/models/explosion/sprites/2.png.import create mode 100644 src/models/explosion/sprites/3.png create mode 100644 src/models/explosion/sprites/3.png.import create mode 100644 src/models/explosion/sprites/4.png create mode 100644 src/models/explosion/sprites/4.png.import diff --git a/src/models/bullet/bullet.gd b/src/models/bullet/bullet.gd index 4b906ee..0122649 100644 --- a/src/models/bullet/bullet.gd +++ b/src/models/bullet/bullet.gd @@ -1,5 +1,7 @@ extends KinematicBody2D +var explosion_preload = preload("res://src/models/explosion/Explosion.tscn") +var explode = false var velocity = Vector2.ZERO var speed = 128 var poison_damage = 0 @@ -12,6 +14,7 @@ var prev_target var target var explosive_damage = 0 var speed_modifier = 1 +var target_center func choose_target(): target = null @@ -20,6 +23,7 @@ func choose_target(): var enemies = get_tree().get_nodes_in_group("enemy") for enemy in enemies: enemy.material = null + if enemy.global_position.y < 20 or enemy.global_position.x < 20 or enemy.global_position.x > 300 or enemy.global_position.y > 120: continue enemy_dist = global_position.distance_to(enemy.global_position) if enemy_dist < least_dist and enemy != prev_target: least_dist = enemy_dist @@ -29,7 +33,7 @@ func _physics_process(delta): if target != null and is_instance_valid(target) and not target.dead: var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0) var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width()) - var target_center = target.global_position + (target_sprite_size / 2) + target_center = target.global_position + (target_sprite_size / 2) if target.is_in_group("rat"): target_center = target.global_position + Vector2(0, 2) self.global_position = self.global_position.move_toward(target_center, delta * speed * speed_modifier) @@ -45,6 +49,11 @@ func area_entered(area): parent.frozen_timer = 0 parent.poison_damage = poison_damage parent.poisoned_timer = 0 + if not explode and explosive_damage != 0: + explode = true + var explosion = explosion_preload.instance() + explosion.global_position = target_center + Vector2(0, -16) + get_parent().add_child(explosion) if bounced >= ricochet_count: call_deferred("free") choose_target() diff --git a/src/models/enemies/bat/Bat.tscn b/src/models/enemies/bat/Bat.tscn index 8620912..f5ef64e 100644 --- a/src/models/enemies/bat/Bat.tscn +++ b/src/models/enemies/bat/Bat.tscn @@ -22,7 +22,7 @@ script = ExtResource( 2 ) use_parent_material = true frames = ExtResource( 1 ) animation = "idle" -frame = 3 +frame = 2 playing = true centered = false diff --git a/src/models/enemies/bat/bat.gd b/src/models/enemies/bat/bat.gd index 5d89c57..0e60c36 100644 --- a/src/models/enemies/bat/bat.gd +++ b/src/models/enemies/bat/bat.gd @@ -11,24 +11,28 @@ var shot = false var sonic_wave func _ready(): + randomize() + self.global_position.x = ([-1, 1][randi()%2] * 320) + randi()%40 + 20 + self.global_position.y = ([-1, 1][randi()%2] * 180) + randi()%40 + 20 hp = 7 func _physics_process(delta): - if Global.playing: - if not shooting: - shooting_timer += delta - if shooting_timer >= 2.0: - shooting = true - shooting_timer = .0 - if shooting: - attack_timer += delta - if attack_timer >= .5 and not shot: - _shoot() - shot = true - if attack_timer >= 1.0: - attack_timer = 0 - shooting = false - shot = false + if not (global_position.y < 20 or global_position.x < 20 or global_position.x > 300 or global_position.y > 120): + if Global.playing: + if not shooting: + shooting_timer += delta + if shooting_timer >= 2.0: + shooting = true + shooting_timer = .0 + if shooting: + attack_timer += delta + if attack_timer >= .5 and not shot: + _shoot() + shot = true + if attack_timer >= 1.0: + attack_timer = 0 + shooting = false + shot = false var player_position = player.global_position + Vector2(12, 12) var angle = get_angle_to(player_position) diff --git a/src/models/enemies/ghost/ghost.gd b/src/models/enemies/ghost/ghost.gd index dcdd6d6..fc196b1 100644 --- a/src/models/enemies/ghost/ghost.gd +++ b/src/models/enemies/ghost/ghost.gd @@ -7,6 +7,8 @@ var dash_timer = .0 var dashing = false func _ready(): + self.global_position.x = ([-1, 1][randi()%2] * 320) + randi()%120 + 50 + self.global_position.y = ([-1, 1][randi()%2] * 180) + randi()%40 + 20 hp = 8 func _physics_process(delta): diff --git a/src/models/explosion/Explosion.tscn b/src/models/explosion/Explosion.tscn new file mode 100644 index 0000000..0763b44 --- /dev/null +++ b/src/models/explosion/Explosion.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://src/models/explosion/explosion.gd" type="Script" id=1] +[ext_resource path="res://src/models/explosion/sprites/4.png" type="Texture" id=2] +[ext_resource path="res://src/models/explosion/sprites/3.png" type="Texture" id=3] +[ext_resource path="res://src/models/explosion/sprites/2.png" type="Texture" id=4] +[ext_resource path="res://src/models/explosion/sprites/1.png" type="Texture" id=5] +[ext_resource path="res://src/models/explosion/sprites/0.png" type="Texture" id=6] + +[sub_resource type="CapsuleShape2D" id=1] +radius = 16.0 +height = 10.0 + +[sub_resource type="SpriteFrames" id=2] +animations = [ { +"frames": [ ExtResource( 6 ), ExtResource( 5 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 10.0 +} ] + +[node name="Explosion" type="StaticBody2D"] +script = ExtResource( 1 ) + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +rotation = 1.5708 +shape = SubResource( 1 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 2 ) +playing = true + +[connection signal="animation_finished" from="AnimatedSprite" to="." method="animation_finished"] diff --git a/src/models/explosion/explosion.gd b/src/models/explosion/explosion.gd new file mode 100644 index 0000000..9a5f338 --- /dev/null +++ b/src/models/explosion/explosion.gd @@ -0,0 +1,13 @@ +extends StaticBody2D + +var damage = 10 + +func _ready(): + var areas = $Area2D.get_overlapping_areas() + for area in areas: + var parent = area.get_parent() + if parent.is_in_group("enemy"): + parent.deal_damage(damage) + +func animation_finished(): + call_deferred("free") diff --git a/src/models/explosion/sprites/0.png b/src/models/explosion/sprites/0.png new file mode 100644 index 0000000000000000000000000000000000000000..90f9b2338cc6c46fb3e3dd76c1233a23e9e9abb7 GIT binary patch literal 2177 zcmcImUuYaf9Nxaf+FGS)i&|gS4Mj!gcJ}|xnrlt7X%p~bNCQogLS}bn@7CPyuDhGu zCD<0F6%zjuMGIDG38Lsj!50N>XlY*5m!LkVMEWFRjZ&}==1phsUlUDYP(0Y%*|~4N z-#5SS_uILtf&Rlgw(Z@@awT*qBJF$G4-EI$ikHs9feOG#I;of}f z9*(<>ctgXNvBqtoz@-QEE z)1ucq8POw?{X@>=sDp@bU_akkH5oyfCYZ05OMYxtb3%>RWaD&N6!;n>8O;e@X+VBB zKfref5#^1H3>*j{Z=j51>l!xDBfJb{S%kVMDL^tzRW~J-Z+rw6E+VcuXdP+v4C1Qp*exM#{7Z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$AlcB9GCRG&rpY^&^?@Z5><8HR9X{2qK1AG`Bmk-;;15tR03}vr6er{4?}|?9PsyN% z)|*7$wYg>{k9TZqm^~}-L-w>mQEZfs&yvo;X$x$&5z9U9a$n=>YmHBCI6~xp`&#eZ zvQp*Cu9>?FUAcpxyL-|Dx!WV#wPT$pCrz9>dHTr5_l;V%sMkg>EogJz+A`hv?93-+ z53M%4JRh!_Qc->Jitu{zz?6$`8jIKER91~Vu=c@VLEEyvHTLQCJREI1as27-UHfY` z^&QB2dqU(RdcLot_UoteI-c2@KVkF}m#NymmwLLoW|b;maYaEmDZi#QG57M$MQU`4?kqaLwyxoa_iui`@JjJU-?OnZ<$T@V-oB5Yn|ONK z=B5F1>L^F=r8O@fxqVK5VeQpIrb*P7l#IUgUgxf^8y@=8fq9RuJlpg8hV$codj6Hc zJ%vB+6UMsxNA5dgnD9#b#{GxtTdFREmaizf*}Q15u66ssje>)Pi(9uvmVR(6ak|Vt vq2QhFZEr=x{T;^^&RcQzk7e5V6SIE}_g}bp`1U;OKY^#R#=U#a;+1~^RJG!8 literal 0 HcmV?d00001 diff --git a/src/models/explosion/sprites/2.png.import b/src/models/explosion/sprites/2.png.import new file mode 100644 index 0000000..2daa70f --- /dev/null +++ b/src/models/explosion/sprites/2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/2.png-41242ab1d12bd2382159018fca8a7c9f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/models/explosion/sprites/2.png" +dest_files=[ "res://.import/2.png-41242ab1d12bd2382159018fca8a7c9f.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/explosion/sprites/3.png b/src/models/explosion/sprites/3.png new file mode 100644 index 0000000000000000000000000000000000000000..d814f64014c50a99214d2e0076882af7ad95685a GIT binary patch literal 2161 zcmcImeQeZZ9PWs2z&@gz&JU23Vg!X=KX1L(9WZv&JKSx!9Wnul@3n7tg}b)49e0Ng z5r<&`f&&8zA|D!%=)fa}fGjG30Erq27)cBy`~!$4fFvS8V|;sGpu*fgUefE^-t#`c z=Y5`E-(K&GmZvL6K0Fe`u*y&{(1y+|I>rt!Mc*5{ulJzS2s8M+jbY_A?oonmc=tgJ zD_yTeI-HJhvm_e{4^WIK^rR9dLStC{l#~hN1<=8xuv63h#N`8D5V)rJiCNw-9X1$a5g6IosfjosT6foCDk0zc8<7Q{Qk zGw?>kg1F#eNtvc;To64>w9X3zaT3nbEKAXK6vL5>An|n)!{hl6fy!BmDzyck$`?ad zej?^LrbJQ6WYUx5JciXtF`_6^G)u88i4dfn)*X-{b$eWaApmXJ(o9D)blhbGQKQT8 z6G&=q4GFVItJ`^>kYiK|m=xoo-8B_};qc(lM52hcou-ATN?z}6iS0<*gj5@}jV?=u zO$(v!j4Ko~V}@hcG2;%}ia-BNp&}Oxnq5{rYmXvRFb)%l+eTO>tIw1gEeIULiWo+` zkkpJqMV#e4UVOqVO;?Ph{kW?rKLG}S1N{U_4dq3XG#g<#2?a-U6KPJO=^QkS8bJXL z7#i46G&MaGXgDl|blU;C3_}4wfkb&UO_69`V56)WCB-PildQrsq^JsjQ~<+sfM*#W z%;`e&1BTq?I^oXG^{ryah@Do{wDz|*8JD)1!qMpfYBXdbd^c9n>& z)zZ+T1LC)`x~de!DD#{QRZ%8=UgQ-UMT~%f3Mm3XQN1#d1;`Qj&AN?7+_1uig4{*- z6DO2xsyBV>gx~8eKZrHFoP)9~t=v~rrV_hwVl`IJb8X_Ib&U8Gpt_QEE7}!5t$QYNx z_0!eYR)((M9lL+~bCX9+ocY3%dtYCEeAS_zk4mbqJgWB$`;s3OS|RlI%|2ZJ$o9ph zBUdlqv8DdZ=^KHncIw2{)-g@}sjE9HFRo10XeSQt@4k9raYO$*pY^@fYb^iv)Y@c3 zjW6RjAGT>__JuN7la_k-eLm3M{Me>rqeH>_*7nwe?%5R>u-`kfF%-O_ z476<9ec>BVdHm3546FLB@956HiL2VG+pcfHyt`%Y=#sbnzXmQo4}SW+j;5KCuJ%V5id^aUTrp(v_7@0XeEa&E)9~YG_w}4V m_UVyd`YX51{qRKhAHxo9$jr)ASDbbK6oi^u0=uTYxb!c|joX_5 literal 0 HcmV?d00001 diff --git a/src/models/explosion/sprites/3.png.import b/src/models/explosion/sprites/3.png.import new file mode 100644 index 0000000..1d95ac9 --- /dev/null +++ b/src/models/explosion/sprites/3.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/3.png-5688b816e8f3e17c802b934c1cd11fac.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/models/explosion/sprites/3.png" +dest_files=[ "res://.import/3.png-5688b816e8f3e17c802b934c1cd11fac.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/explosion/sprites/4.png b/src/models/explosion/sprites/4.png new file mode 100644 index 0000000000000000000000000000000000000000..01f47ad28aded7bb8b1b83e5b1a8d4227683eb5a GIT binary patch literal 2171 zcmcImeQXnD9KJ<`x$%*}NPq;mU6bjM>wWZk*E=b&wZko0VHpbyP~q*}+xD`y*WKOL zZn7cs3l|usGCmwG;AhYbhJsOuI07sfh(M3os0uSXJq*MQ0Wr#rfmVcTd~Mi|F)dta7D+VTDtzBM*CH z*K`aUw_UBPH|u@XlB`ASK+*iro`}Q{8pGx#05J`$}~;mf@o*_yb}oGJe;LjmZEuzagdB4alFKEc;-W(a=H?bYQ2jy z#n6?T2$^O~qNsR0ZjU?cnjWMWQ4}efrC63k2-0YYnjk?&4O^DM3k_LUW2UM_af=c7 zwI`+|PegsK~j3u_is7vPY3A7={tVZ6GX@(if9FIs~Ss z*J)Zfn^aAQZ-O?Et%(I8Enjq!YZC>Itj>Due%A^ z3K=Ry=C*nt_r|6(O&bqEL^?|NX_%n}%s9|tSr9q>pUp)*NW1}>N0⁡QvSI8C&HL zhz23rIVr+g3}tOG=}@SD=5;skY|oUTZnn}iGB%WhV9t;Q*=C{zg=H8(lS}|ONx{jn zr07=|60#i6usqEG7f9C)tN)(O`GE+5%#aS3D3Gkk0n!!l2S_ELh>Vk#1zK?2Gdra} zErS|eZwh(O=9*nR+Oe%+?p=W{a&H?LMMml9T|#ZWcnibwI;*^8b@eY@T)BG63;2W! zu4j+;oa=cmsTbYJ+m@fVXLnKjy*V3`gC%*jXIH&l(1{I@ABFtJ9lC4%-)WL@@E7 zq2_3DwC&*DV};o6{C6(%!;6O|&)L>JG)Zb$mgni{{bl#Z{IvcRzm1M)pBJ1xJkU+$UFZ|k+49ltNq>aL!0V}EtUP|>-` zo39tXGHc|M;*)=NR2~Z14tG0$RJP98sxPXL|9EKL^T&O+Prtj<`g>4SvBbNtd~L^H D?sMWz literal 0 HcmV?d00001 diff --git a/src/models/explosion/sprites/4.png.import b/src/models/explosion/sprites/4.png.import new file mode 100644 index 0000000..6ff975f --- /dev/null +++ b/src/models/explosion/sprites/4.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/4.png-5590e0566be025759130a2112c402cbe.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/models/explosion/sprites/4.png" +dest_files=[ "res://.import/4.png-5590e0566be025759130a2112c402cbe.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/player/player.gd b/src/models/player/player.gd index 2265644..5352b01 100644 --- a/src/models/player/player.gd +++ b/src/models/player/player.gd @@ -54,6 +54,7 @@ func choose_target(): var enemies = get_tree().get_nodes_in_group("enemy") for enemy in enemies: enemy.material = null + if enemy.global_position.y < 20 or enemy.global_position.x < 20 or enemy.global_position.x > 300 or enemy.global_position.y > 120: continue enemy_dist = global_position.distance_to(enemy.global_position) if enemy_dist < least_dist: least_dist = enemy_dist