New answers tagged phaser
0
The best way to approach this is to get the values of the coordinates to the x axis around the object, then generate the y coordinate using some simple math.
function genCircle(x,y,radius,precision){ // x and y are coordinates of object
let arr=[];
for(let i=-radius;i<=radius;i+=precision){
let ty=(radius**2-(i)**2)/(y);
arr.push([i+x,ty-y]); /...
Top 50 recent answers are included
Related Tags
phaser × 136javascript × 57
html5 × 16
physics × 14
tilemap × 11
2d × 8
sprites × 8
tiled × 7
collision-detection × 4
multiplayer × 4
html-canvas × 4
node.js × 4
game-design × 3
animation × 3
camera × 3
box2d × 3
game-mechanics × 3
isometric × 3
spritesheet × 3
text × 3
browser-based-games × 3
rendering × 2
graphics × 2
movement × 2
tiles × 2