• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

AS3: Organizing quiz questions

New Here ,
Jun 13, 2016 Jun 13, 2016

Copy link to clipboard

Copied

Hi,

I'm building an adobe air app using Flash CS6.

Say I have 6 files which contains easy, medium, hard in 2 languages.Each contains 50 questions.

EnglishEasy.as

EnglishMedium.as

EnglishHard.as

SpanishEasy.as

SpanishMedium.as

SpanishHard.as

I have a document class.

What I did on document class is like this.

    private var enQuizEasy:EnglishEasy = new EnglishEasy();

    private var enQuizMedium:EnglishMedium = new EnglishMedium();

    if (mode == "easy")

    {

    wordList = enQuizEasy.enEasyQuiz;

    }

   

    if (mode == "medium")

    {

    wordList = enQuizMedium.enMediumQuiz;

    }

   

and so on.

When I complete a level, I did

    if (mode == "easy")

    {

    enQuizEasy.level++;

    }

   

    if (mode == "medium")

    {

    enQuizMedium.level++;

    }

and check the level and show next level game screen.

Do I have to check these all the time on all of 3 modes?

If I use XML, Is it easy to organize?

And I don't have to use that much if statement?

Hope you understand what I wanna explain.

Let me know your best solution.

Thank you!

TOPICS
Development

Views

157

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines