Skip to content

Commit

Permalink
fix: remove dead enemy collisions, add front-ray to blobs
Browse files Browse the repository at this point in the history
Blobs now turn around at platform edges (just adding the front-ray
opts-in to this)
  • Loading branch information
russmatney committed May 28, 2024
1 parent 0bc6f40 commit 3bc3f03
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
13 changes: 11 additions & 2 deletions src/dino/enemies/EnemyGym.tscn

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/dino/enemies/SSEnemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func _ready():
hitbox.body_entered.connect(_on_hitbox_body_entered)
hitbox.body_exited.connect(_on_hitbox_body_exited)

set_collision_layer_value(1, false) # walls,doors,env
set_collision_layer_value(4, true) # enemies
set_collision_mask_value(1, true) # sense walls/doors/tiles
set_collision_mask_value(12, true) # spikes

if state_label:
if show_debug:
state_label.set_visible(true)
Expand Down Expand Up @@ -297,6 +302,9 @@ func die():
if skull_particles:
skull_particles.set_emitting(true)

# remove from collision layer
set_collision_layer_value(4, false)

if not did_drop_drops:
did_drop_drops = true

Expand Down
6 changes: 6 additions & 0 deletions src/dino/enemies/blobs/Blob.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ radius = 74.2428
collision_layer = 8
collision_mask = 2049
script = ExtResource("1_nugmv")
should_hurt_to_touch = true

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 1)
Expand Down Expand Up @@ -223,6 +224,7 @@ horizontal_alignment = 1
[node name="SkullParticles" parent="." instance=ExtResource("6_fsp6w")]

[node name="GlowLight" type="PointLight2D" parent="."]
visible = false
texture = ExtResource("7_3c06x")

[node name="StunnedLight" type="PointLight2D" parent="."]
Expand All @@ -238,8 +240,12 @@ enabled = false
texture = ExtResource("7_3c06x")

[node name="Hopbox" type="Area2D" parent="."]
visible = false
collision_layer = 0
collision_mask = 10

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hopbox"]
shape = SubResource("CircleShape2D_jiqhh")

[node name="FrontRay" type="RayCast2D" parent="."]
position = Vector2(8, 2.08165e-12)
8 changes: 4 additions & 4 deletions src/dino/enemies/robots/Robot.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ shape = SubResource("RectangleShape2D_j2y1f")
texture_filter = 1
scale = Vector2(3, 3)
sprite_frames = SubResource("SpriteFrames_jcl5k")
animation = &"idle"
animation = &"run_right"
autoplay = "idle"
metadata/_aseprite_wizard_config_ = {
"layer": "",
Expand All @@ -395,20 +395,20 @@ metadata/_aseprite_wizard_config_ = {
metadata/_aseprite_wizard_source_file_hash_ = "5fae7e5f235db706a3047515520fb7dc"

[node name="FrontRay" type="RayCast2D" parent="."]
position = Vector2(-8, 0)
position = Vector2(8, 2.08165e-12)

[node name="LineOfSight" type="RayCast2D" parent="."]
collision_mask = 3

[node name="LowLineOfSight" type="RayCast2D" parent="."]
position = Vector2(0, 20)
rotation = 1.57079
rotation = -1.5708
target_position = Vector2(0, 40)
collision_mask = 2

[node name="HighLineOfSight" type="RayCast2D" parent="."]
position = Vector2(0, -10)
rotation = 1.57079
rotation = -1.5708
target_position = Vector2(0, 40)
collision_mask = 2

Expand Down
1 change: 0 additions & 1 deletion src/dino/enemies/robots/RobotGym.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ player_entity = SubResource("Resource_qtoub")

[node name="EnemyRobot" parent="." instance=ExtResource("3_r66ko")]
position = Vector2(70, -62)
should_hop = false

[node name="PurpleStoneTiles" parent="." instance=ExtResource("4_lkjus")]
layer_0/tile_data = PackedInt32Array(-65566, 262144, 2, -30, 262144, 4, 65507, 65536, 5, 65508, 589824, 2, 131044, 262144, 4, 65509, 131072, 5, 65510, 131072, 5, 65511, 524288, 2, 131047, 327680, 5, 131048, 131072, 5, 131049, 131072, 5, 131050, 131072, 5, 131051, 589824, 5, 65515, 262144, 2, 131052, 458752, 2, 131053, 196608, 2, 196589, 720896, 5, 196588, 65536, 4, 196590, 458752, 2, 196591, 196608, 2, 262126, 65536, 4, 262127, 720896, 5, 262128, 131072, 5, 196593, 65536, 2, 196594, 393216, 2, 262130, 196608, 4, 262129, 655360, 5, 196595, 131072, 5, 196596, 131072, 5, 196597, 131072, 5, 196598, 131072, 5, 196600, 458752, 2, 196599, 131072, 5, 262136, 65536, 4, 196601, 131072, 2, 196602, 196608, 2, 262138, 393216, 5, 262137, 131072, 4, 262139, 131072, 5, 262140, 131072, 5, 262142, 131072, 5, 262141, 131072, 5, 262143, 131072, 5, 196609, 196608, 5, 196608, 131072, 5, 131074, 65536, 5, 131075, 131072, 5, 131076, 524288, 2, 196612, 327680, 5, 196613, 196608, 5, 131078, 65536, 5, 131079, 524288, 2, 196615, 327680, 5, 196617, 131072, 5, 196616, 131072, 5, 196619, 131072, 5, 196618, 131072, 5, 131085, 65536, 5, 196620, 196608, 5, 131086, 196608, 5, 196623, 327680, 2, 262159, 262144, 4, 196624, 131072, 5, 131090, 65536, 5, 196625, 196608, 5, 131091, 131072, 5, 65556, 262144, 2, 131092, 589824, 5, 131093, 131072, 5, 131094, 524288, 5, 65558, 327680, 2, 65559, 131072, 5, 65560, 589824, 2, 65561, 196608, 5, 131096, 262144, 4)
Expand Down

0 comments on commit 3bc3f03

Please sign in to comment.