Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
BlizzardShaderData.cs
Go to the documentation of this file.
3
5
7{
9
10 private float windSpeed = 0.1f;
11
12 public BlizzardShaderData(string passName)
13 : base(passName)
14 {
15 }
16
17 public override void Update(GameTime gameTime)
18 {
19 float num = Main.windSpeedCurrent;
20 if (num >= 0f && num <= 0.1f)
21 {
22 num = 0.1f;
23 }
24 else if (num <= 0f && num >= -0.1f)
25 {
26 num = -0.1f;
27 }
28 windSpeed = num * 0.05f + windSpeed * 0.95f;
29 Vector2 vector = new Vector2(0f - windSpeed, -1f) * new Vector2(10f, 2f);
30 vector.Normalize();
31 vector *= new Vector2(0.8f, 0.6f);
33 {
34 _texturePosition += vector * (float)gameTime.ElapsedGameTime.TotalSeconds;
35 }
36 _texturePosition.X %= 10f;
37 _texturePosition.Y %= 10f;
38 UseDirection(vector);
40 base.Update(gameTime);
41 }
42
43 public override void Apply()
44 {
46 base.Apply();
47 }
48}
ScreenShaderData UseTargetPosition(Vector2 position)
ScreenShaderData UseDirection(Vector2 direction)
static float windSpeedCurrent
Definition Main.cs:1360
static bool hasFocus
Definition Main.cs:1781
static bool gamePaused
Definition Main.cs:1072