forked from team-sg/hero-mark-2
begun work on msx off level indicator
This commit is contained in:
parent
137f5ff414
commit
2774decaf9
10 changed files with 351 additions and 60 deletions
|
@ -13,8 +13,7 @@ onready var respawn_raycast = $RespawnRaycast
|
|||
onready var shard_position = $Position2D
|
||||
onready var start_position = position
|
||||
onready var blink_timer = $BlinkTimer
|
||||
onready var text_anim = $TextAnim
|
||||
onready var cop_detector = $CopDetector
|
||||
onready var text_anims = $TextAnim
|
||||
const shard = preload("res://objects/collectibles/shard.tscn")
|
||||
const BloodSpray := preload("res://objects/environment/blood/blood_spray.tscn")
|
||||
#DIALOGUE
|
||||
|
@ -26,6 +25,11 @@ const fucking_cop = preload("res://audio/sounds/msx_fucking_cop.ogg")
|
|||
const goddammit = preload("res://audio/sounds/msx_goddammit.ogg")
|
||||
const motherfucker = preload("res://audio/sounds/msx_motherfucker.ogg")
|
||||
const shit = preload("res://audio/sounds/msx_shit.ogg")
|
||||
const death_sounds = [
|
||||
Audio.a_msx_die,
|
||||
fuck,
|
||||
shit
|
||||
]
|
||||
|
||||
func _ready():
|
||||
raycast.add_exception($Hitbox)
|
||||
|
@ -43,14 +47,14 @@ func _physics_process(delta):
|
|||
if raycast.get_collider().is_in_group("player_hitbox"):
|
||||
if first_lead == true:
|
||||
Audio.play_sound(help_me,Audio.ac_voice)
|
||||
text_anim.play("help me")
|
||||
text_anims.play("help me")
|
||||
first_lead = false
|
||||
is_moving = true
|
||||
velocity.y += 128 * delta
|
||||
velocity = move_and_slide_with_snap(velocity, Vector2.DOWN, Vector2.UP, true)
|
||||
#Anims
|
||||
if velocity.x == 0:
|
||||
if !anims.get_current_animation() == "give" && !anims.get_current_animation() == "respawn" && !anims.get_current_animation() == "blink" && !anims.get_current_animation() == "come here" && !anims.get_current_animation() == "help me": anims.play("idle")
|
||||
if !anims.get_current_animation() == "give" && !anims.get_current_animation() == "respawn" && !anims.get_current_animation() == "blink": anims.play("idle")
|
||||
else:
|
||||
anims.play("walk")
|
||||
#Stop at the end of path and give shard
|
||||
|
@ -59,12 +63,10 @@ func _physics_process(delta):
|
|||
velocity.x = 0
|
||||
if is_holding_shard:
|
||||
anims.play("give")
|
||||
#Cop detector
|
||||
if cop_detector.is_colliding():
|
||||
print(cop_detector.get_collider())
|
||||
|
||||
func spawn_shard():
|
||||
Audio.play_sound(here_take_this,Audio.ac_voice)
|
||||
text_anims.play("here take this")
|
||||
var ShardInstance = shard.instance()
|
||||
ShardInstance.global_position = Vector2(shard_position.global_position.x,shard_position.global_position.y)
|
||||
ShardInstance.number = 1
|
||||
|
@ -73,7 +75,7 @@ func spawn_shard():
|
|||
|
||||
func switch_action():
|
||||
Audio.play_sound(come_here,Audio.ac_voice)
|
||||
anims.play("come here")
|
||||
text_anims.play("come here")
|
||||
|
||||
func spray_blood():
|
||||
for i in 16:
|
||||
|
@ -92,7 +94,7 @@ func die():
|
|||
death_particles.global_position = global_position
|
||||
death_particles.emitting = true
|
||||
spray_blood()
|
||||
Audio.play_sound(Audio.a_msx_die,Audio.ac_die)
|
||||
Audio.play_sound(death_sounds[randi() % death_sounds.size()],Audio.ac_voice)
|
||||
is_moving = false
|
||||
velocity.x = 0
|
||||
position = start_position
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=26 format=2]
|
||||
[gd_scene load_steps=28 format=2]
|
||||
|
||||
[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1]
|
||||
[ext_resource path="res://graphics/npc/msx_respawn.png" type="Texture" id=2]
|
||||
|
@ -51,7 +51,7 @@ tracks/2/keys = {
|
|||
"values": [ 0 ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("HereTakeThis:visible")
|
||||
tracks/3/path = NodePath("Dialogue/HereTakeThis:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
|
@ -63,7 +63,7 @@ tracks/3/keys = {
|
|||
"values": [ false ]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/path = NodePath("ComeHere:visible")
|
||||
tracks/4/path = NodePath("Dialogue/ComeHere:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/imported = false
|
||||
|
@ -75,7 +75,7 @@ tracks/4/keys = {
|
|||
"values": [ false ]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/path = NodePath("HelpMe:visible")
|
||||
tracks/5/path = NodePath("Dialogue/HelpMe:visible")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/imported = false
|
||||
|
@ -169,7 +169,7 @@ tracks/2/keys = {
|
|||
"values": [ 0 ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("ComeHere:visible")
|
||||
tracks/3/path = NodePath("Dialogue/ComeHere:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
|
@ -235,18 +235,6 @@ tracks/3/keys = {
|
|||
"method": "spawn_shard"
|
||||
} ]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/path = NodePath("HereTakeThis:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/keys = {
|
||||
"times": PoolRealArray( 0, 2.52 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ true, false ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=20]
|
||||
resource_name = "help me"
|
||||
|
@ -289,7 +277,7 @@ tracks/2/keys = {
|
|||
"values": [ 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3 ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("ComeHere:visible")
|
||||
tracks/3/path = NodePath("Dialogue/ComeHere:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
|
@ -301,7 +289,7 @@ tracks/3/keys = {
|
|||
"values": [ false ]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/path = NodePath("HelpMe:visible")
|
||||
tracks/4/path = NodePath("Dialogue/HelpMe:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/imported = false
|
||||
|
@ -354,7 +342,7 @@ tracks/2/keys = {
|
|||
"values": [ 0 ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("ComeHere:visible")
|
||||
tracks/3/path = NodePath("Dialogue/ComeHere:visible")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
|
@ -467,7 +455,7 @@ _data = [ Vector2( 0, 1 ), 0.0, -0.113537, 0, 0, Vector2( 1, 0 ), -3.35032, 0.0,
|
|||
[sub_resource type="Animation" id=21]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("HelpMe:visible")
|
||||
tracks/0/path = NodePath("Dialogue/HelpMe:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
|
@ -478,18 +466,74 @@ tracks/0/keys = {
|
|||
"update": 1,
|
||||
"values": [ false ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Dialogue/HereTakeThis:visible")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ false ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Dialogue/ComeHere:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ false ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=22]
|
||||
resource_name = "help me"
|
||||
length = 3.0
|
||||
[sub_resource type="Animation" id=23]
|
||||
resource_name = "come here"
|
||||
length = 1.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("HelpMe:visible")
|
||||
tracks/0/path = NodePath("Dialogue/ComeHere:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 2.9 ),
|
||||
"times": PoolRealArray( 0, 1.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ true, false ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=22]
|
||||
resource_name = "help me"
|
||||
length = 1.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Dialogue/HelpMe:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 1.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ true, false ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=24]
|
||||
resource_name = "here take this"
|
||||
length = 1.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Dialogue/HereTakeThis:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 1.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ true, false ]
|
||||
|
@ -575,7 +619,15 @@ __meta__ = {
|
|||
|
||||
[node name="BlinkTimer" type="Timer" parent="."]
|
||||
|
||||
[node name="HereTakeThis" type="Label" parent="."]
|
||||
[node name="TextAnim" type="AnimationPlayer" parent="."]
|
||||
anims/RESET = SubResource( 21 )
|
||||
"anims/come here" = SubResource( 23 )
|
||||
"anims/help me" = SubResource( 22 )
|
||||
"anims/here take this" = SubResource( 24 )
|
||||
|
||||
[node name="Dialogue" type="Node2D" parent="."]
|
||||
|
||||
[node name="HereTakeThis" type="Label" parent="Dialogue"]
|
||||
visible = false
|
||||
material = ExtResource( 6 )
|
||||
margin_left = -48.0
|
||||
|
@ -586,35 +638,26 @@ theme = ExtResource( 5 )
|
|||
text = "Here, take this"
|
||||
align = 1
|
||||
|
||||
[node name="ComeHere" type="Label" parent="."]
|
||||
[node name="ComeHere" type="Label" parent="Dialogue"]
|
||||
visible = false
|
||||
material = ExtResource( 6 )
|
||||
margin_left = -47.0
|
||||
margin_left = -96.0
|
||||
margin_top = -22.0
|
||||
margin_right = 58.0
|
||||
margin_right = 9.0
|
||||
margin_bottom = -8.0
|
||||
theme = ExtResource( 5 )
|
||||
text = "Hey, come here!"
|
||||
|
||||
[node name="HelpMe" type="Label" parent="."]
|
||||
[node name="HelpMe" type="Label" parent="Dialogue"]
|
||||
visible = false
|
||||
material = ExtResource( 6 )
|
||||
margin_left = -41.0
|
||||
margin_left = -76.0
|
||||
margin_top = -33.0
|
||||
margin_right = 43.0
|
||||
margin_right = 8.0
|
||||
margin_bottom = -10.0
|
||||
theme = ExtResource( 5 )
|
||||
text = "Help me get
|
||||
outta here!"
|
||||
align = 1
|
||||
|
||||
[node name="TextAnim" type="AnimationPlayer" parent="."]
|
||||
anims/RESET = SubResource( 21 )
|
||||
"anims/help me" = SubResource( 22 )
|
||||
|
||||
[node name="CopDetector" type="RayCast2D" parent="."]
|
||||
enabled = true
|
||||
cast_to = Vector2( -135, 0 )
|
||||
collision_mask = 3
|
||||
|
||||
[connection signal="timeout" from="BlinkTimer" to="." method="_on_BlinkTimer_timeout"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue