EEEEELLLLLLSSSSS uuuuuuuuuuuuuuuuuuuuuu

This commit is contained in:
Haze Weathers 2023-05-27 22:01:03 -04:00
parent 4c31420e52
commit 7df261b58e
11 changed files with 277 additions and 1 deletions

BIN
graphics/enemy/eel_body.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/eel_body.png-4e2a707966d6656d9260d34aba0d2f9d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/enemy/eel_body.png"
dest_files=[ "res://.import/eel_body.png-4e2a707966d6656d9260d34aba0d2f9d.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=true
svg/scale=1.0

BIN
graphics/enemy/eel_head.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/eel_head.png-29e1a9b9dd541b3771a77751dd32cb42.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/enemy/eel_head.png"
dest_files=[ "res://.import/eel_head.png-29e1a9b9dd541b3771a77751dd32cb42.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/eel_inner_border.png-ba82f5e4214fedd66b04b75d8ca636b6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/enemy/eel_inner_border.png"
dest_files=[ "res://.import/eel_inner_border.png-ba82f5e4214fedd66b04b75d8ca636b6.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=true
svg/scale=1.0

BIN
graphics/enemy/eel_tail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/eel_tail.png-359163ddc00e2ac41549552381ce8558.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/enemy/eel_tail.png"
dest_files=[ "res://.import/eel_tail.png-359163ddc00e2ac41549552381ce8558.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=true
svg/scale=1.0

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=2]
[gd_scene load_steps=21 format=2]
[ext_resource path="res://maps/map.gd" type="Script" id=1]
[ext_resource path="res://objects/hud/hud.tscn" type="PackedScene" id=2]
@ -15,6 +15,7 @@
[ext_resource path="res://objects/environment/bubble/bubble.tscn" type="PackedScene" id=13]
[ext_resource path="res://objects/enemy/squig.tscn" type="PackedScene" id=14]
[ext_resource path="res://objects/enemy/antlion.tscn" type="PackedScene" id=15]
[ext_resource path="res://objects/enemy/eel.tscn" type="PackedScene" id=16]
[sub_resource type="CanvasItemMaterial" id=12]
blend_mode = 3
@ -148,6 +149,9 @@ scale = Vector2( 1, 7 )
[node name="Antlion" parent="Enemies" instance=ExtResource( 15 )]
position = Vector2( 80, 256 )
[node name="Eel" parent="Enemies" instance=ExtResource( 16 )]
position = Vector2( 200, 80 )
[node name="Mines" type="Node2D" parent="Enemies"]
[node name="Mine" parent="Enemies/Mines" instance=ExtResource( 11 )]

55
objects/enemy/eel.gd Normal file
View file

@ -0,0 +1,55 @@
extends "res://objects/enemy/enemy.gd"
const SEGMENT_LENGTH: float = 4.0
const BASE_LENGTH: float = 20.0 # combined length of head and tail
export var segments: int = 8
export var speed: float = 32.0
export var wave_length: float = 8.0
export var wave_amplitude: float = 4.0
onready var sector: Vector2 = Game.get_sector(global_position)
onready var hitbox: Area2D = $Hitbox
onready var first_segment: CollisionShape2D = $"%Segment"
onready var segment_start: Position2D = $"%SegmentStart"
func _ready() -> void:
hitbox.remove_child(first_segment)
for i in segments:
var new_segment = first_segment.duplicate()
new_segment.position.x = segment_start.position.x + SEGMENT_LENGTH * float(i)
hitbox.add_child(new_segment)
$Hitbox/TailShape.position.x = segment_start.position.x + SEGMENT_LENGTH * segments
_wave_segments()
func _physics_process(delta: float) -> void:
# move
global_position.x -= speed * delta * sign(scale.x)
# make segments wibble
_wave_segments()
# check for wrapping
var sector_rect = Rect2(sector * Game.resolution, Game.resolution)
var total_length = BASE_LENGTH + (SEGMENT_LENGTH * float(segments))
var eel_rect = Rect2(global_position + Vector2(-2.0, 4.0), Vector2(total_length, 0.0))
if not sector_rect.intersects(eel_rect):
global_position.x += (Game.resolution.x + total_length) * sign(scale.x)
func _wave_segments() -> void:
for segment in hitbox.get_children():
if segment is Node2D:
segment.position.y = sin(segment.global_position.x / wave_length) * wave_amplitude
func die() -> void:
for segment in hitbox.get_children():
if segment is Node2D:
var death_particles = DeathParticles.instance()
death_particles.global_position = segment.global_position
death_particles.emitting = true
get_parent().add_child(death_particles)
.die()

77
objects/enemy/eel.tscn Normal file
View file

@ -0,0 +1,77 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://objects/enemy/eel.gd" type="Script" id=1]
[ext_resource path="res://graphics/enemy/eel_head.png" type="Texture" id=2]
[ext_resource path="res://graphics/enemy/eel_body.png" type="Texture" id=3]
[ext_resource path="res://graphics/enemy/eel_tail.png" type="Texture" id=4]
[ext_resource path="res://graphics/enemy/eel_inner_border.png" type="Texture" id=5]
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 2, 2 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 2, 2 )
[node name="Eel" type="Node2D" groups=["enemy"]]
script = ExtResource( 1 )
blood = false
wave_amplitude = 6.0
[node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox"]]
position = Vector2( 0, 4 )
[node name="SegmentStart" type="Position2D" parent="Hitbox"]
unique_name_in_owner = true
position = Vector2( 12, 0 )
__meta__ = {
"_gizmo_extents_": 5.0
}
[node name="HeadShape" type="CollisionPolygon2D" parent="Hitbox"]
position = Vector2( 8, 0 )
polygon = PoolVector2Array( -7, -2, 2, -2, 2, 2, -7, 2 )
[node name="HeadSprite" type="Sprite" parent="Hitbox/HeadShape"]
show_behind_parent = true
position = Vector2( -4, 0 )
texture = ExtResource( 2 )
[node name="InnerBorder" type="Sprite" parent="Hitbox/HeadShape"]
position = Vector2( 3, 0 )
z_index = -1
texture = ExtResource( 5 )
[node name="TailShape" type="CollisionShape2D" parent="Hitbox"]
position = Vector2( 16, 0 )
shape = SubResource( 3 )
[node name="TailSprite" type="Sprite" parent="Hitbox/TailShape"]
show_behind_parent = true
position = Vector2( 2, 0 )
texture = ExtResource( 4 )
[node name="InnerBorder" type="Sprite" parent="Hitbox/TailShape"]
position = Vector2( -2, 0 )
z_index = -1
texture = ExtResource( 5 )
[node name="Segment" type="CollisionShape2D" parent="Hitbox"]
unique_name_in_owner = true
position = Vector2( 12, 0 )
shape = SubResource( 2 )
[node name="SegmentSprite" type="Sprite" parent="Hitbox/Segment"]
show_behind_parent = true
texture = ExtResource( 3 )
[node name="InnerBorder" type="Sprite" parent="Hitbox/Segment"]
position = Vector2( -2, 0 )
z_index = -1
texture = ExtResource( 5 )
[node name="InnerBorder2" type="Sprite" parent="Hitbox/Segment"]
position = Vector2( 3, 0 )
z_index = -1
texture = ExtResource( 5 )
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]