Quote: RakNet is a cross-platform C++ and C# game networking engine. It is designed to be a high performance, easy to integrate, and complete solution for games and other applications. The snippets below demonstrate basic client/server communication using the RakNet library.
Tag Archives: gaming
Minimax is an algorithm where two players (min and max) play against each other for minimizing loss and maximizing gain. The following picture illustrates minimax with a game of tic-tac-toe. The algorithm uses a tree for the moves and scores of each player. In some cases, it is unnecessary for the algorithm to check certain subtrees. [...]
Matrices can be used to perform transformations. For example, in 2D and 3D space. Transformations include, but are not limited to, rotating, scaling and translating. Transformations can be combined by multiplying the matrices with each other. For example, you might want to: scale an object with a factor of 2 rotate it 45 degrees around the [...]
Keyboard input is essential in most games. The user might use it for moving a character, mario style enemy killing and many other things. XNA supports so called keyboard states to detect keyboard input.
A common problem when drawing with GDI in VC++ is that the screen might flicker when you’re doing a lot of drawing. This problem can be overcome by drawing on a so called back buffer. The back buffer is then drawn at once. I’ve created a Win32 project in VC++ to demonstrate this. The first [...]
This example extends the Vector2 and Vector3 classes from the 2D and 3D vector normalization and angle calculation in C++ example. The formulas for distance calculation in 2D and 3D are listed below.
Normalizing a vector can derive the direction of the vector in 2D or 3D space. A normalized vector is also known as a unit vector. We’re going to normalize and calculate the angles of a 2D vector at position (5,5) and a 3D vector at position (5,5,5). This can come in very handy when, for [...]
Robocode is a programming game where you get to build a robot to battle with other robots. It supports the Java programming language and the .NET framework. We will use the Java programming language in this example.