adds new font, adapts debug level and monster spawning
This commit is contained in:
parent
e8f06e7b99
commit
6ce579026b
15 changed files with 279 additions and 30 deletions
|
|
@ -49,5 +49,5 @@ func _physics_process(delta: float) -> void:
|
|||
|
||||
var new_player_position = camera.global_transform.origin + local_z * 3
|
||||
|
||||
print(camera.global_transform.origin, new_player_position)
|
||||
collider.start_battle(new_player_position)
|
||||
collider.start_battle(self, new_player_position)
|
||||
#rotate_toward(rotation.z, collider.rotation.z, 1.0)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
extends VBoxContainer
|
||||
extends MarginContainer
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
|
|
@ -9,3 +9,8 @@ func _ready() -> void:
|
|||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_close_button_pressed() -> void:
|
||||
visible = false
|
||||
pass # Replace with function body.
|
||||
|
|
|
|||
|
|
@ -2,10 +2,15 @@ extends CharacterBody3D
|
|||
|
||||
@onready var animated_mesh = $GobotSkin
|
||||
|
||||
var in_battle: bool = false
|
||||
|
||||
const SPEED = 5.0
|
||||
const JUMP_VELOCITY = 4.5
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if in_battle == true:
|
||||
return
|
||||
|
||||
animated_mesh.idle()
|
||||
|
||||
# Add the gravity.
|
||||
|
|
@ -53,14 +58,19 @@ func _physics_process(delta: float) -> void:
|
|||
|
||||
move_and_slide()
|
||||
|
||||
if velocity.length() < 0.01:
|
||||
if velocity.length() < 0.05:
|
||||
animated_mesh.idle()
|
||||
|
||||
# what happens when a battle starts?
|
||||
# the player is positioned (mostly elsewhere than where he currently stands)
|
||||
# the player is positioned (mostly somewhere else than the current position)
|
||||
# ui changes
|
||||
# music changes
|
||||
func start_battle(player_position: Vector3) -> void:
|
||||
func start_battle(enemy: Node3D, player_position: Vector3) -> void:
|
||||
position = Vector3(player_position.x, position.y, player_position.z)
|
||||
print("düdelüdelüdelüdelü")
|
||||
print("start battle")
|
||||
in_battle = true
|
||||
velocity = Vector3.ZERO
|
||||
animated_mesh.idle()
|
||||
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
print("timer over")
|
||||
in_battle = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue