Update 003 - Pause and Menu

posted in BlueStar03
Published September 07, 2014
Advertisement
The latest update is up at http://bluestar03.com/Chronicle/Alpha as well on the Windows Phone Store and Windows 8 Store. This is a small update. It deals with pause and menus.

The Pause function is from YouTube tutorial by Shaun Spalding The only difference is that instead of using global.pause, I have Control object that has the pause variable, thus Control.is_paused. Other than that it is identical. I may have some problems when I start having animation, but I'll deal with it when I get to that. And as a side note, the collision system is derived from his plataformer tutorial. That guy has nice tutorials, and I think I'll use a couple more in the future.

The menu on the other hand, I dealt with it myself. The menu itself is stored in a 3x3 array, three buttons, three properties. Text, is_active, and haven't decided yet. I may delete the last property. When drawing, the menu checks if Control.control_type==2 for touch screens. If true, it will draw all three buttons, a rectangle and text, with the same colors, else, if title_menu[i,1]==false, they are drawn with muted colors.

When acting on input, if it is on a touch screen, when the touch point with id==0 exist, it goes on a for loop, checking if the touch point is inside each rectangle. If it finds that it is, if i==0, the start game button, it goes to the test room. Nothing happens for the rest of the buttons, yet.

If Control.control_type!=2, that is keyboard or game pad, it finds and stores the active_button. If Enter or Start are pressed, if active==0, it goes to the test room. Now, for selecting the other options, it reads whether Control.vertical_control is greater than or less than 0. Vertical_control is between -1 and 1, and it is determined by the up/down keys, the vertical axis of the left stick on a game pad, and also the vertical axis of the virtual joystick. If the menu didn't check for control_type, the virtual joystick could be used for menu selection as well. Once the menu has determined the direction by whether vertical_control is > or < 0, it checks if active_button is == to 0 or menu_length, depending on direction. If it is either one, it make other button the active one, if not, the one adjacent to it, one up or down, and makes the current one inactive.

I really like how this is turning up to be, it still has flaws, but the overall idea is holding up. I really like this milestone style of development, it gives me a reachable short term goal to achieve. And determining the next milestone to tackle is also fun. Additionally, seeing the milestone that lie further ahead, that I really want to tackle, gives me motivation to continue. For example, for touch devices, the right side is unused at the moment. I really want to set up the controls that go there. But first, moving on the z axis, crossing floors, going thru stairs and ladders, indoors and out, that is the next milestone. This one will be hard, at least two weeks. Likely more. So next week's update will be for the website. I already got the new feature working, just need to pretty it up a bit.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement