Hello all,

This is my first post so nice to meet you

I'm looking to spawn objects in a circle x distance away from the central point of the screen (x:windowWidth/2, y:windowHeight/2).

The angle being random(360).

I had this working in normal javascript like this:

enemy.x = (Math.sin(randomAngle * TO_RADIANS) * clearance) + (canvas.width/2) - (enemy.width/2);

enemy.y = (Math.cos(randomAngle * TO_RADIANS) * clearance) + (canvas.height/2) - (enemy.height/2);

Where clearance was the length of the centre point to the corner + some extra pixels to make sure they spawn off screen.

I just can't seem to replicate this in Construct 2 when adding this to Create Object event:

X: sin(random(360))*((sqrt((windowWidth*windowWidth)+(windowHeight*windowHeight))/2)+100)+(windowWidth/2)

Y:cos(random(360))*((sqrt((windowWidth*windowWidth)+(windowHeight*windowHeight))/2)+100)+(windowHeight/2)

Could anyone help me out with this? I noticed the asteroid tutorial just spawns random width and then choose() between a few offscreen Y values.

Thanks