Dark Bit Factory & Gravity

GENERAL => Projects => Topic started by: combatking0 on May 28, 2016

Title: Text Mode Ray Caster
Post by: combatking0 on May 28, 2016
I'm working on a text mode raycaster! Not the prettiest thing in the world, but so far it's working.
At the moment you can turn left and right with the arrow keys, but you can't move backwards or forwards yet.

I'm using Nino's raycaster as a starting point, so hopefully I'll have motion working soon.
Title: Re: Text Mode Ray Caster
Post by: combatking0 on May 29, 2016
I've been doing some more tinkering and the live version is now here: http://fx.barcodebattler.co.uk/textCaster/TextCaster.htm

The resolution has been increased, horizontally at least, and the movement controls now function.
Unfortunately it's possible to walk through walls, so be careful near the edges as it could crash if you go too far. I need to go back over the collision detection code.
Title: Re: Text Mode Ray Caster
Post by: combatking0 on May 30, 2016
I've tried it with a bigger map (20*20) and fixed the collision detection. I'd put the wrong variable name in somewhere, but it's working now.
Also the arrow keys now handle all of the controls.
Title: Re: Text Mode Ray Caster
Post by: combatking0 on June 03, 2016
I have now added a minimap. Since it uses ascii characters it's still quite limited, but hopefully it helps.
Title: Re: Text Mode Ray Caster
Post by: Rbz on June 05, 2016
Hi combatking0,

Nice coding exercise for sure!

Can you add a gray color scale for the walls?
I mean, to better distinguish if a wall is far or close to the user perspective.
Title: Re: Text Mode Ray Caster
Post by: combatking0 on June 06, 2016
It's doable but the output text is basically HTML, so I'd need to generate lots of tags in the background.
I'll try it and see how much it affects performance.