# \[Phaser 3\] Haunted Tower TD - Mobile game focused on strategy with well balanced levels

**URL:** <https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383>\
**Category:** Showcase\
**Created:** [October 3, 2022, 3:18pm UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383 "2022-10-03T15:18:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![HauntedTowerTD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hauntedtowertd/32/6968_2.png) [@HauntedTowerTD](https://phaser.discourse.group/u/HauntedTowerTD)\
**Post date:** [October 3, 2022, 3:18pm UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/1 "2022-10-03T15:18:37Z")

</div>

![HauntedTower](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/b/b01d5ae5dec132f84a68c1eecc34df528aad2a88.gif)

**Play Store** : [https://play.google.com/store/apps/details?id=com.morion4000.hauntedtower](https://play.google.com/store/apps/details?id=com.morion4000.hauntedtower)

I am a seasoned web developer, but a newbie when it comes to game development. This is my first attempt at such an endeavor and it was fun.

Coded it with Phaser 3, Typescript, and CapacitorJS.

![0](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/5/5363edb3195b4b5e08cce2b51de10cb9e962ef91.png)

![1](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/5/5c4e23662a8d4f8c23c9987d44bf92d83bf7cd54.png)

![3](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/3/3ebc45df3cb98b1d4e97487a1a9731cf2b62aede.png)

---

<div class="post-metadata">

**Author:** ![HauntedTowerTD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hauntedtowertd/32/6968_2.png) [@HauntedTowerTD](https://phaser.discourse.group/u/HauntedTowerTD)\
**Post date:** [October 3, 2022, 3:24pm UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/2 "2022-10-03T15:24:49Z")

</div>

YouTube trailer: [Haunted Tower Preview - YouTube](https://www.youtube.com/watch?v=Toh2WNJTIGw)

---

<div class="post-metadata">

**Author:** ![HauntedTowerTD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hauntedtowertd/32/6968_2.png) [@HauntedTowerTD](https://phaser.discourse.group/u/HauntedTowerTD)\
**Post date:** [October 8, 2022, 5:15am UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/3 "2022-10-08T05:15:29Z")

</div>

Released iOS version: [‎Haunted Tower TD on the App&nbsp;Store](https://apps.apple.com/app/haunted-tower-td/id6443698472)

---

<div class="post-metadata">

**Author:** ![HauntedTowerTD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hauntedtowertd/32/6968_2.png) [@HauntedTowerTD](https://phaser.discourse.group/u/HauntedTowerTD)\
**Post date:** [November 9, 2022, 9:32am UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/4 "2022-11-09T09:32:30Z")

</div>

🔄 New update for 👻 **Haunted Tower** is available on the Google and Apple stores:

☑ finished campaign mode with 15 challenging levels  
☑ implemented a lot of performance optimizations

🌐 [www.hauntedtower.com](http://www.hauntedtower.com)

---

<div class="post-metadata">

**Author:** ![phodye](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@phodye](https://phaser.discourse.group/u/phodye)\
**Post date:** [November 10, 2022, 4:56pm UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/5 "2022-11-10T16:56:45Z")

</div>

This is great! I’m trying to learn Phaser and I was wondering how do you calculate the distance between the enemy and the tower? Do you have any resources you suggest looking at? Thanks!

---

<div class="post-metadata">

**Author:** ![HauntedTowerTD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hauntedtowertd/32/6968_2.png) [@HauntedTowerTD](https://phaser.discourse.group/u/HauntedTowerTD)\
**Post date:** [November 11, 2022, 7:47am UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/6 "2022-11-11T07:47:23Z")

</div>

I am using a Phaser utility to calculate the distance between the enemy and the tower: `Phaser.Math.Distance.Between(tower.x, tower.y, enemy.x, enemy.y)`

---

<div class="post-metadata">

**Author:** ![phodye](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@phodye](https://phaser.discourse.group/u/phodye)\
**Post date:** [November 11, 2022, 3:11pm UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/7 "2022-11-11T15:11:05Z")

</div>

Thanks! I’ve calculated the distance but I can’t get the velocity of the sprite, for some reason when I log it it says initialize {x: 0, y: 0}

---

<div class="post-metadata">

**Author:** ![HauntedTowerTD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hauntedtowertd/32/6968_2.png) [@HauntedTowerTD](https://phaser.discourse.group/u/HauntedTowerTD)\
**Post date:** [November 14, 2022, 7:23am UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/8 "2022-11-14T07:23:01Z")

</div>

You need the position of the game object. Not sure velocity has anything to do with it.

---

<div class="post-metadata">

**Author:** ![HauntedTowerTD](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/hauntedtowertd/32/6968_2.png) [@HauntedTowerTD](https://phaser.discourse.group/u/HauntedTowerTD)\
**Post date:** [November 18, 2022, 9:30am UTC](https://phaser.discourse.group/t/phaser-3-haunted-tower-td-mobile-game-focused-on-strategy-with-well-balanced-levels/12383/9 "2022-11-18T09:30:53Z")

</div>

Released a new game mode: Survivor. You can also play the game on [itch.io](http://itch.io): [Haunted Tower TD by morion4000](https://morion4000.itch.io/hauntedtower).
