This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

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)
Godot version 3.2.3
in Engine by (12 points)

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.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.