updated textures
|
After Width: | Height: | Size: 250 B |
|
After Width: | Height: | Size: 233 B |
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 220 B |
|
After Width: | Height: | Size: 221 B |
|
After Width: | Height: | Size: 241 B |
|
After Width: | Height: | Size: 279 B |
|
After Width: | Height: | Size: 199 B |
|
After Width: | Height: | Size: 242 B |
|
After Width: | Height: | Size: 161 B |
|
After Width: | Height: | Size: 720 B |
|
After Width: | Height: | Size: 217 B |
|
After Width: | Height: | Size: 222 B |
|
After Width: | Height: | Size: 235 B |
|
After Width: | Height: | Size: 178 B |
|
After Width: | Height: | Size: 254 B |
|
After Width: | Height: | Size: 175 B |
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 170 B |
|
After Width: | Height: | Size: 249 B |
|
After Width: | Height: | Size: 218 B |
|
After Width: | Height: | Size: 248 B |
|
After Width: | Height: | Size: 208 B |
|
|
@ -41,8 +41,6 @@ public class PlayerEntity
|
||||||
{
|
{
|
||||||
X = inputState.GetAxis(InputAxis.Horizontal) * movement.Speed.X
|
X = inputState.GetAxis(InputAxis.Horizontal) * movement.Speed.X
|
||||||
};
|
};
|
||||||
Console.WriteLine(movement.IsGrounded);
|
|
||||||
Console.WriteLine(movement.CurrentVelocity);
|
|
||||||
|
|
||||||
player.Position += movement.CurrentVelocity;
|
player.Position += movement.CurrentVelocity;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Mine2d.game.core.tiles;
|
||||||
|
|
||||||
|
namespace Mine2d.game.core.world;
|
||||||
|
|
||||||
|
public struct GenerationSettings {
|
||||||
|
public int xOffset { get; set; }
|
||||||
|
public int yOffset { get; set; }
|
||||||
|
public Tiles tile { get; set; }
|
||||||
|
|
||||||
|
public int GetWeight(int height) {
|
||||||
|
return (int)((-Math.Pow(height - this.xOffset, 2)*0.01) + this.yOffset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WorldGenerator
|
||||||
|
{
|
||||||
|
List<GenerationSettings> settings = new ();
|
||||||
|
|
||||||
|
public WorldGenerator() {
|
||||||
|
this.settings.Add(new GenerationSettings {
|
||||||
|
xOffset = 50,
|
||||||
|
yOffset = 16,
|
||||||
|
tile = Tiles.Stone
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,11 +4,18 @@ namespace Mine2d.game.frontend.renderer;
|
||||||
|
|
||||||
public class PlayerRenderer : IRenderer
|
public class PlayerRenderer : IRenderer
|
||||||
{
|
{
|
||||||
|
private IntPtr playerTexture;
|
||||||
|
|
||||||
public void Render()
|
public void Render()
|
||||||
{
|
{
|
||||||
|
if(this.playerTexture == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
this.playerTexture = Context.Get().TextureFactory.LoadTexture("character.character");
|
||||||
|
}
|
||||||
var ctx = Context.Get();
|
var ctx = Context.Get();
|
||||||
var camera = ctx.FrontendGameState.Camera;
|
var camera = ctx.FrontendGameState.Camera;
|
||||||
var scale = ctx.FrontendGameState.Settings.GameScale;
|
var scale = ctx.FrontendGameState.Settings.GameScale;
|
||||||
|
var (width, height) = ctx.Window.GetSize();
|
||||||
foreach (var player in ctx.GameState.Players)
|
foreach (var player in ctx.GameState.Players)
|
||||||
{
|
{
|
||||||
if (player.Name == ctx.FrontendGameState.PlayerName)
|
if (player.Name == ctx.FrontendGameState.PlayerName)
|
||||||
|
|
@ -20,11 +27,18 @@ public class PlayerRenderer : IRenderer
|
||||||
ctx.Renderer.SetColor(255, 0, 0);
|
ctx.Renderer.SetColor(255, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Renderer.DrawRect(
|
// ctx.Renderer.DrawRect(
|
||||||
(player.Position.X - (int)camera.Position.X) * scale,
|
// (player.Position.X - (int)camera.Position.X) * scale,
|
||||||
(player.Position.Y - (int)camera.Position.Y) * scale - 28 * scale,
|
// (player.Position.Y - (int)camera.Position.Y) * scale - 28 * scale,
|
||||||
14 * scale,
|
// 14 * scale,
|
||||||
28 * scale
|
// 28 * scale
|
||||||
|
// );
|
||||||
|
ctx.Renderer.DrawTexture(
|
||||||
|
this.playerTexture,
|
||||||
|
width / 2,
|
||||||
|
(height / 2) - (31 * scale),
|
||||||
|
16 * scale,
|
||||||
|
32 * scale
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
- Iron ore: #A9A9A9
|
||||||
|
- Copper ore: #B87333
|
||||||
|
- Tin ore: #668080
|
||||||
|
- Silver ore: #C0C0C0
|
||||||
|
- Gold ore: #FFD700
|
||||||
|
- Lead ore: #A9A9A9
|
||||||
|
- Nickel ore: #A8A8A8
|
||||||
|
- Platinum ore: #E5E4E2
|
||||||
|
- Cobalt ore: #0047AB
|
||||||
|
- Zinc ore: #A9A9A9
|
||||||
|
- Tungsten ore: #BFBFBF
|
||||||
|
- Uranium ore: #00FF00
|
||||||
|
- Diamond ore: #B9F2FF
|
||||||
|
- Emerald ore: #50C878
|
||||||
|
- Ruby ore: #E0115F
|
||||||
|
- Mythril ore: #C5C9C7
|
||||||
|
- Adamantine ore: #B5A642
|
||||||
|
- Orichalcum ore: #90713D
|
||||||
|
- Celestite ore: #5DADE2
|
||||||
|
- Aetherium ore: #00FFFF
|
||||||