# Raycasting, how does it work for tilemaps?, and How do I make the player see to an x distance

**URL:** https://forum.makecode.com/t/raycasting-how-does-it-work-for-tilemaps-and-how-do-i-make-the-player-see-to-an-x-distance/34384
**Category:** Help
**Tags:** game
**Created:** [March 7, 2025, 5:46pm UTC](https://forum.makecode.com/t/raycasting-how-does-it-work-for-tilemaps-and-how-do-i-make-the-player-see-to-an-x-distance/34384 "2025-03-07T17:46:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Qaceacewace](https://avatars.discourse-cdn.com/v4/letter/q/c37758/32.png) [@Qaceacewace](https://forum.makecode.com/u/Qaceacewace)
#### Post date: [March 7, 2025, 5:46pm UTC](https://forum.makecode.com/t/raycasting-how-does-it-work-for-tilemaps-and-how-do-i-make-the-player-see-to-an-x-distance/34384/1 "2025-03-07T17:46:42Z")

</div>

Raycasting, how does it work for tilemaps?, and How do I make the player see to an x distance(example: darkness after 4 feet(can’t see past))

I want to make a game, that is quite scary, yet I don’t know how to do raycasting with tilemaps nor how to make the player see to an x distance, how do I do that?

---

<div class="post-metadata">

### Author: ![Mr\_Duck](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mr_duck/32/13442_2.png) [@Mr\_Duck](https://forum.makecode.com/u/Mr_Duck)
#### Post date: [March 7, 2025, 7:47pm UTC](https://forum.makecode.com/t/raycasting-how-does-it-work-for-tilemaps-and-how-do-i-make-the-player-see-to-an-x-distance/34384/2 "2025-03-07T19:47:43Z")

</div>

[https://arcade.makecode.com/45935-66617-77306-17791](https://arcade.makecode.com/45935-66617-77306-17791) something like this?  
(it’s an extension btw)

---

<div class="post-metadata">

### Author: ![Fixitude](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/fixitude/32/28576_2.png) [@Fixitude](https://forum.makecode.com/u/Fixitude)
#### Post date: [March 7, 2025, 9:06pm UTC](https://forum.makecode.com/t/raycasting-how-does-it-work-for-tilemaps-and-how-do-i-make-the-player-see-to-an-x-distance/34384/3 "2025-03-07T21:06:44Z")

</div>

Use the light Extension.
