# Procedurally Generated Platformer

**URL:** https://forum.makecode.com/t/procedurally-generated-platformer/8500
**Category:** Show & Tell
**Tags:** game, featured-game
**Created:** [June 2, 2021, 10:31pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500 "2021-06-02T22:31:46Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [June 2, 2021, 10:31pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/1 "2021-06-02T22:31:46Z")

</div>

After making [procedural generation](https://forum.makecode.com/t/procedural-generation/5383) and [jump](https://forum.makecode.com/t/jump/6633) I decided to combine (well, not really) the ideas and make a platformer game that is procedural!

> **[Procedurally Generated Platformer v1.0.0](https://arcade.makecode.com/74359-33595-49355-45845)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

You may recognize the platformer tileset 🙂 (it’s from [here](https://forum.makecode.com/t/platformer-tileset/3023)) since I don’t have any creative skills in the slightest.

Controls:

- Jump - up (W or 🠕) or A (Q or Space)
- Left and right - left and right (A and D or ← and →)

Show us your seeds and best times! Mine is 1:06.27 on seed 1234: (I would love to see someone get under 1 minute 🙂 come on guys lets speeeeeeedrun this 🤣 but don’t cheat 😉 )

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/63582ce19c109ec77b3085cdbe60b2846067a6ef.jpeg)

(also night mode doesn’t help with perf - I only get _36_ FPS while it’s on instead of 200! 😆)

Would also appreciate feedback on how easy/hard the generated platformer is and if there any “impossible” scenarios.

> **[UnsignedArduino/Procedurally-Generated-Platformer](https://github.com/UnsignedArduino/Procedurally-Generated-Platformer)**
>
> A procedurally generated platformer in MakeCode Arcade! - UnsignedArduino/Procedurally-Generated-Platformer

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [June 2, 2021, 10:37pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/2 "2021-06-02T22:37:25Z")

</div>

This also works on my PyGamer as well, with 40FPS/11FPS. (night mode) 😃

---

<div class="post-metadata">

### Author: ![fd268](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/fd268/32/35044_2.png) [@fd268](https://forum.makecode.com/u/fd268)
#### Post date: [June 3, 2021, 12:25am UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/3 "2021-06-03T00:25:45Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/413799f62ab9069f547862456c955813db79ad2d.png)  
This is seed 1234, and I got 59.72!!

---

<div class="post-metadata">

### Author: ![fd268](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/fd268/32/35044_2.png) [@fd268](https://forum.makecode.com/u/fd268)
#### Post date: [June 3, 2021, 12:25am UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/4 "2021-06-03T00:25:49Z")

</div>

Post 8,500!

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [June 3, 2021, 12:36am UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/5 "2021-06-03T00:36:00Z")

</div>

I couldn’t get under a minute ☹

---

<div class="post-metadata">

### Author: ![ThunderDrop180](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thunderdrop180/32/6820_2.png) [@ThunderDrop180](https://forum.makecode.com/u/ThunderDrop180)
#### Post date: [June 3, 2021, 3:19pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/6 "2021-06-03T15:19:32Z")

</div>

Wow! This game is amazing!  
(High score: Couldn’t beat lol)

---

<div class="post-metadata">

### Author: ![omnisImperium](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/omnisimperium/32/2728_2.png) [@omnisImperium](https://forum.makecode.com/u/omnisImperium)
#### Post date: [June 3, 2021, 5:46pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/7 "2021-06-03T17:46:52Z")

</div>

HOW DID YOU MAKE THIS??? I’ve been going through the code since you posted this, and my smol brain still can’t understand…

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [June 3, 2021, 5:47pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/8 "2021-06-03T17:47:35Z")

</div>

Update! 😃

> **[Procedurally Generated Platformer v1.1.0](https://arcade.makecode.com/14342-23304-08255-39116)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

(Seed is 2468)

Changes:

- Can set a random seed
- Scoring mechanic! If you get a time within 120 seconds then you will get a score from 0 (\>=120) to 1000! (0 seconds 😆) You can also reset the high score
- Little death animation which was fun to code. 🙂

Sadly this version does not work on hardware. ☹ Guess it’s too big.

---

<div class="post-metadata">

### Author: ![ThunderDrop180](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thunderdrop180/32/6820_2.png) [@ThunderDrop180](https://forum.makecode.com/u/ThunderDrop180)
#### Post date: [June 3, 2021, 5:59pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/9 "2021-06-03T17:59:47Z")

</div>

Ik, idk how. but OMG it looks SOOOOO complicated

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [June 3, 2021, 9:01pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/10 "2021-06-03T21:01:39Z")

</div>

What don’t you understand?

---

<div class="post-metadata">

### Author: ![omnisImperium](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/omnisimperium/32/2728_2.png) [@omnisImperium](https://forum.makecode.com/u/omnisImperium)
#### Post date: [June 3, 2021, 10:52pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/11 "2021-06-03T22:52:27Z")

</div>

While I do understand the basics of the biome generation, I fail to understand how the platforms are generated in a manner that allows the player to traverse them…

---

<div class="post-metadata">

### Author: ![ThunderDrop180](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thunderdrop180/32/6820_2.png) [@ThunderDrop180](https://forum.makecode.com/u/ThunderDrop180)
#### Post date: [June 3, 2021, 10:52pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/12 "2021-06-03T22:52:33Z")

</div>

I dont understand how you make the seeds. its so cool how you can do that like in minecraft.

---

<div class="post-metadata">

### Author: ![omnisImperium](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/omnisimperium/32/2728_2.png) [@omnisImperium](https://forum.makecode.com/u/omnisImperium)
#### Post date: [June 4, 2021, 12:39am UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/13 "2021-06-04T00:39:34Z")

</div>

As far as I understand, each digit of the seeds, results in one aspect of the game. For example the biome, or the placement of the trees. Correct me if I’m wrong… (I most likely am tho…)

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [June 4, 2021, 2:14am UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/14 "2021-06-04T02:14:49Z")

</div>

So there are 3 different types of platforms:

1. A 1x1 cube
2. A 2x2 cube
3. A 3x3 cube

So I first set some starting coordinates, and then place a random-width platform. Then I move 1-2 tiles to the right, and up to 2 tiles up and down. Since the player can jump 2.5 tiles, the player can always jump far enough. And then a bunch of random numbers determines how and if the “extras” are placed.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/68a34174e40c7af8903b71aa21663ba9cef4da74.png)

- `rng_base`: Is the base RNG which is used to seed all of the other RNGs.
- `rng_width`: Determine how wide the platform should be (1, 2, or 3)
- `rng_variation`: Determines what type of extra should be on top of the platform. Ignored if 1-wide platform.
- `rng_rand`: A random number for the extra.
- `rng_height`: Determines how many tiles up or down we should shift before making the next platform.
- `rng_distance`: Determines how far away should each platform be. (either 1 or 2)
- `rng_season`: Determines the season we are in.
- `rng_stars`: Used to place random stars in the sky if in night mode.

---

<div class="post-metadata">

### Author: ![annapurna079](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@annapurna079](https://forum.makecode.com/u/annapurna079)
#### Post date: [June 4, 2021, 4:18pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/15 "2021-06-04T16:18:22Z")

</div>

I was able to get past it but how did you make the beginning!?!?! AND I like the night version 2. That was the best version i think.

---

<div class="post-metadata">

### Author: ![ThunderDrop180](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thunderdrop180/32/6820_2.png) [@ThunderDrop180](https://forum.makecode.com/u/ThunderDrop180)
#### Post date: [June 4, 2021, 4:51pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/16 "2021-06-04T16:51:58Z")

</div>

WHOO! now it makes a bit more sense.

---

<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: [June 4, 2021, 9:10pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/17 "2021-06-04T21:10:48Z")

</div>

got 55.28 in seed 1234

---

<div class="post-metadata">

### Author: ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)
#### Post date: [June 6, 2021, 5:17pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/18 "2021-06-06T17:17:45Z")

</div>

This is an official speedrun game. I guess we need a leaderboard which states the timing, the device used and if it is a set seed or random seed.

---

<div class="post-metadata">

### Author: ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)
#### Post date: [June 6, 2021, 5:17pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/19 "2021-06-06T17:17:50Z")

</div>

And I got 1munute and 16 seconds on mobile, random seed, day. And night time is very laggy on mobile.

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [June 6, 2021, 8:51pm UTC](https://forum.makecode.com/t/procedurally-generated-platformer/8500/20 "2021-06-06T20:51:47Z")

</div>

~~We need a `speedrun-game` tag 🤣~~

[Next page](https://forum.makecode.com/t/procedurally-generated-platformer/8500.md?page=2)
