Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
KevinBasener edited this page May 28, 2023 · 1 revision

Welcome to the MParty wiki!

Question()

  • enum Difficulty {EASY, NORMAL, DIFFICULT}
  • question: String
  • answer_possibilities: Array[String]
  • right_answer: int
  • difficulty: Difficulty

The Question class is used too store a question, their answer possibilites and other relavant metrics.

QuestionsProvider() extends JSONLoader

  • get_question(index: int, difficulty: Question.Difficulty): Question
  • get_random_question(difficulty: Question.Difficulty): Question
  • get_next_question(difficulty: Question.Difficulty): Question

The QuestionProvider class is used to provide the question objects. All questions should be accessed via the QuestionsProvider. You can use the QuestionsProvider by loading its resource using preload("res://resources/question_provider.tres")

JSONLoader() extends Resource

  • load_json_file(file_path: String): Dictionary

The JSONLoader class loads an json file and returns it as an dictionary, so it can be worked with in code.