mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Fin
This commit is contained in:
@@ -6,3 +6,6 @@ Name = "Sandbox"
|
||||
TargetType = "BeefGUIApplication"
|
||||
StartupObject = "GlitchyEngine.Program"
|
||||
ProcessorMacros = ["NOT_GAMMA_TEST", "SANDBOX_2D"]
|
||||
|
||||
[Platform.Windows]
|
||||
IconFile = "$(ProjectDir)/content/RocketGame/RocketIcon.ico"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
@@ -35,6 +35,8 @@ namespace Sandbox
|
||||
FontRenderer.PreparedText pressSpaceToStart ~ _.ReleaseRef();
|
||||
FontRenderer.PreparedText pressSpaceToRestart ~ _.ReleaseRef();
|
||||
|
||||
ColorHSV worldColor = .(0, 0.5f, 1.0f);
|
||||
|
||||
[AllowAppend]
|
||||
public this() : base("Example")
|
||||
{
|
||||
@@ -88,7 +90,7 @@ namespace Sandbox
|
||||
Vector4 v = .();
|
||||
v.X = startRandom.Next(-1000, 1000) / 2000f * _camera.Width;
|
||||
v.Y = startRandom.Next(-1000, 1000) / 2000f * _camera.Height;
|
||||
v.Z = startRandom.Next(0, 999) / 1000.0f;
|
||||
v.Z = startRandom.Next(0, 1000) / 2000.0f;
|
||||
v.W = startRandom.Next(1000, 3000) / 1000.0f;
|
||||
|
||||
points[i] = v;
|
||||
@@ -99,6 +101,11 @@ namespace Sandbox
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
worldColor.H += gameTime.DeltaTime * 18 * _rocket.FlightSpeed;
|
||||
worldColor.H %= 360.0f;
|
||||
|
||||
ColorRGBA wColor = .((ColorRGB)worldColor, 1.0f);
|
||||
|
||||
float screenWidth = _camera.Width;
|
||||
Obstacle.ScreenWidth = screenWidth / 2.0f;
|
||||
|
||||
@@ -147,19 +154,23 @@ namespace Sandbox
|
||||
|
||||
Renderer2D.BeginScene(_camera, .BackToFront);
|
||||
|
||||
Renderer2D.DrawQuad(Vector3(0, 2.75f, 1), Vector2(screenWidth, 1), 0, .White);
|
||||
Renderer2D.DrawQuad(Vector3(0, 2.75f, 1), Vector2(screenWidth, 1), 0, wColor);
|
||||
|
||||
Renderer2D.DrawQuad(Vector3(0, -2.75f, 1), Vector2(screenWidth, 1), 0, .White);
|
||||
Renderer2D.DrawQuad(Vector3(0, -2.75f, 1), Vector2(screenWidth, 1), 0, wColor);
|
||||
|
||||
for (Obstacle obs in _obstacles)
|
||||
{
|
||||
obs.Draw();
|
||||
obs.Draw(wColor);
|
||||
}
|
||||
|
||||
_rocket.Draw();
|
||||
|
||||
FontRenderer.DrawText(_font, scope $"{_rocket.Score}", 0, 1.5f, 1, .Black);
|
||||
FontRenderer.DrawText(_font, scope $"{_rocket.Score}", 0.1f, 1.6f, 1, .(230, 230, 230));
|
||||
var scorePrep = FontRenderer.PrepareText(_font, scope $"{_rocket.Score}", 1.0f);
|
||||
|
||||
FontRenderer.DrawText(scorePrep, -scorePrep.AdvanceX / 2, 1.5f, .Black);
|
||||
FontRenderer.DrawText(scorePrep, -scorePrep.AdvanceX / 2 + 0.1f, 1.6f, .(230, 230, 230));
|
||||
|
||||
scorePrep.ReleaseRef();
|
||||
|
||||
if (!_rocket.Started)
|
||||
{
|
||||
|
||||
@@ -31,16 +31,16 @@ namespace Sandbox
|
||||
|
||||
static Matrix mat = Matrix.Scaling(2.5f, 5, 1) * Matrix.RotationZ(MathHelper.PiOverFour);
|
||||
|
||||
public void Draw()
|
||||
public void Draw(ColorRGBA color)
|
||||
{
|
||||
Matrix matty = mat;
|
||||
matty.Translation.X = Position.X;
|
||||
|
||||
matty.Translation.Y = Position.Y - HoleSize;
|
||||
Renderer2D.DrawQuad(matty, Color.White);
|
||||
Renderer2D.DrawQuad(matty, color);
|
||||
|
||||
matty.Translation.Y = Position.Y + HoleSize;
|
||||
Renderer2D.DrawQuad(matty, Color.White);
|
||||
Renderer2D.DrawQuad(matty, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,11 +138,11 @@ namespace Sandbox
|
||||
_speed = newSpeed;
|
||||
_position = newPosition;
|
||||
|
||||
float ang = Math.Atan2(_speed.Y, 10) - MathHelper.PiOverTwo;
|
||||
float ang = Math.Atan2(_speed.Y, 5) - MathHelper.PiOverTwo;
|
||||
|
||||
_rotation = ang;
|
||||
|
||||
_direction = Vector2.Normalize(_speed + .(10, 0));
|
||||
_direction = Vector2.Normalize(_speed + .(5, 0));
|
||||
_rocketLine = .(_position - _direction / 2.8f, _position + _direction / 2.4f);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ namespace Sandbox
|
||||
{
|
||||
public this()
|
||||
{
|
||||
Window.Title = "Single Stage to Highscore";
|
||||
Window.SetIcon("content/RocketGame/RocketIcon.ico");
|
||||
|
||||
/*#if GAMMA_TEST
|
||||
PushLayer(new GammaTestLayer());
|
||||
#elif SANDBOX_2D
|
||||
|
||||
Reference in New Issue
Block a user