Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: LincolnB on February 14, 2012, 05:28:45 pm
-
Hey, I spent the last coupla days messing around with the idea of raycasting, and came up with something that, while looks very different, is in reality moderately similar to a first person view type of game.
(http://img.removedfromgame.com/imgs/anwiopvj.gif)
I'm not really planning anything big for this. If you want the executable, or the source, or an explanation (kind of a headache), just let me know and I'll hook you up.
-
O.O wtf I was just wondering how do do something like that.
If you could provide the source, that would be awesome. :D
-
Talk to BuilderBoy....Nightmare: Emergence .... ON CALC O.O
-
Looks pretty awesome :D Is it really raycasting? Since i couldn't see any walls that were occluding the view of the beam
-
That looks real nice!
Could you explain in simple pseudocode?
-
That looks pretty cool! And yeah, pseudo code so I can understand too :)
-
This reminds me of an old Light project, except in the other one walls would cut off the beam. This one runs a lot faster tho 0.o
Can't wait to see what's doable with it.
-
Ok, so basically the flashlight drawing part loops through various degrees (180-210, 150-180, etc) and taking the sine and cosine, and drawing a bunch of individual lines based on that.
That probably didn't clear anything up. Source code!
compiled with Axe 1.1.1, and yes, you need the appvar for the source but not for the executable. Oh and KRAYSRC is the one to compile.
-
So it basically draws a bunch of lines next to each other, masking/unmasking where the "beam" is?
-
Yeah, basically. But it only draws about ten-fifteen lines, and it draws a 7*7 sprite instead of a single pixel. Also, I do ClrDraw, then draw the beam, then DrawInv, and then I draw the map.
-
But seriously, you could make a pretty cool game out of this, because you do not know what is behind you, like in 3D FPS's.
-
But seriously, you could make a pretty cool game out of this, because you do not know what is behind you, like in 3D FPS's.
He is using the same principles that raycasters use, except he is not rendering the image from the player's perspective (as FP games do), which is why it seems so similar :)