author - malyfred
/ 15. 12. 2004
AnimeWorld (school project) is small and VERY SIMPLE example of using C# and DirectX. I am a complete beginner on this field and I had to fight quite a lot with STUPID MSDN to finish this program. DirectX is badly documented piece of …… at the moment and most of examples that can be found on internet don't work as you need so I have decided to offer this example to other newbies.
It's 3D game (something like Half Life 2 or Doom 3:o) where you collect items and shoot at everything that moves.
Here are some screenshots:
Controls
- W, S, A, D – moving
- Mouse – look around
- E – open hidden doors
- U – reverse up/down mouse move
- Mouse button – shooting
- T – telescope
- L – turn on/off the lights
- F – change texture mipmaps
- I – change skin
- F1 – fullscreen
- F2 – back to window
- Esc – quit
Map
You can create your own map! It's located in /data/bludiste.txt
. In the first line of this plain text file is specified size of your map. You can use these symbols:
- space – space:o)
- '*' + 'a'…'n' – walls
- 'S' – starting position (MUST BE!)
- 'A'…'G' – hidden doors
- 'H'…'N' – walls
- 'O'…'R' – targets
- 'T'…'Z' – collectable item
- '#' – not collectable item
Installation
You need DirectX (I think 9.0 or higher is necessary, but I have not tested lower versions.)
You need .Net Framework 1.1 (or higher?)
When you have DirectX and .Net installed you can try to run the AnimeWorld.exe
but it probably doesn't work – you have to install the Managed DirectX. It means that you have to run mdxredist.msi
from ManagedDX.CAB
. This .cab file is in the directory where you have unpacked DirectX at the beginning of installation.
That's all – enjoy the game:o)
Source Code
Of course the example is good for nothing when you cannot see souce code – everything is located in src
directory. (MS Visual Studio project and all source files) I am REALLY sorry for some czech words and error messages, but I am not going to fix it. This project is partly based on D3DUT framework that is being developed at University of West Bohemia. D3DUT should allow you in near future to move your DirectX projects to Linux and OpenGL…huh:o) But don't worry – I have used just some functions from this framework (fullscreen…).
Last Word
In the left upper corner: FPS, collected items/remaining items, hit targets/remaining targets, time from start in miliseconds – it stops when you have got all items and targets. Don't forget to turn on your speakers and look at your belly!
Download
AnimeWorld.zip – 596kB