learn-gdscript
learn-gdscript copied to clipboard
Lesson 7, practice 2: the Turtle position is not reset after the Run
Bug description Even a correct code may poduce an output error "The first square should be drawn at (100, 100)" if any Run cycles were executed before. Looks like the Turtle starts from where she came to during the last Run.
To Reproduce Steps to reproduce the bug:
- Go to the Lesson 7, practice 2 ("Draw squares at different positions")
- Type a code
func run():
move_local_x(100)
move_local_y(100)
draw_rectangle(100, 100)
move_local_x(200)
draw_rectangle(100, 100)
move_local_x(200)
draw_rectangle(100, 100)
- Press "Run", and all the checks will be OK
- Press "Run" again, and the 2nd check will produce an Error
Expected behavior A Run cycle must not depend on previous Runs results
Screenshots
Device Info
- Operating System: Manjaro Linux
- Browser: Brave
Log file generated Add any other context about the problem here.
UPD all works fine with "position.x = 100", so that's my fault in this case. But not resetting variables between Run cycles may produce confusing results somewhere else.