Highlighted

AS3: Organizing quiz questions

New Here ,
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

101

Likes

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

AS3: Organizing quiz questions

New Here ,
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

102

Likes

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
Jun 13, 2016 0

Have something to add?

Join the conversation