# 3d platformer

**URL:** https://forum.makecode.com/t/3d-platformer/13175
**Category:** Arcade
**Created:** [April 19, 2022, 5:46pm UTC](https://forum.makecode.com/t/3d-platformer/13175 "2022-04-19T17:46:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [April 19, 2022, 5:46pm UTC](https://forum.makecode.com/t/3d-platformer/13175/1 "2022-04-19T17:46:56Z")

</div>

I made a 3d platformer demo, and it even has slopes!

> **[3d platformer](https://arcade.makecode.com/35743-04475-48299-95026)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

This is posibly makecode’s first 3d platformer!

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [April 19, 2022, 5:59pm UTC](https://forum.makecode.com/t/3d-platformer/13175/2 "2022-04-19T17:59:23Z")

</div>

Also, big thanks to KWX for making the majority of the renderer.

---

<div class="post-metadata">

### Author: ![GoMustangs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gomustangs/32/4323_2.png) [@GoMustangs](https://forum.makecode.com/u/GoMustangs)
#### Post date: [April 20, 2022, 5:02pm UTC](https://forum.makecode.com/t/3d-platformer/13175/3 "2022-04-20T17:02:00Z")

</div>

Very cool! Did you make it just using the extensions (render, scroller, and sprite utils) and blocks?

---

<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: [April 20, 2022, 5:04pm UTC](https://forum.makecode.com/t/3d-platformer/13175/4 "2022-04-20T17:04:09Z")

</div>

Parkour games are going to be THE thing now.

---

<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: [April 20, 2022, 5:04pm UTC](https://forum.makecode.com/t/3d-platformer/13175/5 "2022-04-20T17:04:38Z")

</div>

this is actually really cool,a bit complicated to play but really awesome.

you should make a mod of it with super mario 64 art or like sonic robo blast 2

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [April 20, 2022, 8:17pm UTC](https://forum.makecode.com/t/3d-platformer/13175/6 "2022-04-20T20:17:45Z")

</div>

No, I used an engine (slightly modified) that KWX made.

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [April 20, 2022, 8:17pm UTC](https://forum.makecode.com/t/3d-platformer/13175/7 "2022-04-20T20:17:50Z")

</div>

Sadly, textures are not supported, or even solid-colored polygons. Even if they were, it would be hard to make the 3d models. All I have here is a basic wireframe and 2d sprites with textures are supported, as well as a textured ground. Also, KWX coded the engine so I don’t know how to do it. Textured polygons seem pretty impossible, as this post says:

> [@MakeCode Kart](https://forum.makecode.com/t/makecode-kart/5787/256):
>
> 3D terrain would need much more complex code to render, and I suspect it would likely be too slow without low-level support. The current code only supports a single textured ground plane, and it uses simplified math to speed things up in ways that are only valid for horizontal planes. Adding a few untextured polygons would be possible, for example combining it with the renderer I used for [Space Rocks 3D](https://forum.makecode.com/t/space-rocks-3d/6334/70) and [Carrier 3D](https://forum.makecode.com/t/carrier-3d-unfinished-work-in-progress/10573), but general textured polygons would be a lot harder.

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [April 21, 2022, 4:52pm UTC](https://forum.makecode.com/t/3d-platformer/13175/8 "2022-04-21T16:52:09Z")

</div>

I made an update where camera controls are separate from regular controls (now aswd are to strafe in their respective directions, and j/l are to move the camera). This can always be reverted by pressing menu. Also, there’s a new map! I also added my delta time extension, which is more accurate than how @kwx implemented it in the original engine. I also changed which lines draw, which made the game start up slower but not draw multiple lines in the same location.

> **[3d platformer](https://arcade.makecode.com/23364-35367-73339-78075)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

@kwx, is there a way to make worldtoscreen render outside the FOV? Because currently wireframe requires both points to be on screen to be visible and sometimes it’s hard to know what’s happening. If it’s too hard, I’m okay with just leaving it, but I was just wondering because it would make the game look better (although with worse performance).

---

<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: [April 21, 2022, 6:50pm UTC](https://forum.makecode.com/t/3d-platformer/13175/9 "2022-04-21T18:50:39Z")

</div>

> [@Kiwiphoenix364](#):
>
> is there a way to make worldtoscreen render outside the FOV? Because currently wireframe requires both points to be on screen to be visible and sometimes it’s hard to know what’s happening.

It already supports the endpoints being offscreen to some extent. However, currently both endpoints need to be in front of the camera. When you’re standing on a platform, an edge connecting a corner in front of you to a corner behind you won’t get drawn correctly.

A not-very-efficient but simple workaround would be to check for this case and split a line into multiple shorter segments if needed. Here’s a modified version of place3dLine that does this:

> **[3d platformer (subdivide hack)](https://arcade.makecode.com/34749-47691-92079-79868)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The more correct solution would be to clip polygons against the view frustum. (The view frustum is essentially the pyramid formed by drawing lines from the camera through the corners of the screen). That’s more complicated - see for example `clipPolygon` in the `triangle.ts` file for [Carrier 3D](https://arcade.makecode.com/14622-37951-14372-95670) which implements the reentrant polygon clipping algorithm, see [Wikipedia](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm).

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [April 22, 2022, 9:29pm UTC](https://forum.makecode.com/t/3d-platformer/13175/10 "2022-04-22T21:29:23Z")

</div>

Thanks SOOOO much!  
I also fixed my deltatime extension (kiwiphoenix364/pxt-deltatime), so here’s a version that will work better on slower devices.

> **[3d platformer (subdivide hack)](https://arcade.makecode.com/82684-43011-80680-89325)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<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: [April 22, 2022, 10:28pm UTC](https://forum.makecode.com/t/3d-platformer/13175/11 "2022-04-22T22:28:58Z")

</div>

I couldn’t resist tweaking it a bit to modify the physics:

> **[3d platformer (subdivide hack, inertia)](https://arcade.makecode.com/57034-01036-02476-95360)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The up/down motion now simulates gravity accelerating you downwards. That way, the jump path is a parabola and not a triangle which I think feels better. You can modify hJumpSpeed to change the jump height, and hAccel to change the strength of gravity.

It also turns off ground friction while in the air so that you don’t drop straight down when letting go of the forward button. You can still control the forward/back motion a bit while in the air, I guess the player is wearing a steerable jetpack.

What do you think?

---

<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: [April 23, 2022, 12:39am UTC](https://forum.makecode.com/t/3d-platformer/13175/12 "2022-04-23T00:39:01Z")

</div>

One more small change - it now sets the speed to zero when landing (this helps avoid sliding off platforms), and loses a life instead of an immediate “game over” when falling off a platform so that it’s quicker to retry.

> **[3d platformer (subdivide hack, inertia)](https://arcade.makecode.com/16763-80580-32863-41358)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [April 25, 2022, 5:01pm UTC](https://forum.makecode.com/t/3d-platformer/13175/13 "2022-04-25T17:01:42Z")

</div>

LOL, I was coding this as you were coding your small change - I implemented your velocity setting to 0 when landing (if you aren’t pressing a direction on the joystick, so it also encourages keeping your speed), and I made it teleport you back to the beginning (instead of restarting, as it takes a while to load, but I did make is so you do not lose hearts, because the hearts are the number of wires in the level. I also added a simple loading sprite so anybody playing knows that the project isn’t broken. Before I saw your small update post, I spent like 2 hours making the character have better velocity based off of your post with intertia. I made it, in my opinion, work well! I think it gives pretty good control, with velocity, and considering it’s working in a 3d space without a joystick. Also, it encourages keeping your speed and not stopping.

> **[3d platformer (subdivide hack, inertia)](https://arcade.makecode.com/10868-92689-75796-35154)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![NobodyNomad](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nobodynomad/32/10821_2.png) [@NobodyNomad](https://forum.makecode.com/u/NobodyNomad)
#### Post date: [May 12, 2022, 4:16pm UTC](https://forum.makecode.com/t/3d-platformer/13175/14 "2022-05-12T16:16:46Z")

</div>

That is awesome! Is there a way to play it with that link?

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [May 12, 2022, 4:40pm UTC](https://forum.makecode.com/t/3d-platformer/13175/15 "2022-05-12T16:40:14Z")

</div>

Yes! It just takes a while to load because it has to fill an array with the lines it draws. Press A to jump, regular joystick to strafe, and the second player’s controller (j and l) to move the camera. If you’re on mobile, click menu to change to “tank controls” where left and right moves the camera and up and down goes forward/backward, and A is still jump. (Menu also turns on stats.)

---

<div class="post-metadata">

### Author: ![cSquared](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/csquared/32/7676_2.png) [@cSquared](https://forum.makecode.com/u/cSquared)
#### Post date: [October 11, 2022, 5:56am UTC](https://forum.makecode.com/t/3d-platformer/13175/16 "2022-10-11T05:56:16Z")

</div>

I created the used renderer extension: [https://github.com/cBomb2/line-renderer.git](https://github.com/cBomb2/line-renderer.git)

---

<div class="post-metadata">

### Author: ![R0B0-BOT](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/r0b0-bot/32/9783_2.png) [@R0B0-BOT](https://forum.makecode.com/u/R0B0-BOT)
#### Post date: [November 2, 2023, 10:14pm UTC](https://forum.makecode.com/t/3d-platformer/13175/17 "2023-11-02T22:14:57Z")

</div>

I was just curious, will this project be compatible with the makecode arcade hand held hard ware?

---

<div class="post-metadata">

### Author: ![Mega0star01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mega0star01/32/14784_2.png) [@Mega0star01](https://forum.makecode.com/u/Mega0star01)
#### Post date: [November 6, 2023, 7:35pm UTC](https://forum.makecode.com/t/3d-platformer/13175/18 "2023-11-06T19:35:57Z")

</div>

this… is… AMAZING!!! HOW DID YOU DO THIS??? IS SOOOOOOOOOOO COOOOOOOOOOL

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [November 6, 2023, 10:09pm UTC](https://forum.makecode.com/t/3d-platformer/13175/19 "2023-11-06T22:09:41Z")

</div>

I don’t think it’ll run well on hardware, it was more like a proof of concept that 3d stuff can run in Arcade. I haven’t tested it on hardware though. Also, I haven’t tested @cSquared 's extension implementation, so I don’t know how well that runs either.

---

<div class="post-metadata">

### Author: ![Code-Source-Cpu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/code-source-cpu/32/20661_2.png) [@Code-Source-Cpu](https://forum.makecode.com/u/Code-Source-Cpu)
#### Post date: [March 21, 2025, 4:27am UTC](https://forum.makecode.com/t/3d-platformer/13175/20 "2025-03-21T04:27:43Z")

</div>

Can you send me the link for the extension?
