Added back tile switching
This commit is contained in:
parent
0da03e2650
commit
ddb5838740
@ -74,16 +74,25 @@ public class Game
|
||||
if (Raylib.IsKeyDown(KeyboardKey.S)) _playerPosition += new Vector2(0, 1) * _playerSpeed;
|
||||
if (Raylib.IsKeyDown(KeyboardKey.D)) _playerPosition += new Vector2(1, 0) * _playerSpeed;
|
||||
|
||||
// if (Raylib.IsKeyReleased(KeyboardKey.Right))
|
||||
// {
|
||||
// _currentSelectedIndex = (_currentSelectedIndex + 1) % _tiles.Count;
|
||||
// _currentSelectedTile = _tiles.Keys.ElementAt(_currentSelectedIndex);
|
||||
// }
|
||||
// if (Raylib.IsKeyReleased(KeyboardKey.Left))
|
||||
// {
|
||||
// _currentSelectedIndex = (_currentSelectedIndex - 1 + _tileIdToTile.Count) % _tileIdToTile.Count;
|
||||
// _currentSelectedTile = _tiles.Keys.ElementAt(_currentSelectedIndex);
|
||||
// }
|
||||
if (Raylib.IsKeyReleased(KeyboardKey.Right))
|
||||
{
|
||||
_currentSelectedIndex = (_currentSelectedIndex + 1) % _tileNameToId.Count;
|
||||
if (_currentSelectedIndex == 0)
|
||||
{
|
||||
_currentSelectedIndex = 1;
|
||||
}
|
||||
_currentSelectedTileId = _currentSelectedIndex;
|
||||
}
|
||||
else if (Raylib.IsKeyReleased(KeyboardKey.Left))
|
||||
{
|
||||
_currentSelectedIndex = (_currentSelectedIndex - 1 + _tileNameToId.Count) % _tileNameToId.Count;
|
||||
if (_currentSelectedIndex == 0)
|
||||
{
|
||||
_currentSelectedIndex = _tileNameToId.Count - 1;
|
||||
}
|
||||
_currentSelectedTileId = _currentSelectedIndex;
|
||||
}
|
||||
|
||||
|
||||
if (Raylib.IsMouseButtonDown(MouseButton.Left))
|
||||
{
|
||||
|
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Tiles")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4e792f1937f7dc281b5a56279f8f427a8b6b0e88")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0da03e265018635b2f3e864a0a58892ad192ded4")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Tiles")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Tiles")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
878acde2fee11315f28b912e289b8837693e33e44d350f59ac560f4d3c05e70f
|
||||
220403ec0cc61e464f2c4b47238cd8c86b23211d444384c79bb9beec2db08dfa
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user