Cogwheel Main Menu
|
One of the things I’ve done this week is to implement our new main menu screen. I’ve spent a number of hours on it today and yesterday, as there are a number of things that needed to go into it. I’ve also implemented the new appearances of the other menus, but what I am going to talk about in this blog post is the main menu. Our new main menu screen looks like a cogwheel. The cogwheel is rotated when you change which one of the menu items is selected. Behind the cogwheel are scrap parts that are floating around in space. They represent the destroyed planet shields and destroyed alien ships. They get a random position and rotation when they’re created. They also get a random direction with random speed and rotation to continuously move and rotate in. They also get a random sprite out of 9 different images. When you select a new menu item in the main menu, the text of the selected menu item becomes green. There’s a slight fade-in on it when the white of the unselected text goes to the green of the selected text. The menu is navigated using the ‘a’ and ‘d’ keys. We were thinking of making it possible to also navigate the main menu using the mouse, but we scrapped that as we don’t have much time left until the game needs to be done. The way of how to rotate the cogwheel helped me with the rotation problem I had with the planet in-game, the one in-game is a bit more complex though. The problem was that if the rotation of the cogwheel was 0 and you wanted to selected to the one to the left, it would then go to the right, the long way around, to rotation 270. It does the same way when going from 270 to 0. My solution was to set the rotation to -90 if the rotation is 270 and it should go towards 0, and set the rotation to 360 if the rotation is 0 and it should go towards 270. I think it didn’t take so much time for me to figure out how to do that. I hope you’ve enjoyed reading my blog posts about Planet Suburbia, and hope you’ll continue reading and enjoying my blog posts in the future that I might possibly make. |
Hello and welcome to the last of the blog posts of our Planet Suburbia game. The game is nearing its finish, and tomorrow it has to be done. There has been a lot that have had to be done, but I feel like it’ll turn out pretty good.