From 7add727db0a619b8b027e257bd62d800890087c6 Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Tue, 22 Aug 2017 23:48:51 +0200 Subject: [PATCH] Disco Ball prototype --- Content.Client/Content.Client.csproj | 3 ++- Content.Client/Prototypes/DiscoBall.cs | 36 ++++++++++++++++++++++++++ Resources/Prototypes/discoball.yml | 14 ++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 Content.Client/Prototypes/DiscoBall.cs create mode 100644 Resources/Prototypes/discoball.yml diff --git a/Content.Client/Content.Client.csproj b/Content.Client/Content.Client.csproj index a423d04b11..f4bc675860 100644 --- a/Content.Client/Content.Client.csproj +++ b/Content.Client/Content.Client.csproj @@ -56,6 +56,7 @@ + @@ -98,4 +99,4 @@ - \ No newline at end of file + diff --git a/Content.Client/Prototypes/DiscoBall.cs b/Content.Client/Prototypes/DiscoBall.cs new file mode 100644 index 0000000000..0916851a87 --- /dev/null +++ b/Content.Client/Prototypes/DiscoBall.cs @@ -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(); + } + + 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)); + } + } +} diff --git a/Resources/Prototypes/discoball.yml b/Resources/Prototypes/discoball.yml new file mode 100644 index 0000000000..541c2061c2 --- /dev/null +++ b/Resources/Prototypes/discoball.yml @@ -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