Below is a code that defines the values that cause the sprite to start at the top of the object being orbited:
Create Event:
ballSin=1;
ballCos=0;
ballSinMode=true;
ballCosMode=false;
Below is a code that modifies the values started in the previous code so that the sprite starts to rotate / orbit the object in a counterclockwise direction:
Step Event:
if(ballSinMode){
ballSin-=0.05;
if(ballSin==-1){
ballSinMode=false;
}
}else{
ballSin+=0.05;
if(ballSin==1){
ballSinMode=true;
}
}
if(ballCosMode){
ballCos+=0.05;
if(ballCos==1){
ballCosMode=false;
}
}else{
ballCos-=0.05;
if(ballCos==-1){
ballCosMode=true;
}
}
Draw Event:
draw_sprite(Sprite7,0,x+(75*ballCos),y+(-75*ballSin));
The object/sprite moves correctly, but the movement occurs as follows:
The movement I would like the object/sprite to perform:
I don't know why the object makes a straight movement. For me it would tend to always keep the same distance from the reference point (position of the object in the center). Since the movement is not circular, it does not. I would like to know why and how to make him move in the desired way.
OBS - Using the program's "path" feature is out of the question.