---
title: "Discussion on \"KaboomJS: How to get the angle of the mouse in relation to a player/object.\" | Hashnode"
description: "Discussion on \"KaboomJS: How to get the angle of the mouse in relation to a player/object.\". I've been building a top-down shooter in Kaboom and had to figure out how to shoot bullets from the main player, here is a quick function to calculate the angle of the mouse in degrees in relation to a player.\n\n  const player = add([\n    sprite(\"lenn..."
url: "https://hashnode.com/posts/kaboomjs-how-to-get-the-angle-of-the-mouse-in-relation-to-a-playerobject/633eaef421f8d0ec9800a2e5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [KaboomJS: How to get the angle of the mouse in relation to a player/object.](https://blog.jordienric.com/kaboomjs-how-to-get-the-angle-of-the-mouse-in-relation-to-a-playerobject?utm_source=hashnode&utm_medium=feed)

I've been building a top-down shooter in Kaboom and had to figure out how to shoot bullets from the main player, here is a quick function to calculate the angle of the mouse in degrees in relation to a player. const player = add(\[ sprite("lenn...

Oct 6, 2022 · 1 min read · blog.jordienric.com  
Read the article

-   [#kaboom](https://hashnode.com/tag/kaboom)
-   [#kaboomjs](https://hashnode.com/tag/kaboomjs)
-   [#game-development](https://hashnode.com/tag/game-development)
-   [#typescript](https://hashnode.com/tag/typescript)

## Written by

[Jordi Enric](https://hashnode.com/@Jordienr)

@Jordienr · Mallorca

  
[View profile](https://hashnode.com/@Jordienr)

Design Engineer

I'm a self-taught software developer with a heavy focus on frontend applications. My preferred stack is TypeScript, Vue &amp; Node. Currently, I'm building web applications to help people make smart investments at Ninety Nine. I have a great interest in web accessibility, UI design, frontend architecture &amp; design patterns. To reach me, please use linkedin or twitter.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
