Saturday, 6 October 2012 – Main Menu Transitions
When creating transitions from page to page, I think most people would probably do a motion tween. I suppose that is the most efficient and quickest way to create a transition. I’m not sure how to do it in games unfortunately. I thought of generating a spritesheet, but I do not know how to use Adobe Flash yet and that seems like a crazy way to do it to.
So, I coded the transition!
I have a camera man in my Main Menu. Yes, he literally is my cameraman. I code the game’s camera to lock onto this camera man and follow him. The cameraMan is an invisible sprite at the center of the screen when the player doesn’t click any of the three buttons. When a button is clicked, it triggers a particular action of the cameraMan. He has three actions.
The first action is run. He will run to the right, and the camera follows him running to the right. This is one of the simpler transitions.
The second action is fly. This is what I just coded. It is a bit complex and has some luck involved because I have to do lots of testing of values. I basically imagine the cameraman pretending to make a high jump. He squats (velocity drops), and then lungs into the air (acceleration upwards). Then when he reaches the top, I apply gravity (acceleration downward). Once he reaches the center of the new screen, I set his velocity to 0. Tada!
I didn’t really name the third action. I coded this in the past. Basically it’s a transition when the play presses Play. This is the coolest transition in my opinion. Haha.
The Main Menu is a very special menu, because it contains tiny secrets. You should check out the credits page and explore the Main Menu. The one in the credits page is pretty obvious for now though. I plan to make it a bit harder to find it. I already have an idea how to.