Since last update I’ve been working on menus. They are very simple and can only be interacted with by using the keyboard. They’re build by text and indicators showing what item/option currently is selected. Doing menus in code only, without the use of scripting is very time consuming and I don’t recommend it unless it’s really thought through. My menus aren’t so well made, not that fancy and they are sometimes not so easy to navigate but they will simply have to do. In the lobby I have implemented a simple chat as well. I added functionality that checked available screen resolutions for your monitor(s) and they are selectable in the options menu (of course I added the original 1024×760 Asteroids resolution as well). Settings such as player-name, game-name, last joined IP and port number are saved, because I find it tremendously disturbing if I have to type everything in at every play.
The perhaps bigger thing I’ve been working on is the server-list. When hosting a game, it is now registered on my server. So clients can now browse available hosts and join them, without any annoying IP-lookups and such. The information displayed about the servers are game-name, IP address of the host and the port number the application is running on. Of course direct connection is available as well.
I’ve fixed a lot of bugs that have occurred and improved various aspects of the application. I’m a little after schedule and will have to implement the saucers and extra-lives for the players.
Enter player name
Lobby and Chat
I added functionality to my program to easily create buffered meshes made from other things than just triangles, because what I really need for this game is lines. So that is what I added, and with the use of that new functionality I were able to create more asteroids-like players and bullets.
The greatest thing I’ve been working with is the ability to render text in my application. I’m using a library called FreeType and with the use of it I’m now able to load ‘.tff’ fonts into my application and use them to render text in my application. It was hard to figure out how I should use it but eventually I succeeded. For now I have to specify which font I want to load in and in what size I want to load it. I have implemented functionality for rendering text with left, center and right alignment. This is great for things like my Title and menu, I made a simple start menu where I can select host or join game, the rest of the menus will follow next week.
I have also been working on switching game states, going from the menu state to the game state. This required allocation and deallocation of resources which gave me graphical glitches and problems. But after some debugging I found out that the way I removed meshes on introduced a possibility of removing the wrong buffers. After fixing that switching states are going smoothly.
I will continue my work on the game, creating the asteroids, maybe start with the physics and render the score and other things I can do with the ability to render text.
Hello world text