Тема:Программирование повторения графических объектов
Напишите программу, которая, с цикла, выводила бы на экран следующий рисунок(скрин).
Пример задачи: SCREEN 9 INPUT “количество точек =”; N FOR A=1 TO N STEP 1 Х=INT(RND*640) У= INT(RND*350) CIRCLE (X, Y), 30, 7, 0.001, 3.14 LINE (X-30, Y) – (X+30, Y+120), 7, BF CIRCLE (X, Y+60), 20,7, , , 3 NEXT A
SCREEN 9 X=30 FOR A=1 TO N LINE (X, 120) – (X+50), 6 X = X+15 NEXT A
// Token: 0x02000013 RID: 19
internal class Аимбот : MonoBehaviour
{
// Token: 0x06000041 RID: 65 RVA: 0x00003C34 File Offset: 0x00001E34
public void AvtoAimAtPlayer(Character localCharacter, Character targetCharacter)
{
Vector3 vector;
vector..ctor(0f, 0f, 0f);
Vector3 vector2;
vector2..ctor(0f, 0f, 0f);
Аимбот.GetAimPosition(localCharacter, targetCharacter, ref vector, ref vector2);
Vector3 vector3 = vector2 - vector;
vector3.Normalize();
Angle2 normalized = Angle2.LookDirection(vector3).normalized;
localCharacter.eyesAngles = normalized;
}
// Token: 0x06000042 RID: 66 RVA: 0x00003CA0 File Offset: 0x00001EA0
public static void GetAimPosition(Character localCharacter, Character targetCharacter, ref Vector3 startPosition, ref Vector3 endPosition)
{
startPosition = localCharacter.transform.position;
endPosition = targetCharacter.transform.position;
Transform eyeBone = Локал.GetEyeBone(localCharacter);
Transform transform = CVars.Аимбот.AbmHead ? Локал.GetHeadBone(targetCharacter) : Локал.GetBodyBone(targetCharacter);
startPosition.y += 1f;
if (eyeBone != null)
{
startPosition = eyeBone.position;
}
endPosition.y += 1f;
if (transform != null)
{
endPosition = transform.position;
}
}
// Token: 0x06000043 RID: 67 RVA: 0x00003D34 File Offset: 0x00001F34
private static Character GetClosestToCrosshair()
{
Character localCharacter = OB.LocalCharacter;
Character result = null;
float num = 99999f;
float num2 = (float)(Screen.width / 2);
float num3 = (float)(Screen.height / 2);
List<Character> playerList = OB.GetPlayerList();
if (CVars.Аимбот.AbmAnimals)
{
foreach (Character item in OB.GetAnimalList())
{
playerList.Add(item);
}
}
foreach (Character character in playerList)
{
if (Аимбот.ValidatePlayerClient_ForTarget(character))
{
Vector3 vector = Camera.main.WorldToScreenPoint(character.transform.position);
if (vector.z >= 0f)
{
vector.y = (float)Screen.height - (vector.y + 1f);
float num4;
if (vector.x > num2)
{
num4 = vector.x - num2;
}
else
{
num4 = num2 - vector.x;
}
float num5;
if (vector.y > num3)
{
num5 = vector.y - num3;
}
else
{
num5 = num3 - vector.y;
}
float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5));
if (num6 < num)
{
result = character;
num = num6;
}
}
}
}
return result;
}
// Token: 0x06000044 RID: 68 RVA: 0x00003EB8 File Offset: 0x000020B8
public static Character ()
{
Character localCharacter = OB.LocalCharacter;
Character result = null;
float num = 99999f;
float num2 = (float)(Screen.width / 2);
float num3 = (float)(Screen.height / 2);
foreach (Character character in OB.GetPlayerList())
{
if (Аимбот.ValidatePlayerClient_ForTarget(character))
{
Vector3 vector = Camera.main.WorldToScreenPoint(character.transform.position);
if (vector.z >= 0f)
{
vector.y = (float)Screen.height - (vector.y + 1f);
float num4;
if (vector.x > num2)
{
num4 = vector.x - num2;
}
else
{
num4 = num2 - vector.x;
}
float num5;
if (vector.y > num3)
{
num5 = vector.y - num3;
}
else
{
num5 = num3 - vector.y;
}
float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5));
if (num6 < num)
{
result = character;
num = num6;
}
}
}
}
return result;
}
// Token: 0x06000045 RID: 69 RVA: 0x00003FEC File Offset: 0x000021EC
private static float GetRotationFov(Character localCharacte, ref Vector3 startPos, ref Vector3 endPos)
{
Angle2 normalized = Angle2.LookDirection((endPos - startPos).normalized).normalized;
normalized.pitch -= localCharacte.eyesAngles.pitch;
normalized.yaw -= localCharacte.eyesAngles.yaw;
return (float)Math.Sqrt((double)(normalized.pitch * normalized.pitch + normalized.yaw * normalized.yaw));
}