Asteroids Plus 2.0 - Milestone 15 - Mobile Debugging


This was a bit more of a chaotic, less focused push.  There were several bugs that I wanted to work through, and it took me a couple days to nail them down.

The first item to address was that the touchscreen fire button wasn’t working.  It did not take me long to figure out that the fire method call wasn’t even wired up for the touchscreen version.  That’s silly.

Once I wired that up, then there was a bug where the start screen kept showing every time I fired a bullet.  Which is… weird to say the least.  What that turned out to be was the ‘touchstart’ event from the menu where it says “TOUCH SCREEN TO BEGIN” wasn’t being unregistered.  This took a little fiddling with because for some reason, it did not want to successfully remove that listener.  Working with my discord friends, we came up with a few ways to address this.  First way was to have a deliberate method that mounts the event listener, and then returns with a method that destroys it.


I’ll be honest, this is slick, and it’s a pattern that I will use in the future for other projects.  What I eventually landed on for this program is utilizing the abort controller feature, and then using that to kill the event listener.

This works well.  I’m sure the other way works well too.

All this debugging got me doing a lot more play testing on mobile as well, which was important because I saw A LOT of inconsistencies with the UI, the HUD, and the stylings that I wanted to fix.

What I did to address this was create a whole section in my Peasy-UI binding data model that addressed CSS deliberately.


This organizes my data bindings and let’s me put these bindings in inline CSS style attributes.  This works well and makes it a lot easier to manage.

I also added an orientation flag, so my approach is to set the desktop stylings be default, but if its on mobile, can then set different CSS values based on landscape or portrait mode.

I will need to go back and adjust the resizing event in case someone mid-game rotates from portrait to landscape, or vice-versa, the game DOES NOT recover well from that currently. 

 This currently hosted game site: https://mookie4242.itch.io/asteroids-plus-20

Twitter: @jyoung424242

SlideShare: https://www.slideshare.net/JustinYoung3/next-gen-asteroids

GitHub: https://t.co/utxHxXKdOz

Leave a comment

Log in with itch.io to leave a comment.