Level 2 in progress

This commit is contained in:
Diego 2020-07-23 01:44:41 -05:00
parent a8c9e74d2f
commit 68da67a4c7
10 changed files with 85 additions and 10 deletions

View file

@ -5,7 +5,7 @@ resource_name = "Skeleton Hit"
length = 0.1 length = 0.1
step = 0.05 step = 0.05
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/path = NodePath("../Skeleton Enemy/Skeleton:modulate") tracks/0/path = NodePath("Skeleton:modulate")
tracks/0/interp = 1 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/imported = false tracks/0/imported = false

View file

@ -18,7 +18,8 @@ func _ready():
func _on_TextureButton_pressed(): func _on_TextureButton_pressed():
Player.respawn() Player.respawn()
get_tree().change_scene(Player.current_scene) print(Player.current_scene)
get_tree().change_scene(""+Player.current_scene+"")
func _on_TextureButton2_pressed(): func _on_TextureButton2_pressed():

View file

@ -25,7 +25,7 @@ func _physics_process(_delta):
if collider != null && collider.has_method("get_type") && collider.get_type() == "player": if collider != null && collider.has_method("get_type") && collider.get_type() == "player":
shoot_fireball(position.direction_to(player_position)) shoot_fireball(position.direction_to(player_position))
if dist <= 400: if dist <= 200:
velocity.x = position.direction_to(player_position).normalized().x * speed velocity.x = position.direction_to(player_position).normalized().x * speed
else: else:
velocity = Vector2(0, 0) velocity = Vector2(0, 0)

View file

@ -28,7 +28,7 @@ func _physics_process(_delta):
velocity.x *= speed velocity.x *= speed
velocity = move_and_slide(velocity, UP) velocity = move_and_slide(velocity, UP)
if dist <= 400: if dist <= 200:
velocity.x = position.direction_to(Player.position).normalized().x velocity.x = position.direction_to(Player.position).normalized().x
else: else:
velocity = Vector2(0, 0) velocity = Vector2(0, 0)

View file

@ -11,7 +11,6 @@ func _ready():
health = 3 health = 3
func _physics_process(delta): func _physics_process(delta):
Player.current_scene = "res://levels/World.tscn"
if knockback != Vector2.ZERO: if knockback != Vector2.ZERO:
knockback = lerp(knockback, Vector2.ZERO, 0.5) knockback = lerp(knockback, Vector2.ZERO, 0.5)
move_and_slide(-knockback * knockback_amount) move_and_slide(-knockback * knockback_amount)
@ -20,7 +19,7 @@ func _physics_process(delta):
return return
var player = Player.position var player = Player.position
var distance = global_position.distance_to(player) var distance = global_position.distance_to(player)
if distance <= 400: if distance <= 200:
if player.x > global_position.x: if player.x > global_position.x:
Spr.flip_h = false Spr.flip_h = false
velocity.x = speed velocity.x = speed

File diff suppressed because one or more lines are too long

View file

@ -9,4 +9,5 @@ func _on_Leap_body_entered(body):
func _on_Timer_timeout(): func _on_Timer_timeout():
Player.respawn() Player.respawn()
Player.current_scene = "res://levels/Campaign/Level 1/Level 1a.tscn"
get_tree().change_scene("res://levels/Campaign/Level 1/Level 1a.tscn") get_tree().change_scene("res://levels/Campaign/Level 1/Level 1a.tscn")

View file

@ -0,0 +1,23 @@
extends Area2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Area2D_body_entered(body):
if body.has_method("get_type") and body.get_type() == "player":
get_tree().change_scene("res://Title/Death Screen'.tscn")
else:
print("hi")

File diff suppressed because one or more lines are too long

View file

@ -11,6 +11,7 @@ func _process(delta):
$Label.text = "F to Open" $Label.text = "F to Open"
if Input.is_action_just_pressed("open"): if Input.is_action_just_pressed("open"):
Player.current_scene = next_scene Player.current_scene = next_scene
print(Player.current_scene)
get_tree().change_scene(""+next_scene+"") get_tree().change_scene(""+next_scene+"")
else: else:
$Label.text = "Locked" $Label.text = "Locked"