Before anyone says anything, I know this has been done a million times, but here is my take on raycasters.
This is, without doubt, the pinnacle of my development over the years of using the LOVE engine.
Features:
- Textured Walls (As of v1)
- Textured Floor/Ceiling (Re-redone as of v6) [Thanks for all the help, Jasoco!]
- Sprites (As of v2)
- Rotating Sprites (As of v6)
- Distance Fog (As of v2)
- Jumping and Crouching (As of v6)
- Looking Up and Down (As of v6)
- Support for multiple levels (up to 3, as of v6)
- Support for "door covers" (As of v6) [The wall above the door]
- Textured Doors (As of v4) [Thanks, Jasoco! But I did these a bit differently from you] [Uses xXxMoNkEyMaNxXx's amazing shader]
- Transparent Blocks (As of v4)
Controls:
Use WASD to move
Mouse to turn
Bump into doors to open them
Left Shift to crouch
Space to jump
Screenshots:
Original based on this tutorial: http://lodev.org/cgtutor/raycasting.html
Sprites:
http://opengameart.org/content/roguelik ... orld-tiles
http://opengameart.org/content/roguelikerpg-items
Textured Raycaster [Multiple Levels! Door Covers! Jumping!]
Textured Raycaster [Multiple Levels! Door Covers! Jumping!]
- Attachments
-
- raycaster0.10.0.love
- v6.1 Latest Version
- (345.87 KiB) Downloaded 2329 times
-
- raycaster_latest.love
- v6 Canvas + Shaders
- (427.27 KiB) Downloaded 2128 times
-
- game.love
- v4.5 Canvas + Shaders
- (227.18 KiB) Downloaded 1904 times
Last edited by Davidobot on Tue Mar 28, 2017 6:38 pm, edited 8 times in total.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Textured Raycaster
Better than wolfenstein3D.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Raycaster
Textured walls are super easy. It's textured floors that are the challenging part.
Re: Textured Raycaster
I'll try to add that tomorrow, together with sprites.Jasoco wrote:Textured walls are super easy. It's textured floors that are the challenging part.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Textured Raycaster
Nice work! I'll be glad to see more.Davidobot wrote:I'll try to add that tomorrow, together with sprites.Jasoco wrote:Textured walls are super easy. It's textured floors that are the challenging part.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: Textured Raycaster
Ok, I kinda got it to work, expect, as you can see, the FPS is terrible. I need to figure out how you calculated the angles in order to quickly draw the floor in your Raycasting demo, Jasoco.Jasoco wrote:Textured walls are super easy. It's textured floors that are the challenging part.
EDIT: Would you be able to distort images into a non-parallelogram shape using shaders?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Raycaster
Yes. I didn't in my Raycaster, but you can definitely do it.Davidobot wrote:Ok, I kinda got it to work, expect, as you can see, the FPS is terrible. I need to figure out how you calculated the angles in order to quickly draw the floor in your Raycasting demo, Jasoco.Jasoco wrote:Textured walls are super easy. It's textured floors that are the challenging part.
For my Raycaster I used canvases. Two big ones to be exact. One for drawing the other onto. I would draw the floor canvas onto the second canvas at the position offset and rotation that the player camera was at, the container canvas was divided into horizontal 1 pixel tall quads, then would use some math raycasting calculations to figure out which floor strips to draw on the floor.
It looked janky when rotated though. But it worked. However...
Davidobot wrote:EDIT: Would you be able to distort images into a non-parallelogram shape using shaders?
As long as you only want one texture for the floor. My method above allowed me to have whatever I want on the floor. Including other tile textures. I had also planned on using the method to draw footsteps or blood splatters or other things for extra detail.
Either way, a properly written shader could definitely do it. Don't ask me how to code that shader though. lol
Once you conquer the floors, your next challenge is DOORS! Muahahahaha!!!! *cough*
Sprites are nothing. Especially if you coded the wall drawing correctly. But will be a challenge if you didn't code them properly. Good luck!!!!
Note: I have posted my Raycaster code on this forum numerous times. Try searching for a post from me that mentions raycasting or wolfenstein and see if it's still available somewhere. It might help.
Re: Textured Raycaster
Hm, I'll need to try your method.Jasoco wrote: As long as you only want one texture for the floor. My method above allowed me to have whatever I want on the floor. Including other tile textures. I had also planned on using the method to draw footsteps or blood splatters or other things for extra detail.
Either way, a properly written shader could definitely do it. Don't ask me how to code that shader though. lol
Yes. Yes. HmJasoco wrote: Once you conquer the floors, your next challenge is DOORS! Muahahahaha!!!! *cough*
Yup! The sprites were no problem at all.Jasoco wrote: Sprites are nothing. Especially if you coded the wall drawing correctly. But will be a challenge if you didn't code them properly. Good luck!!!!
I did, but I'm too lazy to change all of your code to 0.9.0Jasoco wrote: Note: I have posted my Raycaster code on this forum numerous times. Try searching for a post from me that mentions raycasting or wolfenstein and see if it's still available somewhere. It might help.
So much getModes and modes and pixelEffects!
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Textured Raycaster
I don't think my version has an getMode or pixel effects in it.Davidobot wrote:I did, but I'm too lazy to change all of your code to 0.9.0Jasoco wrote: Note: I have posted my Raycaster code on this forum numerous times. Try searching for a post from me that mentions raycasting or wolfenstein and see if it's still available somewhere. It might help.
So much getModes and modes and pixelEffects!
Re: Textured Raycaster
Hhm? Yeah, it had like a choice of resolutions and stuff.Jasoco wrote:I don't think my version has an getMode or pixel effects in it.Davidobot wrote:I did, but I'm too lazy to change all of your code to 0.9.0Jasoco wrote: Note: I have posted my Raycaster code on this forum numerous times. Try searching for a post from me that mentions raycasting or wolfenstein and see if it's still available somewhere. It might help.
So much getModes and modes and pixelEffects!
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Who is online
Users browsing this forum: Ahrefs [Bot] and 7 guests