-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathArrow.cs
139 lines (132 loc) · 5.65 KB
/
Arrow.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RhythmThing.System_Stuff;
using RhythmThing.Components;
namespace RhythmThing.Objects
{
public class Arrow : GameObject
{
private Visual visual;
public Chart.collumn collumn;
public Chart.NoteInfo noteInfo;
private Chart chart;
private float jumpAmount;
private float beatTime;
private float movementAmount;
//this needs to be changed
private int aimY;
public override void End()
{
}
public Arrow(Chart.collumn col, Chart.NoteInfo note, Chart chart)
{
collumn = col;
noteInfo = note;
this.chart = chart;
}
public override void Start(Game game)
{
//this block defines it as visual
this.components = new List<Component>();
this.type = objType.visual;
this.visual = new Visual();
visual.active = true;
visual.x = 30;
visual.y = 42;
visual.z = 0;
//holy fuck never do that again
//rumour has it there was once a disgusting block of code here
//this is still kinda shit...
switch (collumn)
{
case Chart.collumn.Left:
for (int i = 3; i > -2; i--)
{
visual.localPositions.Add(new Coords(i, 0, ' ', ConsoleColor.Green, ConsoleColor.Green));
visual.localPositions.Add(new Coords(i, 1, ' ', ConsoleColor.Green, ConsoleColor.Green));
visual.localPositions.Add(new Coords(i, -1, ' ', ConsoleColor.Green, ConsoleColor.Green));
}
for (int i = -2; i > -8; i--)
{
for (int x = -5 + ((-i) - 2); x < 5 - ((-i) - 3); x++)
{
visual.localPositions.Add(new Coords(i, x, ' ', ConsoleColor.Green, ConsoleColor.Green));
}
}
break;
case Chart.collumn.Down:
visual.x = 42;
visual.y = 44;
for (int i = 3; i > -2; i--)
{
visual.localPositions.Add(new Coords(0, i, ' ', ConsoleColor.Blue, ConsoleColor.Blue));
visual.localPositions.Add(new Coords(1, i, ' ', ConsoleColor.Blue, ConsoleColor.Blue));
visual.localPositions.Add(new Coords(-1, i, ' ', ConsoleColor.Blue, ConsoleColor.Blue));
}
for (int i = -2; i > -8; i--)
{
for (int x = -5 + ((-i) - 2); x < 5 - ((-i) - 3); x++)
{
visual.localPositions.Add(new Coords(x, i, ' ', ConsoleColor.Blue, ConsoleColor.Blue));
}
}
break;
case Chart.collumn.Up:
visual.x = 56;
visual.y = 40;
for (int i = -3; i < 2; i++)
{
visual.localPositions.Add(new Coords(0, i, ' ', ConsoleColor.Red, ConsoleColor.Red));
visual.localPositions.Add(new Coords(1, i, ' ', ConsoleColor.Red, ConsoleColor.Red));
visual.localPositions.Add(new Coords(-1, i, ' ', ConsoleColor.Red, ConsoleColor.Red));
}
//visual.localPositions.Add(new Coords(8, 0, 'h', ConsoleColor.DarkGreen, ConsoleColor.DarkCyan));
for (int i = 2; i < 8; i++)
{
for (int x = (-5) + i - 2; x < 5 - (i - 3); x++)
{
visual.localPositions.Add(new Coords(x, i, ' ', ConsoleColor.Red, ConsoleColor.Red));
}
}
break;
case Chart.collumn.Right:
visual.x = 68;
for (int i = -3; i < 2; i++)
{
visual.localPositions.Add(new Coords(i, 0, ' ', ConsoleColor.Yellow, ConsoleColor.Yellow));
visual.localPositions.Add(new Coords(i, 1, ' ', ConsoleColor.Yellow, ConsoleColor.Yellow));
visual.localPositions.Add(new Coords(i, -1, ' ', ConsoleColor.Yellow, ConsoleColor.Yellow));
}
//visual.localPositions.Add(new Coords(8, 0, 'h', ConsoleColor.DarkGreen, ConsoleColor.DarkCyan));
for (int i = 2; i < 8; i++)
{
for (int x = (-5) + i - 2; x < 5 - (i - 3); x++)
{
visual.localPositions.Add(new Coords(i, x, ' ', ConsoleColor.Yellow, ConsoleColor.Yellow));
}
}
break;
default:
break;
}
beatTime = chart.beat;
jumpAmount = chart.approachBeat / 47;
visual.y = visual.y - 100;
movementAmount = 100;
components.Add(visual);
aimY = visual.y;
}
public override void Update(double time, Game game)
{
float percent = (chart.beat - beatTime) / (noteInfo.time - beatTime);
if(percent >= 0.5)
{
//Console.WriteLine("h");
visual.y = aimY + (int)Math.Round(percent * movementAmount);
}
}
}
}