søndag 15. november 2009

Case 7 - Bad Guys

In this case we were supposed to design enemies for our heroes. Like I’ve mentioned earlier I was going with viruses and Trojan horses as the bad guys. These bad guys should have some kind of AI, they can follow the character, patrol a certain path or whatever. In this case we also were supposed to learn about using more than one class/.as-file. This can make your code easier to control and is a must if you’re creating bigger applications.



That is one of the bad guys; The Virus.

After discussing in the group meeting on Monday, I thought this would be an easy case. But as I got working on the code, I realized that I was wrong. It took a long time before I really understood the point of doing it this way, and I’m not sure I’ve done it now either. I can see the usage of more classes is valuable in bigger projects, but with a small flash game like this I’m not quite sure.




Here is the second bad guy in the game: The Trojan Horse.

After a while I managed to create the 2 classes; one main-class and one enemy-class. In the enemy-class I set the positions etc, and gave my enemy a very simple AI, that just makes him patrol back and forth. I have not created a function that says what is going to happen if our hero hits him, but I am working on it.

1 kommentar: