Added more tiles and a player sprite
This commit is contained in:
parent
fb699940fe
commit
ad47dde7ed
@ -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()
|
||||||
|
BIN
Tiles/data/core/player/dude.png
Normal file
BIN
Tiles/data/core/player/dude.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 720 B |
5
Tiles/data/core/tiles/glass.json
Normal file
5
Tiles/data/core/tiles/glass.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"Name": "glass",
|
||||||
|
"ImagePath": "data/core/tiles/images/glass.png",
|
||||||
|
"Transparent": false
|
||||||
|
}
|
BIN
Tiles/data/core/tiles/images/glass.png
Normal file
BIN
Tiles/data/core/tiles/images/glass.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 569 B |
BIN
Tiles/data/core/tiles/images/wood.png
Normal file
BIN
Tiles/data/core/tiles/images/wood.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 675 B |
Loading…
Reference in New Issue
Block a user