forked from team-sg/hero-mark-2
add final boss to level select, make bullets hurt famira
This commit is contained in:
parent
c28e105e78
commit
f0a6cb49f3
8 changed files with 160 additions and 8 deletions
15
objects/enemy/2083_bullet.gd
Normal file
15
objects/enemy/2083_bullet.gd
Normal file
|
@ -0,0 +1,15 @@
|
|||
extends Area2D
|
||||
|
||||
const SmallExplosion = preload("res://objects/enemy/boss/2600_small_explosion.tscn")
|
||||
|
||||
export var direction: Vector2 = Vector2.LEFT
|
||||
export var speed: float = 50.0
|
||||
export var damage: float = 0.0
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position += direction * speed * delta
|
||||
|
||||
func _exit_tree() -> void:
|
||||
var explosion = SmallExplosion.instance()
|
||||
explosion.position = position
|
||||
get_parent().add_child(explosion)
|
40
objects/enemy/2083_bullet.tscn
Normal file
40
objects/enemy/2083_bullet.tscn
Normal file
|
@ -0,0 +1,40 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/enemy/stg_bullet.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/enemy/2083_bullet.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=5]
|
||||
extents = Vector2( 3, 3 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 6, 6 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 6, 0, 6, 6 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 12, 0, 6, 6 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=4]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 15.0
|
||||
} ]
|
||||
|
||||
[node name="2083Bullet" type="Area2D" groups=["hurt_famira"]]
|
||||
collision_layer = 128
|
||||
collision_mask = 128
|
||||
monitoring = false
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 4 )
|
||||
playing = true
|
|
@ -31,6 +31,7 @@ script = ExtResource( 2 )
|
|||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 4 )
|
||||
frame = 2
|
||||
playing = true
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="." groups=["arrow"]]
|
||||
|
|
|
@ -108,3 +108,9 @@ func _on_Shooting_state_physics_processing(delta) -> void:
|
|||
var weight := inverse_lerp(shoot_range_cast.cast_to.x, 0.0, distance)
|
||||
sg2083.hurt(breath_dps * weight * delta, true)
|
||||
sg2083.knock_back(breath_knockback * weight * delta, true)
|
||||
|
||||
|
||||
func _on_Hitbox_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group("hurt_famira"):
|
||||
hurt(area.damage)
|
||||
area.queue_free()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=29 format=2]
|
||||
[gd_scene load_steps=33 format=2]
|
||||
|
||||
[ext_resource path="res://objects/enemy/boss/famira.gd" type="Script" id=1]
|
||||
[ext_resource path="res://shaders/scale3x.gdshader" type="Shader" id=2]
|
||||
|
@ -1278,17 +1278,33 @@ _data = [ Vector2( 0, 0.5 ), 0.0, 0.890696, 0, 0, Vector2( 0.814474, 1 ), 0.0, 0
|
|||
offsets = PoolRealArray( 0, 0.163743, 0.432749, 0.596491, 0.853801, 1 )
|
||||
colors = PoolColorArray( 0.859375, 1, 0.974457, 1, 0.425781, 0.650085, 1, 1, 0.858946, 0.258824, 0.909804, 1, 0.925781, 0, 0.520752, 1, 0, 0, 0, 1, 0, 0, 0, 1 )
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=13]
|
||||
radius = 24.0
|
||||
height = 16.0
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=14]
|
||||
radius = 17.2705
|
||||
height = 33.3754
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=15]
|
||||
radius = 16.0
|
||||
height = 55.8645
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=16]
|
||||
radius = 16.0
|
||||
height = 55.8645
|
||||
|
||||
[node name="Famira" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_vertical_guides_": [ ]
|
||||
}
|
||||
|
||||
[node name="Hitbox" type="KinematicBody2D" parent="."]
|
||||
[node name="Collision" type="KinematicBody2D" parent="."]
|
||||
collision_layer = 4
|
||||
collision_mask = 0
|
||||
collision_mask = 128
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Collision"]
|
||||
position = Vector2( 12, -64 )
|
||||
shape = SubResource( 11 )
|
||||
|
||||
|
@ -1325,6 +1341,12 @@ texture = ExtResource( 9 )
|
|||
offset = Vector2( -14.8861, -10.6454 )
|
||||
flip_v = true
|
||||
|
||||
[node name="HitboxTransform" type="RemoteTransform2D" parent="ChickenMan/Hip/Body"]
|
||||
position = Vector2( -10.255, -0.546865 )
|
||||
rotation = -1.57079
|
||||
remote_path = NodePath("../../../../Hitbox/Body")
|
||||
update_scale = false
|
||||
|
||||
[node name="BackArm" type="Node2D" parent="ChickenMan/Hip/Body"]
|
||||
use_parent_material = true
|
||||
position = Vector2( -15.0905, 7.09585 )
|
||||
|
@ -1391,6 +1413,13 @@ z_index = 1
|
|||
texture = ExtResource( 10 )
|
||||
offset = Vector2( -12.5338, -3.19571 )
|
||||
|
||||
[node name="HitboxTransform" type="RemoteTransform2D" parent="ChickenMan/Hip/Body/Neck"]
|
||||
position = Vector2( 7.47667, -8.4856 )
|
||||
rotation = -2.96856
|
||||
scale = Vector2( 1, 1 )
|
||||
remote_path = NodePath("../../../../../Hitbox/Brain")
|
||||
update_scale = false
|
||||
|
||||
[node name="BreathParticles" type="CPUParticles2D" parent="ChickenMan/Hip/Body/Neck"]
|
||||
position = Vector2( 2.97876, -8.17331 )
|
||||
rotation = 0.437951
|
||||
|
@ -1431,6 +1460,13 @@ z_index = 1
|
|||
texture = ExtResource( 8 )
|
||||
offset = Vector2( -23.6288, 1.97347 )
|
||||
|
||||
[node name="HitboxTransform" type="RemoteTransform2D" parent="ChickenMan/Hip/Body/Neck/Headlower"]
|
||||
position = Vector2( -15.6932, 6.83872 )
|
||||
rotation = -4.70641
|
||||
scale = Vector2( 1, 1 )
|
||||
remote_path = NodePath("../../../../../../Hitbox/LowerJaw")
|
||||
update_scale = false
|
||||
|
||||
[node name="Headupper" type="Sprite" parent="ChickenMan/Hip/Body/Neck"]
|
||||
use_parent_material = true
|
||||
position = Vector2( 6.70938, -6.04151 )
|
||||
|
@ -1440,6 +1476,13 @@ z_index = 1
|
|||
texture = ExtResource( 9 )
|
||||
offset = Vector2( -21.4816, 1.20875 )
|
||||
|
||||
[node name="HitboxTransform" type="RemoteTransform2D" parent="ChickenMan/Hip/Body/Neck/Headupper"]
|
||||
position = Vector2( -15.711, -8.80663 )
|
||||
rotation = -1.57994
|
||||
scale = Vector2( 1, 1 )
|
||||
remote_path = NodePath("../../../../../../Hitbox/UpperJaw")
|
||||
update_scale = false
|
||||
|
||||
[node name="Eye" type="Sprite" parent="ChickenMan/Hip/Body/Neck/Headupper"]
|
||||
use_parent_material = true
|
||||
position = Vector2( -22.5774, -9.61752 )
|
||||
|
@ -1454,6 +1497,35 @@ scale = Vector2( 2.33905, 2.82204 )
|
|||
texture = ExtResource( 11 )
|
||||
offset = Vector2( -6.66188, -13.4386 )
|
||||
|
||||
[node name="Hitbox" type="Area2D" parent="."]
|
||||
position = Vector2( 8, -56 )
|
||||
collision_layer = 128
|
||||
collision_mask = 128
|
||||
monitorable = false
|
||||
|
||||
[node name="Body" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 0.0046196, -23.9291 )
|
||||
rotation = -0.0114733
|
||||
shape = SubResource( 13 )
|
||||
|
||||
[node name="Brain" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( 11.5072, -96.7914 )
|
||||
rotation = 2.48158
|
||||
z_index = 100
|
||||
shape = SubResource( 14 )
|
||||
|
||||
[node name="LowerJaw" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( -21.3082, -76.1166 )
|
||||
rotation = 1.66396
|
||||
z_index = 100
|
||||
shape = SubResource( 15 )
|
||||
|
||||
[node name="UpperJaw" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2( -21.8181, -103.259 )
|
||||
rotation = -1.66238
|
||||
z_index = 100
|
||||
shape = SubResource( 16 )
|
||||
|
||||
[node name="StateChart" type="Node" parent="."]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
|
@ -1557,6 +1629,8 @@ collision_mask = 4
|
|||
collide_with_areas = true
|
||||
collide_with_bodies = false
|
||||
|
||||
[connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"]
|
||||
[connection signal="body_entered" from="Hitbox" to="." method="_on_Hitbox_body_entered"]
|
||||
[connection signal="state_entered" from="StateChart/Root/Roar" to="." method="_on_Roar_state_entered" flags=3]
|
||||
[connection signal="state_entered" from="StateChart/Root/Chasing" to="." method="_on_Chasing_state_entered"]
|
||||
[connection signal="state_physics_processing" from="StateChart/Root/Chasing" to="." method="_on_Chasing_state_physics_processing"]
|
||||
|
|
|
@ -7,7 +7,7 @@ signal health_changed(amount)
|
|||
|
||||
enum State {DEAD, STAND, FORWARD, BACK, DUCK, BEAM}
|
||||
|
||||
const Bullet = preload("res://objects/enemy/2600_bullet.tscn")
|
||||
const Bullet = preload("res://objects/enemy/2083_bullet.tscn")
|
||||
const SmallExplosion = preload("res://objects/enemy/boss/2600_small_explosion.tscn")
|
||||
|
||||
|
||||
|
@ -16,6 +16,7 @@ export var shot_speed: float = 50.0
|
|||
export var move_speed: float = 30.0
|
||||
export var safe_from_breath: bool = false
|
||||
export var make_explosions: bool = false
|
||||
export var bullet_damage: float = 1.0
|
||||
export var explosion_rect: Rect2
|
||||
export var famira_path: NodePath
|
||||
|
||||
|
@ -70,6 +71,7 @@ func shoot() -> void:
|
|||
bullet.global_position = pos.global_position
|
||||
bullet.direction = Vector2.LEFT.rotated(pos.rotation)
|
||||
bullet.speed = shot_speed
|
||||
bullet.damage = bullet_damage
|
||||
get_parent().add_child(bullet)
|
||||
|
||||
|
||||
|
|
|
@ -1607,7 +1607,7 @@ update_scale = false
|
|||
|
||||
[node name="KneeBack" type="Sprite" parent="Axle"]
|
||||
modulate = Color( 0.74902, 0.74902, 0.74902, 1 )
|
||||
position = Vector2( 6.25088, 28.1233 )
|
||||
position = Vector2( 6.25089, 28.1233 )
|
||||
scale = Vector2( 1, -1 )
|
||||
z_index = -1
|
||||
texture = ExtResource( 8 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue