forked from team-sg/hero-mark-2
player.tscn: scholar of the first bullet casings
This commit is contained in:
parent
79cbd62a69
commit
bc57ba4171
45 changed files with 1429 additions and 113 deletions
|
@ -16,7 +16,7 @@ func _physics_process(delta):
|
|||
position.y -= speed * delta
|
||||
|
||||
func _on_area_entered(area):
|
||||
if area.is_in_group("player") or area.is_in_group("arrow"):
|
||||
if area.is_in_group("player_hitbox") or area.is_in_group("arrow"):
|
||||
sprite.frame_coords.y = 1
|
||||
speed = 0.0
|
||||
get_tree().create_timer(0.5, false).connect("timeout", self, "queue_free")
|
||||
|
|
|
@ -2,5 +2,5 @@ extends Area2D
|
|||
|
||||
func _on_Area2D_area_entered(area):
|
||||
#Kill player
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
area.get_parent().die()
|
||||
|
|
|
@ -15,7 +15,7 @@ func _physics_process(delta):
|
|||
anims.play("open")
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
if Game.score > Game.high_score: Game.high_score = Game.score
|
||||
#BONUSES
|
||||
#Collection bonus
|
||||
|
|
|
@ -22,7 +22,7 @@ func _physics_process(delta):
|
|||
position.y += fall_speed
|
||||
#Crush the player
|
||||
for area in crush_area.get_overlapping_areas():
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
var player = area.get_parent()
|
||||
if player.is_on_floor():
|
||||
player.die()
|
||||
|
@ -31,7 +31,7 @@ func _physics_process(delta):
|
|||
anims.play("disappear")
|
||||
|
||||
func _on_Area2D_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
fall_timer.start()
|
||||
sprite.frame = 1
|
||||
|
||||
|
@ -59,5 +59,5 @@ func _on_FallTimer_timeout():
|
|||
|
||||
|
||||
#func _on_Area2D_area_exited(area):
|
||||
# if area.is_in_group("player") && graphic == Graphics.GRAVEYARD:
|
||||
# if area.is_in_group("player_hitbox") && graphic == Graphics.GRAVEYARD:
|
||||
# sprite.frame = 0
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
extends Node2D
|
||||
onready var left_snap = $LeftSnap
|
||||
onready var right_snap = $RightSnap
|
||||
onready var middle = position.x + 4
|
||||
extends Area2D
|
||||
|
||||
onready var left_snap: float = $LeftSnap.global_position.x
|
||||
onready var right_snap: float = $RightSnap.global_position.x
|
||||
onready var middle: float = global_position.x + 4.0
|
||||
|
|
|
@ -5,13 +5,11 @@
|
|||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 6, 4 )
|
||||
|
||||
[node name="Ladder" type="Node2D"]
|
||||
[node name="Ladder" type="Area2D" groups=["ladder"]]
|
||||
collision_layer = 64
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
collision_layer = 64
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 4, 4 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ var sound = load("res://audio/sounds/button.ogg")
|
|||
|
||||
func _on_ActivationArea_area_entered(area):
|
||||
if !pressed:
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
activate()
|
||||
$Sprite.frame = 1
|
||||
pressed = true
|
||||
|
|
|
@ -4,7 +4,7 @@ export var speed = 120.0
|
|||
export var direction = Vector2.RIGHT
|
||||
|
||||
func _on_TubeEntrance_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
var player = area.get_parent()
|
||||
player.global_position = global_position + Vector2(4.0, 4.0)
|
||||
player.enter_transport(speed, direction)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
extends Area2D
|
||||
|
||||
func _on_TubeExit_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
area.get_parent().exit_transport()
|
||||
|
|
|
@ -35,9 +35,9 @@ func _on_DelayTimer_timeout():
|
|||
|
||||
|
||||
func _on_DetectPlayer_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
body.collision_layer = 0
|
||||
|
||||
func _on_DetectPlayer_area_exited(area):
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
body.collision_layer = collision_layer
|
||||
|
|
|
@ -9,7 +9,7 @@ func _physics_process(delta):
|
|||
|
||||
|
||||
func _on_Hitbox_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
area.get_parent().die()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue