# Raycasting 3D render -- Blocks Edition

**URL:** <https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921>\
**Category:** Game Design\
**Tags:** game, graphics-and-math, extension\
**Created:** [April 1, 2022, 6:23pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921 "2022-04-01T18:23:28Z")\
**Posts on this page:** 20\
**Page:** 7

<div class="post-metadata">

**Author:** ![Shade9788](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Shade9788](https://forum.makecode.com/u/Shade9788)\
**Post date:** [October 24, 2022, 5:01pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/124 "2022-10-24T17:01:28Z")

</div>

to be honest now that i got a little bit of coding experience with c# I think this game I made here is not high enough of quality but ill take suggestion if I’m not lazy to make a remastered version

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [October 24, 2022, 5:06pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/125 "2022-10-24T17:06:37Z")

</div>

Hi, I tested to output your project as elf, and got fail too.  
But with my demo project, it works. For example:

> [@AqeeAqee](#):
>
> ### [demo\_pxt-RaycastingV0.3.14](https://arcade.makecode.com/68514-71798-13887-34316)

(And successed after update it to the newest v0.3.15)

So I have no idea why this happened. May @jwunderl can give us some hint or redirect this issue to the right person.  
The only suggestion I can provide is: make a backup first, then remove other extensions one by one, and test output elf file to find out which part got this error.  
Hope it can help.

---

<div class="post-metadata">

**Author:** ![MrFranko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mrfranko/32/6920_2.png) [@MrFranko](https://forum.makecode.com/u/MrFranko)\
**Post date:** [October 24, 2022, 5:39pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/126 "2022-10-24T17:39:51Z")

</div>

> **[3d floor and background](https://arcade.makecode.com/S53987-45428-75480-18314)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

FLOOR and BACKGROUND 🙂  
Background is ready for device, floor only for simulator or raspberry pi, great for making racing games.  
I have lots of crazy ideas where this can go, I think that simple Minecraft style is possible to achieve 🙂  
I only dont know how to combine your work with mine, I tried to make extension, that would use your extension (using “extend”), but you have to many private variables

HOW TO USE - right now open this project and start from scratch, make sure to set walls as “walls”

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [October 24, 2022, 7:23pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/127 "2022-10-24T19:23:13Z")

</div>

A little off topic but @AqeeAqee has the biggest brain for making raycasting

---

<div class="post-metadata">

**Author:** ![kwx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kwx/32/1545_2.png) [@kwx](https://forum.makecode.com/u/kwx)\
**Post date:** [October 24, 2022, 9:37pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/128 "2022-10-24T21:37:59Z")

</div>

> [@MrFranko](#):
>
> floor only for simulator or raspberry pi

In case it helps, I got a floor texture working with reasonable performance on hardware [as part of the MakeCode Kart project](https://forum.makecode.com/t/makecode-kart/5787/166). @Kiwiphoenix364 has extended this to work with tilemaps, see for example [MakeCode Kart - #271 by Kiwiphoenix364](https://forum.makecode.com/t/makecode-kart/5787/271) .

It may need a two-step render pass to integrate this since efficient rendering of the floor texture required drawing horizontal lines (with constant Z distance), while I think the raycasting renderer prefers drawing vertical columns.

---

<div class="post-metadata">

**Author:** ![teach42](https://avatars.discourse-cdn.com/v4/letter/t/a3d4f5/32.png) [@teach42](https://forum.makecode.com/u/teach42)\
**Post date:** [October 25, 2022, 5:10pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/129 "2022-10-25T17:10:03Z")

</div>

I did figure it out. Turned out to be a different extension. The “Mouse” extension is incompatible with Pi compilations. Deleted that extension and everything worked!

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [October 25, 2022, 7:54pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/130 "2022-10-25T19:54:03Z")

</div>

> **[3d floor and background](https://arcade.makecode.com/S79930-90652-88390-60481)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

can someone improve this to make it into a acing game template for me please with as little code as posssible

---

<div class="post-metadata">

**Author:** ![MrFranko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mrfranko/32/6920_2.png) [@MrFranko](https://forum.makecode.com/u/MrFranko)\
**Post date:** [October 25, 2022, 7:56pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/131 "2022-10-25T19:56:44Z")

</div>

> **[3d floor3](https://arcade.makecode.com/37132-83872-71376-17147)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I updated my code to 14 bit floating point, and optimized to draw only where are no walls.  
and boom! 9fps in open space, 12fps in corridors on MeowBit! (but with fixed floor texture)  
There is little shaking on the floor - need to look for float precission  
(also disabled scrolling background for better implementation)

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [October 28, 2022, 1:34am UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/132 "2022-10-28T01:34:40Z")

</div>

> **[idk](https://arcade.makecode.com/S39886-65403-47528-32759)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

i seem to cant put my sprite in me view (by that i mean i cant do a fps with sprites)

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [October 28, 2022, 5:05pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/133 "2022-10-28T17:05:29Z")

</div>

could you make a block to make the friction ice like speed in raycasting please

also theres some bug in the floor tile version when sometimes you can just walk through walls and all sprites and background and walls are gone and its completely flat wierd thing

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [October 28, 2022, 5:17pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/134 "2022-10-28T17:17:22Z")

</div>

Sorry I didn’t get your question. Would you pls descript it more detail?

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [October 31, 2022, 5:12pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/135 "2022-10-31T17:12:04Z")

</div>

like this i cant make the hand holding the gun

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [October 31, 2022, 5:40pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/136 "2022-10-31T17:40:55Z")

</div>

> **[3d floor and background](https://arcade.makecode.com/S79930-90652-88390-60481)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

can someone improve this with driving physics

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [October 31, 2022, 7:27pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/137 "2022-10-31T19:27:29Z")

</div>

Really cool! Though it can’t run on device.  
I cant guess this made with raycasting ext., if you didn’t mentioned before.

---

<div class="post-metadata">

**Author:** ![Shade9788](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Shade9788](https://forum.makecode.com/u/Shade9788)\
**Post date:** [November 6, 2022, 11:34pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/138 "2022-11-06T23:34:20Z")

</div>

I suppose this is a start of a new era cause now that we are in the early stage of floor layering i think we could soon make a pretty realistic zombie apocalypse game

---

<div class="post-metadata">

**Author:** ![Shade9788](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Shade9788](https://forum.makecode.com/u/Shade9788)\
**Post date:** [November 6, 2022, 11:34pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/139 "2022-11-06T23:34:26Z")

</div>

also speaking can anybody make a in depth lantern that uses both block form and JavaScript form?

---

<div class="post-metadata">

**Author:** ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)\
**Post date:** [January 10, 2023, 11:56pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/141 "2023-01-10T23:56:39Z")

</div>

how the what?

---

<div class="post-metadata">

**Author:** ![EuJeen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/eujeen/32/12807_2.png) [@EuJeen](https://forum.makecode.com/u/EuJeen)\
**Post date:** [January 15, 2023, 12:38am UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/142 "2023-01-15T00:38:38Z")

</div>

Really nice to to see that! I was hoping for this upgrade for months.

---

<div class="post-metadata">

**Author:** ![TheConeGuy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/theconeguy/32/13840_2.png) [@TheConeGuy](https://forum.makecode.com/u/TheConeGuy)\
**Post date:** [January 20, 2023, 11:12pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/143 "2023-01-20T23:12:23Z")

</div>

Hi there!  
I’m coding a game similar to Mariokart (not Makecode Kart,) and I was wondering if it would be possible to place tiles above each other using the extension, maybe with a block?

I’m asking because I need to add decorations for the tracks, most being above each other.

Yeah, that’s it-

---

<div class="post-metadata">

**Author:** ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)\
**Post date:** [January 23, 2023, 6:07pm UTC](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921/145 "2023-01-23T18:07:59Z")

</div>

Possibly but probably not like this. this extension just stretches a 2D tile-map up. if you could have multiple tile-maps on top of each other then maybe. There is also [3d floor and background](https://arcade.makecode.com/S53987-45428-75480-18314) by @MrFranko . It’s not exactly what you wanted but its something useful.

P.S.  
Welcome to Makecode 🕹 👨‍💻 👩‍💻 🎮

[Previous page](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921.md?page=6)

[Next page](https://forum.makecode.com/t/raycasting-3d-render-blocks-edition/12921.md?page=8)
