# What is the best way to make aiming?

**URL:** <https://forum.makecode.com/t/what-is-the-best-way-to-make-aiming/9551>\
**Category:** Help\
**Created:** [August 6, 2021, 3:32pm UTC](https://forum.makecode.com/t/what-is-the-best-way-to-make-aiming/9551 "2021-08-06T15:32:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwillchangethisname](https://avatars.discourse-cdn.com/v4/letter/i/6bbea6/32.png) [@iwillchangethisname](https://forum.makecode.com/u/iwillchangethisname)\
**Post date:** [August 6, 2021, 3:32pm UTC](https://forum.makecode.com/t/what-is-the-best-way-to-make-aiming/9551/1 "2021-08-06T15:32:19Z")

</div>

so im trying to make a rogue dungeon shooter to test some ideas but i cant find a good way to make aiming. i though of a couple of things, like auto-locking onto nearest enemies or just shooting in the way the player is facing but im not sure if there is better ways. if anyone knows any good ways to do this or any ideas, im open to suggestions! thanks!

---

<div class="post-metadata">

**Author:** ![beepboop](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@beepboop](https://forum.makecode.com/u/beepboop)\
**Post date:** [September 9, 2021, 3:08pm UTC](https://forum.makecode.com/t/what-is-the-best-way-to-make-aiming/9551/2 "2021-09-09T15:08:06Z")

</div>

You can use the sprite utils extension (fjwunderl/arcade-sprite-util) or angle based code, which works well using the left and right arrows to rotate the aim, like I did in this:

> [@Puzzle game: Baby Dragon](https://forum.makecode.com/t/puzzle-game-baby-dragon/9495):
>
> A little game I made about a tiny 8x8 dragon, portals, and some giant weird computer grinning_face_with_smiling_eyes. [Baby Dragon](https://makecode.com/_0gLAx32aHgc8) Avoid space, use portals to your advantage, and try to get into the finishing portal. The controls will feel weird at first, but you get used to them: Left and right arrows to adjust aim slowly Up and down to adjust aim quickly B button (x) to round angle to nearest right angle And A (z) to launch Tip: you are dumped out at the centre of the second portal, eve…

although I made it a bit moe complicated.

---

<div class="post-metadata">

**Author:** ![iwillchangethisname](https://avatars.discourse-cdn.com/v4/letter/i/6bbea6/32.png) [@iwillchangethisname](https://forum.makecode.com/u/iwillchangethisname)\
**Post date:** [September 14, 2021, 3:58pm UTC](https://forum.makecode.com/t/what-is-the-best-way-to-make-aiming/9551/3 "2021-09-14T15:58:55Z")

</div>

thanks! ill try making it so you press A to shoot and B to move the aimed direction. the way you made it in your game works really well!

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [April 11, 2023, 4:29pm UTC](https://forum.makecode.com/t/what-is-the-best-way-to-make-aiming/9551/4 "2023-04-11T16:29:56Z")

</div>

I made a tutorial on this!

> [@360° aiming - showcase + tutorial](https://forum.makecode.com/t/360-aiming-showcase-tutorial/15614/1):
>
> Hey folks, Sarge here [refering to my alias online - S0m3\_random\_guy, abbriviated to SRG which i like to pronounce as “Sarge” - just so you know.] I’ve figured today is the day to put out something productive so I created a small testing game where I created a prototype system for aiming. The prototype Here you can take a look at the finished project. If you wish, you can remix it, reuse it, modify it or even just glance at the code to learn something new. Just make sure you credit my handle …

---

<div class="post-metadata">

**Author:** ![Holderify](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@Holderify](https://forum.makecode.com/u/Holderify)\
**Post date:** [December 12, 2024, 5:48pm UTC](https://forum.makecode.com/t/what-is-the-best-way-to-make-aiming/9551/5 "2024-12-12T17:48:58Z")

</div>

I’m making a wave game and am trying to get a cross-hair to lock on the nearest enemy. I don’t know what exactly is wrong but I think it is locking on the closest enemy instead. Should I change the way the player aims?  
[Game](https://arcade.makecode.com/S16920-59983-66720-33026)
