Added more tiles and a player sprite

This commit is contained in:
Chris Bell 2024-11-17 23:42:11 -06:00
parent fb699940fe
commit ad47dde7ed
5 changed files with 11 additions and 1 deletions

View File

@ -19,6 +19,8 @@ public class Game
private Vector2 _playerPosition; private Vector2 _playerPosition;
private float _playerSpeed = 2f; private float _playerSpeed = 2f;
private Image _playerImage;
private Texture2D _playerTexture;
private Vector2 _pointerPosition = Vector2.Zero; private Vector2 _pointerPosition = Vector2.Zero;
@ -34,6 +36,8 @@ public class Game
Raylib.InitWindow(_screenWidth, _screenHeight, "Tiles"); Raylib.InitWindow(_screenWidth, _screenHeight, "Tiles");
Raylib.SetTargetFPS(60); Raylib.SetTargetFPS(60);
_playerTexture = Raylib.LoadTexture("data/core/player/dude.png");
_playerPosition = GetGlobalPositionFromGrid(500, 500); _playerPosition = GetGlobalPositionFromGrid(500, 500);
_camera = new Camera2D() _camera = new Camera2D()
@ -161,7 +165,8 @@ public class Game
private void DrawPlayer() private void DrawPlayer()
{ {
Raylib.DrawRectangle((int)_playerPosition.X, (int)_playerPosition.Y, 16, 32, new(0,0,100,255)); //Raylib.DrawRectangle((int)_playerPosition.X, (int)_playerPosition.Y, 16, 32, new(0,0,100,255));
Raylib.DrawTexture(_playerTexture, (int)_playerPosition.X, (int)_playerPosition.Y, Color.White);
} }
private void DrawPointer() private void DrawPointer()

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

View File

@ -0,0 +1,5 @@
{
"Name": "glass",
"ImagePath": "data/core/tiles/images/glass.png",
"Transparent": false
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B