Disco Ball prototype
This commit is contained in:
@@ -56,6 +56,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="EntryPoint.cs" />
|
<Compile Include="EntryPoint.cs" />
|
||||||
|
<Compile Include="Prototypes\DiscoBall.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
36
Content.Client/Prototypes/DiscoBall.cs
Normal file
36
Content.Client/Prototypes/DiscoBall.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using SS14.Client.GameObjects;
|
||||||
|
using SS14.Shared.GameObjects;
|
||||||
|
|
||||||
|
namespace Content.Client.Prototypes
|
||||||
|
{
|
||||||
|
public class DiscoBall : Entity
|
||||||
|
{
|
||||||
|
private PointLightComponent LightComponent;
|
||||||
|
private float Hue;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
LightComponent = GetComponent<PointLightComponent>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Shutdown()
|
||||||
|
{
|
||||||
|
base.Shutdown();
|
||||||
|
LightComponent = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Update(float frameTime)
|
||||||
|
{
|
||||||
|
Hue += frameTime / 10;
|
||||||
|
if (Hue > 1)
|
||||||
|
{
|
||||||
|
Hue -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
LightComponent.Color = Color4.FromHsl(new Vector4(Hue, 1, 0.5f, 0.5f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Resources/Prototypes/discoball.yml
Normal file
14
Resources/Prototypes/discoball.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
- type: entity
|
||||||
|
name: Disco Ball
|
||||||
|
id: discoball
|
||||||
|
class: Content.Client.Prototypes.DiscoBall
|
||||||
|
components:
|
||||||
|
- type: Transform
|
||||||
|
- type: Sprite
|
||||||
|
sprites:
|
||||||
|
- wall_light
|
||||||
|
|
||||||
|
- type: Icon
|
||||||
|
icon: wall_light
|
||||||
|
|
||||||
|
- type: PointLight
|
||||||
Reference in New Issue
Block a user