-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleManager.cs
More file actions
154 lines (105 loc) · 3.94 KB
/
ParticleManager.cs
File metadata and controls
154 lines (105 loc) · 3.94 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace monowizard
{
internal class ParticleManager
{
public List<Entity> items;
public CollisionCheck colCheck;
public Player player;
public Texture2D libtexts1;
public Texture2D windcloudmanatext;
public Random rnd = new Random();
public ParticleManager(CollisionCheck collisionCheck, Player player)
{
this.player = player;
items = new List<Entity>();
colCheck = collisionCheck;
}
public void addBrainChunk(int x, int y, int xvel, int yvel)
{
items.Add(new brainchunk(colCheck,player,this));
items.Last().texture = libtexts1;
items.Last().hitbox.X = x;
items.Last().hitbox.Y = y;
items.Last().xvel = xvel;
items.Last().yvel = yvel;
// Debug.WriteLine("magic");
}
public void addWindParticle(int x, int y, int xvel, int yvel,int facing)
{
items.Add(new WindParticle(colCheck, player, this,facing));
items.Last().texture = windcloudmanatext;
items.Last().hitbox.X = x;
items.Last().hitbox.Y = y;
items.Last().xvel = xvel;
items.Last().yvel = yvel;
// Debug.WriteLine("magic");
}
public void addOwlFeather(int x, int y, int xvel, int yvel)
{
items.Add(new OwlFeatherPart(colCheck, player, this));
items.Last().texture = libtexts1;
items.Last().hitbox.X = x;
items.Last().hitbox.Y = y;
items.Last().xvel = xvel;
items.Last().yvel = yvel;
// Debug.WriteLine("magic");
}
public void addManaSmall(int x, int y, int xvel, int yvel,int size,float manavalue)
{
items.Add(new ManaSmall(colCheck, player, this,size,manavalue));
items.Last().texture = windcloudmanatext;
items.Last().hitbox.X = x;
items.Last().hitbox.Y = y;
items.Last().xvel = xvel;
items.Last().yvel = yvel;
// Debug.WriteLine("magic");
}
public void addHealSmall(int x, int y, int xvel, int yvel, int size, float manavalue)
{
items.Add(new healParticle(colCheck, player, this, size, manavalue));
items.Last().texture = windcloudmanatext;
items.Last().hitbox.X = x;
items.Last().hitbox.Y = y;
items.Last().xvel = xvel;
items.Last().yvel = yvel;
// Debug.WriteLine("magic");
}
public void addCloud(int x, int y, int xvel, int yvel, int size)
{
items.Add(new CloudParticle(colCheck, player, this, size));
items.Last().texture = windcloudmanatext;
items.Last().hitbox.X = x;
items.Last().hitbox.Y = y;
items.Last().xvel = xvel;
items.Last().yvel = yvel;
// Debug.WriteLine("magic");
}
public void update()
{
for (int i = 0; i < items.Count; i++)
{
items[i].update();
}
}
public void drawAll(SpriteBatch _spriteBatch)
{
for (int i = 0; i < items.Count; i++)
{
if (items[i].hitbox.X + 96 > player.centerWorldX - player.centerX &&
items[i].hitbox.X - 96 < player.centerWorldX + player.centerX &&
items[i].hitbox.Y + 96 > player.centerWorldY - player.centerY &&
items[i].hitbox.Y - 96 < player.centerWorldY + player.centerY)
{
items[i].draw(_spriteBatch);
}
}
}
}
}