Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

I've got it finished pretty much, I am now looking for a few good images to put together a better looking controller.

The controller appears at the bottom of the game, so the whole game play area remains visible not needing to be touched.

At first I tried having a circle of html divs, one for each rotation value, such that I would just have to detect which div the touch is moving over,
instead of doing any math. But touchmove events don't cross over, if the move started on one div, even though the finger moves over another,
it still registers as the same div being touched, until the finger is let go. So it has to be done with one div and Math.atan2. It's not so bad, I thought it would be,
the scale of the screen has to be accounted for, you have to convert the touch cords into cords that match the width height of your game not the screen,
figure a middle point to rotate around, and then use atan2 to rotate around it. My library already has a Class that calculates screen to game cord offsets, so I did not have to recreate that it was already there.  In an hour or so I should be back to update the demo.