Added spikes, Made a way to transition from level to level, and a base level to make level creation easier
This commit is contained in:
@@ -55,17 +55,9 @@ func player_death() -> void:
|
||||
Util.add_effect_to_self(self, deathEffect)
|
||||
queue_free()
|
||||
|
||||
func _on_hurt_box_area_entered(area: Area2D) -> void:
|
||||
#this checks if the area is a bullet
|
||||
if !area.get_parent().is_in_group("Enemy Bullet"):
|
||||
return
|
||||
var body = area.get_parent() as Node
|
||||
hurt(body)
|
||||
|
||||
func _on_hurt_box_body_entered(body: Node2D) -> void:
|
||||
if !body.is_in_group("Enemy"):
|
||||
return
|
||||
hurt(body)
|
||||
func _on_hurt_box_area_entered(_area: Area2D) -> void:
|
||||
player_death()
|
||||
GameManager.reset_level()
|
||||
|
||||
func hurt(enemy: Node2D) -> void:
|
||||
PlayerManager.decress_health(enemy.damage)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://dm4oirxl6bpnn"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cwwrpe5wfh7ds" path="res://entities/player/player_death_effect/art/spark.png" id="1_335v7"]
|
||||
[ext_resource type="Script" uid="uid://3g2l2xhvoxj8" path="res://entities/player/player_death_effect/player_death_effect.gd" id="1_i0k0j"]
|
||||
[ext_resource type="Texture2D" uid="uid://cmp35xmgh574d" path="res://entities/player/player_death_effect/art/partical_effect.png" id="2_ann6r"]
|
||||
[ext_resource type="Texture2D" uid="uid://cwwrpe5wfh7ds" path="res://Entities/Player/player_death_effect/art/spark.png" id="1_335v7"]
|
||||
[ext_resource type="Script" uid="uid://3g2l2xhvoxj8" path="res://Entities/Player/player_death_effect/player_death_effect.gd" id="1_i0k0j"]
|
||||
[ext_resource type="Texture2D" uid="uid://cmp35xmgh574d" path="res://Entities/Player/player_death_effect/art/partical_effect.png" id="2_ann6r"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_t8ru6"]
|
||||
colors = PackedColorArray(0, 1, 1, 1, 0, 0, 1, 1)
|
||||
|
||||
@@ -108,15 +108,12 @@ func multiJump():
|
||||
|
||||
if Input.is_action_just_pressed("move_jump") and canWallJump:
|
||||
var boost = 150
|
||||
print("wall jump")
|
||||
player.velocity.y = jumpHight
|
||||
var wallDirection = player.get_wall_normal().x
|
||||
var direction: float = GameInputEvents.movement_input()
|
||||
if direction == wallDirection:
|
||||
print("boost")
|
||||
player.velocity.x =+ (wallPushBack + boost) * wallDirection
|
||||
else:
|
||||
print("no boost")
|
||||
player.velocity.x =+ wallPushBack * wallDirection
|
||||
currentJumpCount = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user