# Help with simple but extremely long + repetitive code idea

**URL:** <https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356>\
**Category:** Help\
**Created:** [October 7, 2026, 4:54pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356 "2026-10-07T16:54:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheCactusMan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thecactusman/32/35981_2.png) [@TheCactusMan](https://forum.makecode.com/u/TheCactusMan)\
**Post date:** [October 7, 2026, 4:54pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/1 "2026-10-07T16:54:26Z")

</div>

I’m making a room-based 2d shooter which, in the simplest words, is a hybrid between Blazing Beaks and Dead Rails on Roblox. The game will use a 6x6 tile system to maximize both quality and space of the game, but therefore needs ~200 variables to get purely the levels themselves to exist. I’m prepared to create 200 variables, but is there a way to at least make it simpler to identify and edit the map?

Another issue (but not as bad) is the (HEAR ME OUT) 1,000,000 level system. Basically, the game is hardcoded with a set seed alongside with a corrector that inputs custom levels (eg. system will ignore seed if level=100,000 and will instead generate a bossfight). I have some ideas on how to generate maps, but they kinda suck (best idea so far is place blobs of negative space randomly to create caves/forest opening).

If this sounds too complicated, trust me, _this is the probably the easiest game idea to code I’ve had._

Sorry for the long message. ☹ if u died of old age and cant help then i completely understand

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [October 7, 2026, 5:01pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/2 "2026-10-07T17:01:20Z")

</div>

Please dont make 200 variables. I didnt fully understand what are you doing but you could likely just use [arrays](https://forum.makecode.com/t/a-tutorial-to-arrays/46258) with just a single variable.

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [October 8, 2026, 3:57am UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/3 "2026-10-08T03:57:41Z")

</div>

Kinda funny that you talked about a long message, but the link i sent… well.. just click it and youll see

---

<div class="post-metadata">

**Author:** ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)\
**Post date:** [October 8, 2026, 4:01am UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/4 "2026-10-08T04:01:51Z")

</div>

as @Soleb244 said, use arrays. They get really helpful. also, isnt there already a tilemap? and if youre asking for procedural generation, use a perlin noise generator.

---

<div class="post-metadata">

**Author:** ![TheCactusMan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thecactusman/32/35981_2.png) [@TheCactusMan](https://forum.makecode.com/u/TheCactusMan)\
**Post date:** [October 8, 2026, 5:51pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/5 "2026-10-08T17:51:51Z")

</div>

ok im currently testing the arrays, and they could be useful but for clarification i meant 200 for the sprites themselves, and when i try setting an array value to a sprite the error ai practically starts cursing at me

---

<div class="post-metadata">

**Author:** ![TheCactusMan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thecactusman/32/35981_2.png) [@TheCactusMan](https://forum.makecode.com/u/TheCactusMan)\
**Post date:** [October 8, 2026, 5:52pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/6 "2026-10-08T17:52:04Z")

</div>

off topic but i clone images for assets for future use and 4 is migrating across the map help

 ![arcade-screenshot (1)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/9/d9e5afba14919f661b0015c2a42e200b3ec55cad.png)

everything that could go wrong is why why is my code alive

![disappearing emoji](https://static.klipy.com/ii/a8ada81afc59159ea5c8927feffa2e31/39/c7/04PKHldBX0E9lpS.webp)

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [October 8, 2026, 6:13pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/7 "2026-10-08T18:13:47Z")

</div>

why cant you use tilemaps? also theres a `center camera at x, y` block or something like that, you dont need a seperate sprite for that

---

<div class="post-metadata">

**Author:** ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)\
**Post date:** [October 8, 2026, 11:15pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/8 "2026-10-08T23:15:22Z")

</div>

the error AI isn’t good at all, also if you need help you could always send the game here!

---

<div class="post-metadata">

**Author:** ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)\
**Post date:** [October 8, 2026, 11:15pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/9 "2026-10-08T23:15:38Z")

</div>

you could do:  
`[set numbers to (array of ( ... ))]`  
where … is all your ten image sprites, 0 to 9, then this later:  
`(get value in (numbers) at (digit))`  
or whatever the correct words are. Send it here and I could probably fix it alot!

---

<div class="post-metadata">

**Author:** ![TheCactusMan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thecactusman/32/35981_2.png) [@TheCactusMan](https://forum.makecode.com/u/TheCactusMan)\
**Post date:** [October 9, 2026, 3:18pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/10 "2026-10-09T15:18:31Z")

</div>

ok i think i can just make 500 (yes my calculations were a bit off) clones of one sprite and give them all an “analog” (basically runs on sprites touching it rather than numeric info) piece of code. will update soon

---

<div class="post-metadata">

**Author:** ![TheCactusMan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thecactusman/32/35981_2.png) [@TheCactusMan](https://forum.makecode.com/u/TheCactusMan)\
**Post date:** [October 9, 2026, 3:18pm UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/11 "2026-10-09T15:18:54Z")

</div>

IT WORKED.

ONE VARIABLE.

 ![arcade-screenshot (2)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/7/b7c56c1aff3c7632985f4a463cbe0dfba5a3344b.png)

---

<div class="post-metadata">

**Author:** ![Soleb244](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Soleb244](https://forum.makecode.com/u/Soleb244)\
**Post date:** [October 10, 2026, 2:42am UTC](https://forum.makecode.com/t/help-with-simple-but-extremely-long-repetitive-code-idea/46356/12 "2026-10-10T02:42:54Z")

</div>

why dont you use tilemaps? using sprites is just going to make it laggy and difficult to work with
