This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

SPower
SPower presents ...

2013/8/10

Raycasting Engine

This is a raycasting engine based on a tutorial I found, with my own fixes and additions. It's quite fast, although it's A LOT faster once you download it. It also has support for sprites (objects in the world).

Controls:
-Arrow keys to move forward and backward and turn
-Hold shift to strafe using the left and right arrow keys.

It is a conversion of the raycasting tutorial found here (3 parts):
http://lodev.org/cgtutor/raycasting.html
http://lodev.org/cgtutor/raycasting2.html (not implemented)
http://lodev.org/cgtutor/raycasting3.html

The texture mapping textures and the sprite images are taken from the game Wolfenstein 3D.

I've changed the way the texture mapping works, by taking slices (each with the width of 1) of the image, scaling the height and drawing them. I also added a way to load maps from really simplistic txt files.

I hope you like it, and please give me feedback!

10947 views / 18 in the last 7 days

18 votes | 0 in the last 7 days

Tags: demo with-source 3d sprite raycast raycasting

This scenario is a member of: Reusable actors & support classes, Ray Casting


open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

A new version of this scenario was uploaded on Sun Sep 22 17:19:58 UTC 2013 -Added depth sorting of sprites -Huge memory improvements
A new version of this scenario was uploaded on Sun Sep 22 17:24:16 UTC 2013 Improved comments
MatheMagicianMatheMagician

2013/9/22

Wow! It is good to see that you fixed the glitches and improved the code. Good job!
Yay, much better, really like this. Great job!
SPowerSPower

2013/9/23

Thanks to both of you!
Entity1037Entity1037

2013/10/2

Now THIS is amazing!
SPowerSPower

2013/10/2

Thanks!
SPowerSPower

2013/10/2

I'm actually making a game using this engine, but with some great extras. Something great is coming up! (although I don't know how long it will take)
lordhersheylordhershey

2013/12/16

Hey, I am impressed with your implementation, but you probably hear that a lot.
SPowerSPower

2013/12/16

Actually, I don't! Thank you! And maybe you should check out the original tutorial, it explains alot more about the technology (if you're interested in that)

See all comments

Want to leave a comment? You must first log in.

Who likes this?

Nosson1459 EthanMc Oldmoe RUMMAKER blobfishlover Game/maniac bourne Builderboy2005 Upupzealot MatheMagician Zamoht JetLennit Busch2207 wabuilderman USBest Entity1037 FlyingRabidUnicornPig Kartoffelbrot