# Help with my 2D platformer shooter please!

**URL:** <https://forum.makecode.com/t/help-with-my-2d-platformer-shooter-please/10425>\
**Category:** Help\
**Created:** [October 15, 2021, 5:14pm UTC](https://forum.makecode.com/t/help-with-my-2d-platformer-shooter-please/10425 "2021-10-15T17:14:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [October 15, 2021, 5:14pm UTC](https://forum.makecode.com/t/help-with-my-2d-platformer-shooter-please/10425/1 "2021-10-15T17:14:13Z")

</div>

Can someone help me with my 2D platformer shooter game?  
Link: [https://makecode.com/\_YesbiKJfoWhe](https://makecode.com/_YesbiKJfoWhe)

I need help with these few points:

- Out of all the combat forms spawned (Those walking guys you meet in the beginning), only one follows my game update code.
- The turrets that you spawn, I have a few issues: 1, The spawn rate is random, and 2, only one turret fires missiles. The others apparently don’t function at all.
- The goopers at the back have the same problem as the turrets.

Notes:

- I’m not done with the game.
- I’m still working on enemy ai and level maps so once you finish the first level you’ve technically “won”.
- I’m very bad at animations 😛
- I’ll probably add more if I have any more issues.

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [October 17, 2021, 3:38am UTC](https://forum.makecode.com/t/help-with-my-2d-platformer-shooter-please/10425/2 "2021-10-17T03:38:19Z")

</div>

Liking what I see so far! Looking forward to further iterations!

I think I see what’s happening. They all seem to be a related problem. Let’s take a look at your first bullet:

> [@personalnote](#):
>
> Out of all the combat forms spawned (Those walking guys you meet in the beginning), only one follows my game update code.

I believe we’re looking at this code, then:

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

Your variable `combatform` points to one, single sprite. I think you have the right idea with the `for element` loop, but you never use the loop variable, `value`. In that `for element` loop, each time the code in the loop runs, `value` points to a different sprite.

What I think you want is this:

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

Take a look at your other code for the other two bullet points and make similar adjustments. If you need help, or if I got this totally wrong, just let us know!

If I can offer you another suggestion: I noticed your `forever` loops all start with a `pause`. You may want to switch those loops to `on game update every X ms` instead.

Your code looks great! Really nicely organized and really good use of functions. Nice work!

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [October 18, 2021, 5:07pm UTC](https://forum.makecode.com/t/help-with-my-2d-platformer-shooter-please/10425/3 "2021-10-18T17:07:08Z")

</div>

Thank you so much! It really worked, and after some 30 minutes of playing around I got every sprite under its kind to do what it’s supposed to do! Thank you so much for your time and effort to help me!

(LINK FOR THE GAME SO FAR: [https://makecode.com/\_UaHbx27LPfd8](https://makecode.com/_UaHbx27LPfd8))

---

<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:** [September 29, 2022, 4:51pm UTC](https://forum.makecode.com/t/help-with-my-2d-platformer-shooter-please/10425/4 "2022-09-29T16:51:25Z")

</div>

Can i try this gamww @personalnote the latest version or the last link you sent is the latest version?

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [September 29, 2022, 11:07pm UTC](https://forum.makecode.com/t/help-with-my-2d-platformer-shooter-please/10425/5 "2022-09-29T23:07:47Z")

</div>

Of course! The latest version of the game can be found here:

> [@Requiem](https://forum.makecode.com/t/requiem/11131):
>
> This is the final version of the game I’ve been working on for about 1 or 2 months now, but unfortunately due to Makecode being extremely laggy, I can’t go on and finish it. The game is about halfway done and I don’t really want anyone to try and continue to develop this game. So anyways, about the game: You woke up from a crash and you basically just fight these monsters. Controls: AD - Movement Space - Jump Enter - Shoot W - Sprint S - Melee
