Added tutorial.

This commit is contained in:
2020-07-12 12:05:52 -05:00
parent 1126e6c4b4
commit 00b2670cfc
8 changed files with 319 additions and 10 deletions

View File

@@ -57,7 +57,7 @@ namespace SkinnerBox.Entities
timeElapsed.HardSet(0);
stepSize = 0;
upTime = 0;
Color = Color.Cyan;
Color = Color.Black;
UpdateProgressMesh();
}
@@ -72,8 +72,15 @@ namespace SkinnerBox.Entities
progressValue.InterpolatePosition(delta);
timeElapsed.InterpolatePosition(delta);
float prog = timeElapsed.Value / upTime;
if (prog > 1) prog = 1;
if (prog < 0) prog = 0;
if (upTime != 0) {
if (prog > 1) {
prog = 1;
} else if (prog < 0) {
prog = 0;
}
} else {
prog = 1;
}
this.Color = Color.FromArgb((int)(byte.MaxValue * (1f - prog)), Color);
progressMesh.Color = Color.FromArgb((int)(byte.MaxValue * (1f - prog)), progressMesh.Color);
UpdateProgressMesh();

View File

@@ -1,5 +1,5 @@
using System;
using System.Numerics;
using System.Drawing;
using SlatedGameToolkit.Framework.Graphics.Render;
using SlatedGameToolkit.Framework.Graphics.Textures;
using SlatedGameToolkit.Framework.Utilities.Collections.Pooling;
@@ -23,6 +23,7 @@ namespace SkinnerBox.Entities
this.velocity = 0;
this.X = 0;
this.mesh.X = this.X;
Color = Color.Black;
}
public void Update(double delta) {