using System; using System.IO; namespace waddy { class Program { static string GetString(byte[] arr) { return System.Text.ASCIIEncoding.ASCII.GetString(arr); } static void Main(string[] args) { Console.WriteLine("Hello World!"); if (File.Exists("DOOM.WAD")) { using (BinaryReader reader = new BinaryReader(File.Open("DOOM.WAD", FileMode.Open))) { string name = GetString(reader.ReadBytes(4)); int numberOfLumps = reader.ReadInt32(); int folderPosition = reader.ReadInt32(); reader.BaseStream.Seek(folderPosition, SeekOrigin.Begin); Console.WriteLine(name); Console.WriteLine("Contains " + numberOfLumps … Continue reading C# example to load Doom WAD file
Game dev
Example of bouncing ball
var gameScreen = document.getElementById("gameScreen"); var context = gameScreen.getContext("2d"); context.fillStyle = "#FFFFFF"; context.font = "8px Sans-Serif"; context.fillText("Pong!", 10, 10); var ball = { x : 50, y : 50, width : 5, height : 5, x_direction : 1, y_direction : 1 }; var previousBall = ball; var boundary = { x1: 20, x2: 200, y1: 20, … Continue reading Example of bouncing ball
Quake 2 tools
Over the past few weeks (perhaps few months) I've been trying to create a few Quake 2 tools that can run on the browser from scratch. I've started working with a Pak extractor tool that should allow you to load a pak archive, page/search through all items, add/remove items from the archive and also allow … Continue reading Quake 2 tools
Quake 2 map compiling
So after making use of a level editing tool you can save your level as a .map file. For you to be able to run this level you'll need to compile it using a bsp compiler. Below is a simple example of how to run the tool: qbsp3 -gamedir "c:\Program Files (x86)\GOG Galaxy\Games\Quake II" ..\test1.map