some random housekeeping (ScreenShaker)
This commit is contained in:
@@ -23,7 +23,7 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
public void Tick (Actor self)
|
public void Tick (Actor self)
|
||||||
{
|
{
|
||||||
Game.viewport.Scroll(getScrollOffset());
|
Game.viewport.Scroll(GetScrollOffset());
|
||||||
shakeEffects.RemoveAll(t => t.ExpiryTime == ticks);
|
shakeEffects.RemoveAll(t => t.ExpiryTime == ticks);
|
||||||
ticks++;
|
ticks++;
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ namespace OpenRA.Traits
|
|||||||
shakeEffects.Add(new ShakeEffect { ExpiryTime = ticks + time, Position = position, Intensity = intensity });
|
shakeEffects.Add(new ShakeEffect { ExpiryTime = ticks + time, Position = position, Intensity = intensity });
|
||||||
}
|
}
|
||||||
|
|
||||||
public float2 getScrollOffset()
|
float2 GetScrollOffset()
|
||||||
{
|
{
|
||||||
int xFreq = 4;
|
int xFreq = 4;
|
||||||
int yFreq = 5;
|
int yFreq = 5;
|
||||||
@@ -43,7 +43,7 @@ namespace OpenRA.Traits
|
|||||||
(float) Math.Cos((ticks*2*Math.PI)/yFreq));
|
(float) Math.Cos((ticks*2*Math.PI)/yFreq));
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetIntensity()
|
float GetIntensity()
|
||||||
{
|
{
|
||||||
var cp = Game.viewport.Location
|
var cp = Game.viewport.Location
|
||||||
+ .5f * new float2(Game.viewport.Width, Game.viewport.Height);
|
+ .5f * new float2(Game.viewport.Width, Game.viewport.Height);
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
using OpenRA.Orders;
|
using OpenRA.Orders;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace OpenRA.Widgets
|
namespace OpenRA.Widgets
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user