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];
Didn't have much inspiration to start it off, but with some help from my dear friend Google, I found some usefull inspiration on this site :) Maybe it'll help you guys is you're having trouble finding inspiration ;) http://flash-effects.com/
So far, so good. Everything is going fine and the site looks nice according to me. I must admit I'm not a great designer, but I think I did my best. Hopefully I'll find some inspiration to animate the site in flash. Maybe a good night sleep will help :)