Skip to content

Conversation

@m5cn6jb7th-cyber
Copy link

No description provided.

@m5cn6jb7th-cyber
Copy link
Author

using UnityEngine;

public enum PieceType { King, Queen, Rook, Bishop, Knight, Pawn }
public enum PieceColor { White, Black }

public class Piece : MonoBehaviour
{
public PieceType pieceType;
public PieceColor color;
public int boardX, boardZ;

// Battle stats (simple)
public int maxHP = 10;
public int currentHP;
public int attack = 5;
public int defense = 2;

public void Init(PieceType type, PieceColor col, int x, int z)
{
    pieceType = type;
    color = col;
    boardX = x; boardZ = z;
    currentHP = maxHP;
}

public void MoveTo(int x, int z, Vector3 worldPos)
{
    boardX = x; boardZ = z;
    transform.position = worldPos + Vector3.up * 0.5f;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant