How to Build a Skate Park Game
A skate park computer game allows players to control an electronic skateboarder that can perform tricks. Often players earn points for performing specific tricks. You can make a skate park game for a gaming console that features high-resolution 3d graphics, or you can make a simple game that runs on an Internet page. You can write code for your game in C++, C#, Flash or JavaScript. Take take advantage of object-oriented programming techniques as you build your skate park game.
Instructions
-
-
1
Open your game development environment of choice, such as Unity3d, C4 engine or XNA. Create a new project for your skateboarding game.
-
2
Create a backdrop for the skate park that includes curves and ramps that the player can use to perform tricks. Calculate the distance between ramps, and create a "ramp" object that contains coordinates for the accessible surfaces of the ramp. Create more than one ramp for variety, if you are building an elaborate game.
-
-
3
Create a graphic to represent the skateboarder. Create animation sequences for the skateboarder to execute when performing tricks, such as an animation that places the skateboarder in a crouch. Use a 3d model and texture it as appropriate if you are creating a three-dimensional skateboarder game.
-
4
Create a "Skateboarder" class. Wire the class to keystroke events. Track the position of the skateboarder in a "position" field that contains the current position of the skateboarder. When a user presses a key, such as the "up" arrow, modify the "position" field accordingly. Create a "velocity" field to track the velocity of the skateboarder, and modify it to reflect key strokes and to reflect the position of the skateboarder on the ramp.
-
5
Create a "Tricks" class and include a minimum velocity and position property for each trick. Use a series of "switch" statements within the "Skateboarder" object to call the method that corresponds to each trick when the skateboarder meets the speed, height and velocity criteria needed to execute the trick.
-
6
Create a "Score" class or struct to represent the skater's score. When the skateboarder executes a trick, add the appropriate points to the player's score.
-
7
Instantiate the "'Timer" class provided by your framework using the time limit of each session as a parameter. Display the time in a sprite, and when the player runs out of time, end the game and display the player's score.
-
8
Run the game, and test it to ensure it works as expected.
-
1
References
- Photo Credit David McNew/Getty Images News/Getty Images