• Welcome to Dark Bit Factory & Gravity.
 

Text Mode Ray Caster

Started by combatking0, May 28, 2016

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

combatking0

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.
You are our 9001st visitor.
Challenge Trophies Won:

combatking0

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.
You are our 9001st visitor.
Challenge Trophies Won:

combatking0

#2
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.
You are our 9001st visitor.
Challenge Trophies Won:

combatking0

I have now added a minimap. Since it uses ascii characters it's still quite limited, but hopefully it helps.
You are our 9001st visitor.
Challenge Trophies Won:

Rbz

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.
Challenge Trophies Won:

combatking0

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.
You are our 9001st visitor.
Challenge Trophies Won: