Total Doom

Published September 02, 2019
Advertisement

I have decided to try this challenge, which should be fun. But since I will developping on a rather low end laptop, I have chosen to prototype the game using THREE.js, and might use Unity later on.I personally do not like Javascript, because it is easy to make mistakes and not know where they are, and also that you have to depend on a gazillion other modules to have a working program. But I will not complain since the dev environment I am in does not give me much choice.

The story:

Necromancers from another dimension have invaded Earth to gather and manipulate Terran (human) souls to help them gain enough power to conquer their known universe. You as agent K. Kryss, a cybermage working for the V.I.P.E.R. (Very Intelligent Powerful Empyrean Rulers) agency, must infiltrate necromancer infested locations, and assassinate their commanders, to restore peace on Earth.

The game is, of course, going to have DOOM gameplay elements such as keys to open doors, armor, health packs etc.

Implementing Movement

The first thing I wanted to implement was the particular DOOM movement, which has an up and down head motion. I simply used a sine function to emulate this motion and the result was close enough. To make it move fast enough I multiplied the phase by a scalar (10).


moveForward(elapsedTime)
{ 
	var dir = new THREE.Vector3(0,0,0);
    this.camera.getWorldDirection(dir);
    var newVelocity = new THREE.Vector3(dir.x*this.axisSpeed,0,dir.z*this.axisSpeed);
    var deltaHeight;
    deltaHeight = Math.sin(10*elapsedTime); // head motion
    runningTime += elapsedTime;
    this.position.set(this.position.x + newVelocity.x, 0, this.position.z + newVelocity.z);
    this.camera.position.set(this.position.x, this.position.y+deltaHeight, this.position.z);
}

 

The rest is easy enough to code, simply move along the x and z axis according to where the player is facing.

Map Editing

Since I do not use an engine (for now) and this is my first time using THREE.js, I do not have a map editor. So basically the map is a collection of cubic walls and tiles that are stored by a coded number inside a 2d array. There is a number code for keys, health packs, armor, enemies etc as well. 

Time to make the sprites now. Since this is my first try at pixel art, things are going to be tougher from now on. 

3 likes 2 comments

Comments

Rutin

Looking forward to seeing how this progresses! :) 

September 06, 2019 10:56 AM
Hermetix

Thanks, I have decided to use the Unreal Engine from now on. Playing this in a browser wouldn't be optimal anyway.

I'm gonna try hard to finish this on time but will continue even if I don't--I'm a bit rusty with UE4 since I haven't used it in months.

September 21, 2019 01:52 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement