Page 1 of 1

Raycasting game...

Posted: Wed Apr 28, 2010 12:01 am
by bongomeno
Hey, all. I thought that I would share this new game with you. Because this forum messes up my code, Ill just give you a link to the thread on my forum with thr code. Feedback would be appreciated. I used some of the tutorials on my site to help me with this.

http://geekbasic.webs.com/apps/forums/t ... -raycaster

Its nothing more than a multi-level maze game, but I want to make a RPG or shooter out of this eventually...

Posted: Wed Apr 28, 2010 8:18 am
by izidor
It's great!

Posted: Wed Apr 28, 2010 8:51 am
by bongomeno
thanks! :D

Posted: Fri Apr 30, 2010 3:13 pm
by sid6.7
well done....

Outstanding!

Posted: Fri Aug 13, 2010 8:14 am
by seaBiscuit$
This thread is probably dead, but i couldn't resist posting here!

Great job. Very minimal code. i remember my first raycaster... it was big and bulky. All kinds of subroutines everywhere and huge chunks of garbage code.

i noticed it fishbowls though. (When you look at a flat wall straight on it looks like the sides bend backward.) That's pretty common with raycasters. It happens because you project onto a flat plane (screen) whereas in the real world you project onto a spherical plane (the back of your eye.)

It's a pretty simple fix. If i remember right, you just take the distance the ray travels to the wall and multiply it by the cosine of the difference of the angles of the ray itself and the direction the player is facing. That probably didn't come out right... Basically: distance * cos(playerangle - rayangle)

Since the angle (playerangle - rayangle) is always the same for each column, you can precalculate the cosines and put them into an array for faster drawing.

Happy casting! :)

Posted: Mon Jun 06, 2011 7:41 pm
by msdos622wasfun
Hey, that's neat! Simple but effective. Actually I'm glad that I found my way out ... for a minute I thought I was going to be stuck in there a while.

Posted: Thu Aug 09, 2012 1:25 am
by jash08
nice, I like raycasters,that stuff is pretty cool. :)
guild wars 2 gold