Inhoud blog
  • Flash game
  • intro animation
  • progress
  • Animate movieclip
  • help with bouncing ball
    Zoeken in blog

    Beoordeel dit blog
      Zeer goed
      Goed
      Voldoende
      Nog wat bijwerken
      Nog veel werk aan
     
    dimitri.desutter

    15-05-2010
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Flash game
    I thought it was about time to publish a new post. This time I'm going to explain my solution to a problem I experienced during the build of the game: the teachers.

    I thought of a way to make them random, but without a change of character. Every boss looks the same, but it's almost always a different teacher. It's actually a simple piece off code. I used an array to handle the different teachers and their questions and a second array with the answers.

    By using a random number I was able to select a random question and look if the answer was correct. An example:


    var vragen:Array = new Array(
    "vraag 1",
    "vraag 2"
    );

    var antwoorden:Array = new Array(
    "antwoord 1",
    "antwoord 2"
    );

    var randomCijfer:int = Math.floor(Math.random()*vragen.length);
    vraag_txt.text = vragen[randomCijfer];

    15-05-2010 om 00:00 geschreven door dimitri.desutter  

    0 1 2 3 4 5 - Gemiddelde waardering: 0/5 - (0 Stemmen)

    Archief per week
  • 10/05-16/05 2010
  • 15/03-21/03 2010
  • 01/03-07/03 2010

    E-mail mij

    Druk op onderstaande knop om mij te e-mailen.


    Gastenboek

    Druk op onderstaande knop om een berichtje achter te laten in mijn gastenboek


    Blog als favoriet !


    Blog tegen de wet? Klik hier.
    Gratis blog op https://www.bloggen.be - Meer blogs