added first theme progress and switched all files to use static typing
This commit is contained in:
parent
c9458f3627
commit
b5ace17da9
2665 changed files with 50249 additions and 476 deletions
|
|
@ -14,7 +14,7 @@ var idle: bool = false
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
var model_instance = data.model.instantiate()
|
||||
var model_instance: Node = data.model.instantiate()
|
||||
frequency = randf_range(1.0, 4.0)
|
||||
amplitude = randf_range(1.0, 6.0)
|
||||
spawn_point = position
|
||||
|
|
@ -26,20 +26,20 @@ func _physics_process(delta: float) -> void:
|
|||
return
|
||||
|
||||
time += delta
|
||||
var x_movement = sin(time * frequency) * amplitude
|
||||
var y_movement = sin(time * 25) * 4.0
|
||||
var z_movement = cos(time * frequency) * amplitude
|
||||
|
||||
var x_movement: float = sin(time * frequency) * amplitude
|
||||
var y_movement: float = sin(time * 25) * 4.0
|
||||
var z_movement: float = cos(time * frequency) * amplitude
|
||||
|
||||
if not idle:
|
||||
velocity = Vector3(x_movement, y_movement, z_movement)
|
||||
else:
|
||||
velocity = Vector3(0, y_movement, 0)
|
||||
|
||||
|
||||
# if move_and_slide reports collisions
|
||||
if move_and_slide():
|
||||
var collision = get_slide_collision(0)
|
||||
var collider = collision.get_collider()
|
||||
|
||||
var collision: KinematicCollision3D = get_slide_collision(0)
|
||||
var collider: Object = collision.get_collider()
|
||||
|
||||
# if the monster collided with the player...
|
||||
if collider.name == "Player":
|
||||
velocity = Vector3.ZERO
|
||||
|
|
@ -50,7 +50,7 @@ func faint() -> void:
|
|||
self.queue_free()
|
||||
|
||||
func attack_enemy(enemy: Monster) -> int:
|
||||
var damage = data.attack_enemy(enemy.data)
|
||||
var damage: int = data.attack_enemy(enemy.data)
|
||||
return damage
|
||||
|
||||
func take_damage(amount: int) -> void:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue