How to add x, y to move object with floatsin, floatcos for current angle.
#10

Look at the comments!

Код:
	// Calculate position to left of player
	x = (x + 1.75 * floatsin(-fa + -90,degrees));
	y = (y + 1.75 * floatcos(-fa + -90,degrees));

	// Calculate create offset
	if(FlyMode[playerid])
	{
		x = (x + 4.0 * floatsin(-fa,degrees));
		y = (y + 4.0 * floatcos(-fa,degrees));
	}
	else
	{
		x = (x + 2.0 * floatsin(-fa,degrees));
		y = (y + 2.0 * floatcos(-fa,degrees));
	}
1.) Calculate the position of the board first
2.) Calculate offsets for objects that correlates to this postion

I only have one object here, you have multiple so you need to do something like this.

Код:
startx= (startx+ 1.75 * floatsin(-fa + -90,degrees));
starty= (starty+ 1.75 * floatcos(-fa + -90,degrees));

// Calculate offsets for first object
x = (startx + 4.0 * floatsin(-fa,degrees));
y = (starty+ 4.0 * floatcos(-fa,degrees));
Createobject()....

// Calculate offsets for second object
x = (startx + 3.0 * floatsin(-fa,degrees));
y = (starty+ 3.0 * floatcos(-fa,degrees));
Createobject()....

// Calculate offsets for third object
x = (startx + 2.0 * floatsin(-fa,degrees));
y = (starty+ 2.0 * floatcos(-fa,degrees));
Createobject()....
One more thing, check this out. https://pastebin.com/rnnUUCy5

You could also just attach the text objects to the board.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)