+---------------------+ | Snowboard Madness | | User Manual | | | | John RB | +---------------------+ +-----------------+ | Description | +-----------------+ Snowboard Madness is a java game in which you take control of a snowboarder, going down a hill at a high speed. Sounds easy? Wrong. On your way down, you are bombarded with various obstacles, including trees and snowmen, which you must dodge. At the same time, you will encounter jumps which, if you successfully hit, you will go off, and be awarded points for doing so. Every collision with a tree or snowman will subtract health from your health meter, which, along with your elapsed time, jumps, and difficulty level, is listed at the top of the screen. While you will loose health very quickly for every crash, you will be able to find first aid kits along the way, which will recover your lost health. +-----------------+ | Rules | +-----------------+ There are few rules in Snowboard Madness. The game is very user friendly and so errors that involve things such as inputing numbers outside of paramaters do not occur, as there are no parts of the game in which you will be asked to input any variable by typing its value into the keyboard. The keys for the program are as follows: Main Menu --------- Up: Move cursor upwards Down: Move cursor downwards Enter: Select Options Menu ------------ Up: Move cursor upwards Down: Move cursor downwards Left: Toggle option left Right: Toggle option right Enter: Return to main menu Instructions Menu ----------------- Enter: Next Page/Return to main menu In-Game ------- Up: Change direction to upwards Down: Change direction to downwards Space: Stop sliding (go straight) Left: Slow down Right: Speed up P: Pause/Unpause game +----------------+ | Installation | +----------------+ In order to install this game into a website, you will need the following files: Must have Optional --------- -------- Snowboarding.class UserManual.txt Snowboarding.html Snowboarding.java Title1.gif Title2.gif Boarder.gif Put the files into the *same* directory of the website, and link to Snowboarding.html from wherever you choose. The above files are the bare minimum that you need for the game to install, but I recommend you upload this file as well, and link to it, so that confused users can learn the controls. The Snowboarding.java file is not imperitive, but having it allows you to edit the game or to better understand it when opened. The game does not actually need this file to run from internet explorer. +-------------------+ |Personal Commentary| +-------------------+ Initially, I planned on making this program much more simple, as I didn't think I would be capable of programming in many features, including the entire health system, including the health bar, and first aid kits. My original plan was to have the game end instantly after one collision. Another extra feature I didn't plan on doing was the ability to pause/resume the game, the entire options menu (difficulty level, jacket/pants/board colour), and the ability to press the left and right arrow keys to slow down and speed up during the game. These features I felt were a necessety in order to keep the game entertaining for a longer period of time. A large problem I encountered when trying to make my program, was how to find a way of having various menus, score screens, etc. as opposed to the actual game. I was originally thinking I would be unable to determine how to do so. I finally found a technique that worked well. I declared an important variable (I called it Do, because it determines what the game should do) that originally is set to 0. Each numerical value from 0 - 4 (that's 5 different possibilities) corresponded to a different type of sub program. 0 being the main menu, 1 the main game, 2 the score summary screen, 3 the instructions menu, and 4 the options menu. Both the paint and the key down methods contain a large if statement that says "if do is 0, else if do is 1..." etc., and depending which it is, will do the correct code accordingly. A small problem I encountered, when I'd finished my program, was that it tended to flicker in all of the menus. This was a result of my repaint value being very low, and therefore the gif images and text was repeatedly repainted when it was not changing, which was unnecessairy. To fix this, I added an if statement around the repaint statement, so that if do was 1, which was the game, it would have a 100 millasecond delay, and if it was not 1 (0,2,3,4), it would have a 100 millasecond (0.1 seconds) delay. This seemed to clear up the flicker problem in the menus. Increasing this number above 100 would remove the problem, but in doing so it also slowed down the response rate of the key down method, meaning if you were in the menus, and pushed down, it would somewhat lag for a second and then move the menu cursor downwards. Another problem I encountered was how to make it look like you actually would go off of the jumps when you hit them. I finally came up with a solution, using a method, boolean, and an integer. The method was called offJump, the boolean was called Air, and the integer was called AirFrames. Basically, upon hitting a jump (I used the same technique as I did for collision with trees, health, and snowmen), the variable Air became true (indicating that the boarder was in the air), and AirFrames was reset to 0. Then, at the beggining of each loop through the paint method, when the sprite was drawn, I had an if statement, saying if air is true, run the offJump method, and if false, run the drawSprite method. In the offJump method, if AirFrames was 0, I'd run the drawSprite method, but with the Y coordinate of the sprite higher, and with a black oval beneath it to give the illusion of a shadow. Then at the end of the method, I had an if statement that said basically every 3rd time this frame is drawn, increase AirFrames by 1. Then, the program would exit the method and resume running the game. The next time through the paint method, when it came to draw the sprite, AirFrames, being 2, would cause it to draw the original sprite higher, with a smaller shadow. This pattern continues until the number 8 is reached, which is 8 frames (0-9), 4 of the boarder going up off the jump, and a shrinking shadow, 1 with the smallest shadow and highest peak, and another 4 with it growing again, in a somewhat parabolic motion. Then, at the end of the method, I added an if statement making it so that if the 9 frames have gone by, Air becomes false, and therefore it will no longer draw the sprite in the air, but on the ground again. I learnt a lot from making this program. Initially, I had very little knowledge of how to use Java Applets instead of the usual HSA Console Applications, but after doing this project, have grown very familiar with how applets function. I've also learnt two features using tutorials I searched for on the internet: the ability to draw polygons, and the ability to import .gif images. The site in which I found out how to do these two things is listed inside the commentary of my program. I used the polygon feature to draw the jumps, which I originally had no idea how to fill in, without this ability. I used the 'drawImage' technique to use gif files (which, being drawn by hand, look much more nice than an image would if I had just drawn it in Ready) for my menus. I used them for the main title (two of them make it up, one for each word), and for the main snowboarder sprite that I use in both my main menu and options menu. ------------------------------------------------------------------------------------------------ Enjoy the game!