Tutorial:Your first Game;funtction start isnt declared?

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

Hey everybody I have problem in the Tutorial where I can make a game called dodge the creeps. I have already my entire code but when I want run the game, the debugger says that the start function isnt defined. I’ve searched everything through for a mistake but I cant find anything. I hope you can help me. Below is a screenshot of my screen and also my code.
Thanks for your help!

In the marked blue bar is the line with the "unidentified start" and in the lower part of the picture is the debugger with is message

extends Node

export (PackedScene) var Mob
var score

func _ready():
	randomize()
	new_game()

func game_over():
	$ScoreTimer.stop()
	$MobTimer.stop()
func new_game():
	score = 0
	$Player.start($StartPosition.position)
	$StartTimer.start()
	
func _on_StartTimer_timeout():
	$MobTimer.start()
	$ScoreTimer.start()
	
func _on_ScoreTimer_timeout():
	score += 1

func _on_MobTimer_timeout():
	$MobPath/MobSpwanPoint.offset = randi()
	var mob = Mob.instance()
	add_child(mob)
	var direction = $MobPath/MobSpwanPoint.rotation + PI / 2
	mob.position = $MobPath/MobSpwanPoint.position
	direction += rand_range(-PI / 4, PI / 4)
	mob.rotation = direction
	mob.linear_velocity = Vector2(rand_range(mob.min_speed, mob.max_speed), 0)
	mob.linear_velocity = mob.linear_velocity.rotated(direction)

Your image is broken.

Regardless, if the error message is that start() is not defined, the only place it is called is in new_game():

$Player.start($StartPosition.position)

start() is defined on the player, so you need to look in the Player.gd script to see what the problem may be.

However, it could be something else. So please include the exact error message you received.

kidscancode | 2021-04-17 18:44

Hello, probably you are using godot 4 with has changed from that tutorial and instead you needed to create a Marker2d so your $StartPosition doesn’t exist anymore if you didn’t rename it.
Prob’s would look something like this in your code with the new updates $Player.start($Marker2D.position)