|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionProbably, everyone knows the game Snake. However, the Snake from this article is a multiplayer version and fully in 3D. It’s written in C# using Managed DirectX. A little knowledge of C# is necessary. And some (Managed) DirectX or other Graphics programming experience would be useful. I advise you, if you haven't already done so, to read Craig Andera's tutorial first. You’ll need a C# compiler (Visual Studio .NET if possible). And the DirectX 9.0c SDK [Download it from Microsoft.] For the code to run, you’ll also need a 3D card. But some adjustments in the code would enable it to run on older machines, decreasing its performance. The Game ClassThis is where initialization happens. Also, this is where user input is processed, using the The Player ClassThis class processes the input for the movement of one of the players. It holds a collection of The Intro ClassHere, two Meshes are created for some sort of intro movie. The Arena ClassThis class renders the box in which the snakes move. It also renders the boxes which initially are already occupied by the The Plane ClassThis is a class I built quite some time ago. It creates a textured box. And allows choosing the sides you want to render. ConclusionI do not expect this code to be efficient. A lot of things could’ve been done better and faster. But it works, and when you’ve got nothing to do, this game can be quite fun.
|
||||||||||||||||||||||