Level 2 in progress
This commit is contained in:
parent
a8c9e74d2f
commit
68da67a4c7
|
@ -5,7 +5,7 @@ resource_name = "Skeleton Hit"
|
|||
length = 0.1
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("../Skeleton Enemy/Skeleton:modulate")
|
||||
tracks/0/path = NodePath("Skeleton:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
|
|
|
@ -18,7 +18,8 @@ func _ready():
|
|||
|
||||
func _on_TextureButton_pressed():
|
||||
Player.respawn()
|
||||
get_tree().change_scene(Player.current_scene)
|
||||
print(Player.current_scene)
|
||||
get_tree().change_scene(""+Player.current_scene+"")
|
||||
|
||||
|
||||
func _on_TextureButton2_pressed():
|
||||
|
|
|
@ -25,7 +25,7 @@ func _physics_process(_delta):
|
|||
if collider != null && collider.has_method("get_type") && collider.get_type() == "player":
|
||||
shoot_fireball(position.direction_to(player_position))
|
||||
|
||||
if dist <= 400:
|
||||
if dist <= 200:
|
||||
velocity.x = position.direction_to(player_position).normalized().x * speed
|
||||
else:
|
||||
velocity = Vector2(0, 0)
|
||||
|
|
|
@ -28,7 +28,7 @@ func _physics_process(_delta):
|
|||
velocity.x *= speed
|
||||
velocity = move_and_slide(velocity, UP)
|
||||
|
||||
if dist <= 400:
|
||||
if dist <= 200:
|
||||
velocity.x = position.direction_to(Player.position).normalized().x
|
||||
else:
|
||||
velocity = Vector2(0, 0)
|
||||
|
|
|
@ -11,7 +11,6 @@ func _ready():
|
|||
health = 3
|
||||
|
||||
func _physics_process(delta):
|
||||
Player.current_scene = "res://levels/World.tscn"
|
||||
if knockback != Vector2.ZERO:
|
||||
knockback = lerp(knockback, Vector2.ZERO, 0.5)
|
||||
move_and_slide(-knockback * knockback_amount)
|
||||
|
@ -20,7 +19,7 @@ func _physics_process(delta):
|
|||
return
|
||||
var player = Player.position
|
||||
var distance = global_position.distance_to(player)
|
||||
if distance <= 400:
|
||||
if distance <= 200:
|
||||
if player.x > global_position.x:
|
||||
Spr.flip_h = false
|
||||
velocity.x = speed
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,4 +9,5 @@ func _on_Leap_body_entered(body):
|
|||
|
||||
func _on_Timer_timeout():
|
||||
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")
|
||||
|
|
23
levels/Campaign/Level 2/Area2D.gd
Normal file
23
levels/Campaign/Level 2/Area2D.gd
Normal 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")
|
49
levels/Campaign/Level 2/Level 2.tscn
Normal file
49
levels/Campaign/Level 2/Level 2.tscn
Normal file
File diff suppressed because one or more lines are too long
|
@ -11,6 +11,7 @@ func _process(delta):
|
|||
$Label.text = "F to Open"
|
||||
if Input.is_action_just_pressed("open"):
|
||||
Player.current_scene = next_scene
|
||||
print(Player.current_scene)
|
||||
get_tree().change_scene(""+next_scene+"")
|
||||
else:
|
||||
$Label.text = "Locked"
|
||||
|
|
Loading…
Reference in a new issue