charlie_says Posted May 25, 2018 Share Posted May 25, 2018 If you imagine a rectangular clock face, I need to calculate the positions where the numbers go (i.e. at the edge of the rectangle). Calculating the position on a circle is trivial, but my brain is not engaging with how I can get the position on a rectangle this morning... ...can anyone point me in the right direction? Quote Link to comment Share on other sites More sharing options...
charlie_says Posted May 25, 2018 Author Share Posted May 25, 2018 Actually, I played around with this some more, and the clock anaology is incorrect. The actual problem is this: I need to place n tiles on the edge of a rectangle (dimensions w & h), if there's too many pieces to fit then add additionally to w & h so they can... Quote Link to comment Share on other sites More sharing options...
Antriel Posted May 25, 2018 Share Posted May 25, 2018 http://labs.phaser.io/edit.html?src=src\geom\rectangle\get points.js http://labs.phaser.io/edit.html?src=src\geom\rectangle\marching ants.js might help? you can look at the phaser's source to see how it's implemented charlie_says 1 Quote Link to comment Share on other sites More sharing options...
charlie_says Posted May 25, 2018 Author Share Posted May 25, 2018 thanks @Antriel that was an excellent suggestion. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.