|
Several recent posts in the VBCity Forums made me realise that it might be useful to have an article that dealt with some of the basic requirements when it comes to creating your own classes and objects.
Many beginners start by creating a simple game and this is often a good learning project so we will use this approach in this article. Two key elements of a game application like this will probably be a way of creating Players and keeping a record of their High Scores . Users can log in to the game using their Player name and see their last score.
As they play again in this session they might increase this score or start over from zero. They might even want to see how their score rates against other Players. So we would need a way of creating a collection of Players and their Scores. And as we usually want to see the Scores listed from highest to lowest, there will have to be a way to sort those Score values that are stored in the collection.
Finally, it wouldn't be much use if the Scores were all lost each time the application ends, so we should also build in a way of saving the latest data to the hard drive and of course a means of retrieving them when you need them.
This article for beginners uses VB 2005 and shows you how to meet all these requirements.
[read article...]
|