Dodge the creeps score timer goes to one when i click start but stays there

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By blindjustice
extends Node

export (PackedScene) var mob_scene
var score = 0

func _ready():
randomize()

func new_game():
score = 0
$ScoreTimer.start()
func game_over():
$ScoreTimer.stop()

func _on_mobtimer_timeout():
var mob_spawn_location = $mobpath/mobpathlocation
mob_spawn_location.unit_offset = randf()

var mob = mob_scene.instance()
add_child(mob)

mob.position = mob_spawn_location.position

var direction = mob_spawn_location.rotation + PI / 2
direction += rand_range(-PI / 4, PI / 4)
mob.rotation = direction

var velocity = Vector2(rand_range(mob.min_speed, mob.max_speed), 0)
mob.linear_velocity = velocity.rotated(direction)

func _on_ScoreTimer_timeout():
score = 1
$HUD.update_score(score)

:bust_in_silhouette: Reply From: exuin

score += 1 not score = 1 on the second to last line.

Oh silly me thank you

blindjustice | 2021-04-26 00:20