# How do i make a 2d survival game?

**URL:** <https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794>\
**Category:** Help\
**Created:** [December 9, 2022, 5:16pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794 "2022-12-09T17:16:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 9, 2022, 5:16pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/1 "2022-12-09T17:16:00Z")

</div>

I want to make a game sorta like Terraria but I have no clue how to make a way to break items or blocks. Can people help me with this please?

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 9, 2022, 5:50pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/2 "2022-12-09T17:50:51Z")

</div>

This is the game link -[https://arcade.makecode.com/S42798-62317-62424-88472](https://arcade.makecode.com/S42798-62317-62424-88472)

---

<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:** [December 9, 2022, 7:05pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/3 "2022-12-09T19:05:12Z")

</div>

look up sandbox games and if it has me in it my game 2.0 version should have a somewhat inventory system and it alters tilemap at tilemap location of sprite. feel free to use some code or be inspired whatever, just maybe give credit. i hope i helped

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [December 9, 2022, 9:15pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/4 "2022-12-09T21:15:57Z")

</div>

If you want to break blocks or tiles, then this could be a potential way to do it.  
 ![Screenshot 2022-12-09 122558](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/5193fedac3ba4286e1e1877986ca0beee2b01bd0.jpeg)

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 12, 2022, 5:42pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/5 "2022-12-12T17:42:29Z")

</div>

This will help alot thanks!

---

<div class="post-metadata">

**Author:** ![CreeperCoder](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@CreeperCoder](https://forum.makecode.com/u/CreeperCoder)\
**Post date:** [December 12, 2022, 5:42pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/6 "2022-12-12T17:42:54Z")

</div>

Sure I’ve Made A 2D Survival Game Called “PixelBuild”

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 12, 2022, 7:20pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/7 "2022-12-12T19:20:28Z")

</div>

Do you happen to know how to highlight objects you are breaking? If so can you send the code?

---

<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:** [December 12, 2022, 8:22pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/8 "2022-12-12T20:22:44Z")

</div>

i have a game called pixelplace that could be very useful with the code (weird how similar the names are but you only have so many options of names that describe a game where you build). if you want i can send the code just i am busy now is why i will only send if you need and ask

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [December 12, 2022, 9:24pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/9 "2022-12-12T21:24:11Z")

</div>

![Screenshot 2022-12-12 115337](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/50cc4992ce9e55e67094c65d80b96fc05058c7d7.jpeg)  
This code asks which tile you’re breaking:

> **[Destroy Blocks](https://arcade.makecode.com/S57420-97026-83001-33334)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Hope this helps! 🙂

---

<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:** [December 12, 2022, 11:38pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/10 "2022-12-12T23:38:30Z")

</div>

mine isn’t perfect for this but some of the code could be useful

> **[PixelPlace 2.0.1](https://arcade.makecode.com/S74844-29462-19969-60651)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 13, 2022, 7:22pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/11 "2022-12-13T19:22:39Z")

</div>

This does help but, because my game has gravity it still mines the way it was originally where it mines the block below you aswell. Sorry for the complaint.

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 13, 2022, 7:22pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/12 "2022-12-13T19:22:41Z")

</div>

Im sure i’ll use parts of it

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 13, 2022, 7:23pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/13 "2022-12-13T19:23:26Z")

</div>

Thanks lot guys! This’ll help alot!

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [December 13, 2022, 7:25pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/14 "2022-12-13T19:25:31Z")

</div>

No worries! I tried your game (it’s really cool) and I observed that problem too. I’ll try to find a way to fix it! (If I end up being able to fix it, then I’ll post the link for the update in a reply to this topic.)

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 13, 2022, 8:00pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/15 "2022-12-13T20:00:27Z")

</div>

Ok thanks 👍

---

<div class="post-metadata">

**Author:** ![isoffline](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/isoffline/32/8791_2.png) [@isoffline](https://forum.makecode.com/u/isoffline)\
**Post date:** [December 13, 2022, 9:23pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/16 "2022-12-13T21:23:41Z")

</div>

FINALLY AFTER 3 SLEEPLESS DAYS I CAN now help. I can help you if you want?

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [December 13, 2022, 9:25pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/17 "2022-12-13T21:25:55Z")

</div>

Okay, I think I may have found a fix! It only works for grass tiles right now, but it allows for you to mine blocks that you’re hitting all around you. In order to mine below you, you simply hold ‘B’. I hope this helps! 🙂

> **[TerraCraft Alpha (Mining in progress)](https://arcade.makecode.com/S29823-52789-39305-35140)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 14, 2022, 8:03pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/18 "2022-12-14T20:03:00Z")

</div>

Yes please! 😃

---

<div class="post-metadata">

**Author:** ![isoffline](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/isoffline/32/8791_2.png) [@isoffline](https://forum.makecode.com/u/isoffline)\
**Post date:** [December 16, 2022, 6:06pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/19 "2022-12-16T18:06:14Z")

</div>

What do you need help with?

---

<div class="post-metadata">

**Author:** ![AstroBacon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astrobacon/32/7312_2.png) [@AstroBacon](https://forum.makecode.com/u/AstroBacon)\
**Post date:** [December 16, 2022, 6:06pm UTC](https://forum.makecode.com/t/how-do-i-make-a-2d-survival-game/16794/20 "2022-12-16T18:06:23Z")

</div>

Oh ok thanks ill try help with mining other tiles.
