Can You emphasize where is the code to progress to the next stage ? Is it the index thing ?
If You made code to progress to next level You can simply prevent it from happening by simple IF condition. Thats how You should do it : if answer is correct - progress, and thats it, not even else statement is needed.
This is the whole code with the index. I want the gameplay to pause when the user gets an answer wrong but be able to continue if an answer is correct. I have used a pause function in the second to last section of my code with no success. Apologies if my questions haven’t been clear. Just a little stuck on how to phrase them. Thanks, Juan
extends Node
export(Resource) var bd_quiz
export(Color) var color_right
export(Color) var color_wrong
var buttons:=
var index:= 0
var quiz_shuffle :=
onready var questions_text:= $question_info/txt_question
func _ready()-> void:
for _button in $question_holder.get_children():
buttons.append(_button)
quiz_shuffle = randomize_array(bd_quiz.bd)
load_quiz()
func load_quiz()-> void:
if index >= bd_quiz.bd.size():
return
questions_text.text = str(bd_quiz.bd[index].question_info)
var options = randomize_array(bd_quiz.bd[index].options)
options.shuffle()
for i in buttons.size():
buttons[i].text = str(options[i])
buttons[i].connect("pressed", self, "buttons_answer", [buttons[i]])
Man, look how You formatted this code, it is an eyesore to find anything there. And You just posted everything, I still can’t find how does your quiz go to next question after any answer, all I can see is modulate.