# 3D raycasting in Arcade

**URL:** https://forum.makecode.com/t/3d-raycasting-in-arcade/474
**Category:** Arcade
**Tags:** game, featured-game
**Created:** [August 23, 2019, 8:55pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474 "2019-08-23T20:55:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)
#### Post date: [August 23, 2019, 8:55pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/1 "2019-08-23T20:55:29Z")

</div>

> **[3d map](https://arcade.makecode.com/14009-57824-16954-25349)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I’ve been playing a bit with fake 3D raycasting, as done in original [Wolfenstein 3D](https://en.wikipedia.org/wiki/Wolfenstein_3D) from id Software.

It’s not much of a game, you can just walk around, but there are no other characters and nothing really to do. This should become a package to make 3D games. I’m a bit on the fence here, if it should use the tilemap APIs, or have its own set of APIs (which are quite similar to tilemap - you set the map and assigned textures to each pixel).

It runs on SAMD51 at around 50fps and on STM32 at around 35fps.

It only works in [https://arcade.makecode.com/beta](https://arcade.makecode.com/beta) (in fact you can make it work on the released version, but it’s somewhat slower then, especially on hardware).

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [August 24, 2019, 2:45am UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/2 "2019-08-24T02:45:58Z")

</div>

This looks so cool! Should I stop working on my side project, then? It seems like there is a lot of overlap.

> [@Next Project: Sneak Peek](https://forum.makecode.com/t/next-project-sneak-peek/340/15):
>
> Made a little more progress on this today. Been having way too much fun with this. smile The dungeons can now have passages in the floor and in the ceiling so that you can build additional levels in your game. The rendering is a little off, but it’ll do for now. [arcade-Dungeon-Map-Playground] Next steps (roughly in order): Use an update loop with the movement animations instead of game.pause so that rendering is more consistent across platforms. (Done.) Incorporate page flipping when…

---

<div class="post-metadata">

### Author: ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)
#### Post date: [August 24, 2019, 6:28am UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/3 "2019-08-24T06:28:53Z")

</div>

Not at all! You have a different algorithm and it will allow for different games - you can go up and down. Also it’s unclear if I will have time to turn mine into package…

---

<div class="post-metadata">

### Author: ![jedgarpark](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedgarpark/32/202_2.png) [@jedgarpark](https://forum.makecode.com/u/jedgarpark)
#### Post date: [August 29, 2019, 3:42pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/4 "2019-08-29T15:42:46Z")

</div>

Wow, really awesome! This brings me way back to Wolfenstein and Doom and Marathon in such a great way.

---

<div class="post-metadata">

### Author: ![eligaming1311](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@eligaming1311](https://forum.makecode.com/u/eligaming1311)
#### Post date: [April 6, 2020, 4:24pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/5 "2020-04-06T16:24:52Z")

</div>

Thanks for the code man i have custmize the world and know it is fnaf1 and fnaf 2 here is the link [3d maze fnaf 1 & 2](https://forum.makecode.com/t/3d-maze-fnaf-1-2/1617)

---

<div class="post-metadata">

### Author: ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)
#### Post date: [February 24, 2021, 6:51pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/6 "2021-02-24T18:51:17Z")

</div>

Do you think you can make the render machine into an extension? For example:  
`//% block="make a 3d map $image with block size of $number`  
Or  
`//% block="set $color pixel to block with image $image"`  
This is just the block looks because I still can’t figure out the math for this. Or maybe make q tutorial? Im a fast learner and I’m taking algebra 1.

---

<div class="post-metadata">

### Author: ![LaserFoxPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/laserfoxpro/32/4105_2.png) [@LaserFoxPro](https://forum.makecode.com/u/LaserFoxPro)
#### Post date: [May 3, 2021, 9:30pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/7 "2021-05-03T21:30:42Z")

</div>

nice! with a little bit of code you could add jumping

---

<div class="post-metadata">

### Author: ![jubelit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jubelit/32/4279_2.png) [@jubelit](https://forum.makecode.com/u/jubelit)
#### Post date: [June 2, 2021, 7:19pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/8 "2021-06-02T19:19:27Z")

</div>

can you make tis an extention

---

<div class="post-metadata">

### Author: ![Purp13](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purp13/32/3765_2.png) [@Purp13](https://forum.makecode.com/u/Purp13)
#### Post date: [October 5, 2021, 9:20pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/9 "2021-10-05T21:20:07Z")

</div>

i have been searching for a while and i came across 2.5d its whee you use a 2d sprite and instead of the prospective of the enemy changing from one to another the sprite just faces the player the entire time while animations are the only way that the prospective you have on the sprite while change if some one can help me figure out how to do this this has been used in Wolfenstein 3D and many of the dooms

---

<div class="post-metadata">

### Author: ![Nome\_muito\_criativo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nome_muito_criativo/32/5636_2.png) [@Nome\_muito\_criativo](https://forum.makecode.com/u/Nome_muito_criativo)
#### Post date: [October 6, 2021, 12:10am UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/10 "2021-10-06T00:10:46Z")

</div>

Yeah, it basically uses a lot of math to calculate the position, scaling, and frame of animation of a sprite to position it in 3D.

---

<div class="post-metadata">

### Author: ![Purp13](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purp13/32/3765_2.png) [@Purp13](https://forum.makecode.com/u/Purp13)
#### Post date: [October 6, 2021, 5:25pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/11 "2021-10-06T17:25:17Z")

</div>

billboards are what i am trying to make 2.5d billboards

---

<div class="post-metadata">

### Author: ![Purp13](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/purp13/32/3765_2.png) [@Purp13](https://forum.makecode.com/u/Purp13)
#### Post date: [October 6, 2021, 8:14pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/12 "2021-10-06T20:14:04Z")

</div>

can you code the 2.5 Demensions into this

> **[3d map](https://arcade.makecode.com/00435-33759-75562-23179)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [March 3, 2022, 6:54pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/13 "2022-03-03T18:54:06Z")

</div>

Just a spinoff with guns i made  
controls:  
A to shoot  
press B to aim  
hold & release B to reload (hold it for atleast ~500ms)

> **[3d map](https://arcade.makecode.com/15685-50314-79571-56186)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![CarltonFade](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/carltonfade/32/6381_2.png) [@CarltonFade](https://forum.makecode.com/u/CarltonFade)
#### Post date: [May 24, 2022, 7:07pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/14 "2022-05-24T19:07:36Z")

</div>

The best I could do with this engine was this: [https://arcade.makecode.com/87598-96325-50064-01307](https://arcade.makecode.com/87598-96325-50064-01307)

Its not finished, I don’t know Javascript, but I think it could be interesting to put here. If anyone has any solutions to the problem of putting an enemy or item in the game that would be awesome. But, this is the best I can do. Enjoy

---

<div class="post-metadata">

### Author: ![FrogBro](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@FrogBro](https://forum.makecode.com/u/FrogBro)
#### Post date: [October 5, 2022, 8:30pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/15 "2022-10-05T20:30:43Z")

</div>

would there be a way to add ai to this?

---

<div class="post-metadata">

### Author: ![Franklin](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Franklin](https://forum.makecode.com/u/Franklin)
#### Post date: [March 1, 2023, 11:43pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/16 "2023-03-01T23:43:01Z")

</div>

I looked through your game’s code and I don’t understand what the big grey block with all the text is, I tried to copy the code for it and put it into my game but it doesn’t work. Can you explain?

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [October 23, 2023, 4:42pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/17 "2023-10-23T16:42:48Z")

</div>

Ayo this is nearly at 300 clicks

---

<div class="post-metadata">

### Author: ![DangerNoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dangernoodle/32/14797_2.png) [@DangerNoodle](https://forum.makecode.com/u/DangerNoodle)
#### Post date: [October 27, 2023, 6:11pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/18 "2023-10-27T18:11:44Z")

</div>

GUYS. THIS IS ONCE AGAIN DEAD. PLEASE STOP REVIVING DEAD THREADS 😭

---

<div class="post-metadata">

### Author: ![goldtopaz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/goldtopaz/32/28622_2.png) [@goldtopaz](https://forum.makecode.com/u/goldtopaz)
#### Post date: [November 13, 2023, 6:45pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/19 "2023-11-13T18:45:10Z")

</div>

nuh uh

---

<div class="post-metadata">

### Author: ![jackal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jackal/32/19506_2.png) [@jackal](https://forum.makecode.com/u/jackal)
#### Post date: [November 14, 2023, 5:13pm UTC](https://forum.makecode.com/t/3d-raycasting-in-arcade/474/20 "2023-11-14T17:13:53Z")

</div>

nuh uh (last message)

[Next page](https://forum.makecode.com/t/3d-raycasting-in-arcade/474.md?page=2)
