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
Original drawings of the asteroids
It’s been a while since I last posted a update, but I’ve been really busy implementing things for my game. I started with creating the asteroids, I have four different types taken from the original asteroids game, as shown in the drawing to the left. The asteroids are starting a certain distance from the centre of the game plan so players have a safe spawning zone. The asteroids, 4 to 8 of them are started in their largest form. They simply float around on the screen and when destroyed they will spawn 2 smaller asteroids until they already are at their smallest.
Some physics had to be implemented. Even if it’s simple 2D physics they still took quite a while to complete. To start of I had to create a base ‘Entity’ class, holding the graphical content and some possible physics body. I should really have done this earlier but back then I had no need for it. Anyhow I started with axis aligned bounding boxes (AABBs). They are boxes that encapsulate the object and are always aligned with the worlds XYZ-grid. AABB is perfectly fine for the lasers that the players fire, but not so much for the asteroids so I had to implement a radius/sphere collision check as well.
I also implemented score, now when I have something to shoot at. Destroying a large asteroid yields 20 points, a medium 50 points and a small one 100 points. The large saucer will give 200 points and the small one 1000 points. I’ve decided to put the points from killing a player at 400, but this may be altered later. The score can be kept together in the group if playing in coop mode, or split into one for each player in versus mode.
I have lots of things left to do on my game, but I think I will start completing the menus and creating a game-lobby.
AABB & Radius/Shere collision
AABB & Radius/Sphere collision
Radius and AABB
Asteroids in different sizes