- Unity 4.x Game Development by Example Beginner's Guide
- Ryan Henson Creighton
- 363字
- 2025-03-31 04:01:56
'Tis volley
What kind of game are we going to make? Well, let's pretend that you are totally pumped up about volleyball (work with me here). All you can think about night and day is volleyball. You dream about it at bedtime. You play it at every chance you get. So, when it comes to making your first game in Unity, there's no question: you have to make a volleyball game.
Let's back away from that idea a little and, using what we learned in Chapter 2, Let's Start with the Sky, evaluate the difficulty level of a volleyball game. Volleyball features two teams of six players on either side of a net. A "server" hits a ball with his/her hands over the net, and the teams compete to keep the ball in the air, hitting it back and forth over the net. The rally ends when:
- One team lets the ball hit the floor
- The ball goes out of bounds
- An angry puma bursts onto the court and starts chewing on the star players
The first team to score 25 points wins the set. A match is best-of-five. Then there are a number of rules that govern how often and in what way a player may hit the ball (hint: no grabsies).
Hopefully, it's clear that volleyball is a BIG game with lots of rules and a heap of helping of complexity. Multiple teams means that you have four options:
- Two-player, same computer: Both players share the keyboard and mouse to compete against each other
- One-player, same computer: So, you'd have to program AI (Artificial Intelligence) to enable the computer to play against a human
- Two-player, different computers:
- Multiple players, multiple computers: Where every human player controls a team of volleyball team members
We saw in the last chapter that these multiplayer options can add significant layers of complexity to a simple game. Right out of the gate, the challenge is daunting. In addition to providing for two teams, having multiple players on each team means that you have to program a way for the player to switch between different characters. And who knows how you're ever going to animate that puma?