MovePicture around Valur (Math.PI)

Ok guys, am trying make rotation of planet.


if the sunny ex:


If my Var Center=200;


how move other picture around this VAR Center?


In a parallel process


var radians = (Math.PI / 180) * Center;


Code:
$gameScreen.movePicture(1, 1, $gameMap.event(6)._x+radians, $gameMap.event(6)._y+radians, 40, 40, 255, 0, 240);

Code:
wait 3sec;






if someone has an idea from concept to move an image around a variable valur. ?


Is possible ?
I am confident that I am take hurts
You'd want want to set the position based on the center, which you don't even use in your example.


// setup in some function
this.center = {x: 200, y: 200};
this.radius = 50; // How far away from the center will it be rotating around?
this.angle = 0;

.
.
.
.

// Some update function
var x = this.center.x + Math.cos(angle) * radius;
var y = this.center.y + Math.sin(angle) * radius;
angle += 0.1; // Adjust this to change the speed of the rotation
$gameScreen.movePicture(1, 1, x, y, 40, 40, 255, 0, 240);


This requires that you have a setup function and an update function, but it'll move your picture around the center point and keep it radius distance away from the actual point so that it looks like it's actually rotating around that position.
You'd want want to set the position based on the center, which you don't even use in your example.



// setup in some function
this.center = {x: 200, y: 200};
this.radius = 50; // How far away from the center will it be rotating around?
this.angle = 0;

.
.
.
.

// Some update function
var x = this.center.x + Math.cos(angle) * radius;
var y = this.center.y + Math.sin(angle) * radius;
angle += 0.1; // Adjust this to change the speed of the rotation
$gameScreen.movePicture(1, 1, x, y, 40, 40, 255, 0, 240);


This requires that you have a setup function and an update function, but it'll move your picture around the center point and keep it radius distance away from the actual point so that it looks like it's actually rotating around that position.

ok tanks my friend , i will study this 

Original thread: https://forums.rpgmakerweb.com/threads/movepicture-around-valur-math-pi.67696/