Skip to content
Cody-willPublic

About

Some(checkers) - a checkers game built in rust. Because why not?

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some Checkers Logo

Master the game, conquer with confidence

last-commit repo-top-language repo-language-count

Built with the tools and technologies:

Rust TOML Slint


Table of Contents


Overview


Features

Component Details
⚙️ Architecture
  • Client-Server Model with Rust backend and Slint UI components
  • Modular separation between UI (Slint files) and core logic (Rust)
  • Event-driven communication via message passing
🔩 Code Quality
  • Consistent Rust idioms, leveraging ownership and concurrency features
  • Clear separation of concerns
  • Use of Cargo for dependency management and build
📄 Documentation
  • Basic README with project overview
  • Configuration details in Cargo.toml and Cargo.lock
  • UI layouts defined in .slint files
🔌 Integrations
  • UI built with Slint, integrated into Rust via slint crate
  • Input handling with rdev for event capture
  • Build and package managed via Cargo
🧩 Modularity
  • UI components separated into individual .slint files (app.slint, player.slint, board.slint, etc.)
  • Core game logic encapsulated in Rust modules
🧪 Testing
  • Limited info, likely unit tests in Rust (cargo test)
  • UI tests not explicitly documented
⚡️ Performance
  • Rust's ownership model ensures minimal runtime overhead
  • UI rendering optimized via Slint's efficient rendering engine
🛡️ Security
  • Rust's safety guarantees prevent common bugs
  • No explicit security features documented
📦 Dependencies
  • Core dependencies include slint, rust, rdev
  • UI components in .slint files, managed via Cargo

Project Structure

└── checkers/
    ├── Cargo.lock
    ├── Cargo.toml
    ├── build.rs
    ├── src
    │   ├── game
    │   └── main.rs
    └── ui
        ├── app.slint
        ├── assets
        ├── board.slint
        ├── config.slint
        ├── game.slint
        ├── lobby.slint
        ├── player.slint
        └── structs.slint

Project Index

CHECKERS/
__root__
⦿ __root__
File Name Summary
Cargo.toml - Defines project metadata and dependencies for the checkers application, establishing core configurations and external libraries needed for cross-platform GUI development and input handling
- Serves as the foundation for building and managing the applications structure, ensuring proper setup of tools and resources essential for the overall architecture.
build.rs - Facilitates the build process by compiling the Slint UI definition into executable code, ensuring the user interface is integrated into the application
- It manages dependencies between source files and triggers recompilation when UI files change, supporting seamless updates and efficient development within the overall project architecture.
src
⦿ src
File Name Summary
main.rs - Orchestrates the applications user interface and state transitions, managing the flow between lobby and game views
- Facilitates user interactions such as starting a game, making moves, and quitting, while synchronizing game state with the UI
- Serves as the central controller that integrates UI components with core game logic within the overall architecture.
game
⦿ src.game
File Name Summary
types.rs - Defines core data structures and enums for managing game state, player interactions, and board representation in a checkers game
- Facilitates game flow control, move application, and UI state synchronization, ensuring seamless integration between game logic and user interface within the overall architecture
- Supports game progression, player turns, and move validation across the codebase.
mod.rs - Defines the core modular structure of the game, organizing key components such as the game board, player interactions, game rules, and user interface types
- It serves as the central hub that integrates various aspects of the game, facilitating seamless interaction and coordination among different modules to support the overall game architecture.
navigation.rs - Defines the navigation logic for managing different views within the game, primarily focusing on initializing and transitioning between the lobby and other views
- Facilitates seamless view state management, ensuring the game can accurately track and switch user interfaces during gameplay
- Serves as a core component for maintaining consistent user experience across the applications navigation flow.
player.rs - Defines the Player entity within the game architecture, encapsulating player identity, assigned side, and captured pieces
- Facilitates tracking each players progress and status, including capturing game pieces and determining the winner
- Serves as a core component for managing player state and interactions, supporting game flow and outcome evaluation within the overall system.
rules.rs - Defines core move logic for a checkers game, including move generation, capturing rules, and forced move states
- Facilitates gameplay by determining valid slides and jumps based on piece type and position, ensuring adherence to game rules and capturing mechanics within the overall game architecture.
ui_types.rs - Defines data transformation and UI model mappings for the game interface, translating core game state and player data into UI-compatible formats
- Facilitates seamless synchronization between game logic and visual presentation, enabling dynamic updates of game elements such as the board, players, and game status within the user interface layer.
board.rs - Defines the game board structure for a checkers game, initializing an 8x8 grid with appropriately placed black and red pieces
- Provides functionality to access individual square states and to flatten the board into a linear representation, supporting game state management and move validation within the overall architecture.
play.rs - Defines core game logic for managing state, moves, and win conditions in a checkers game
- Handles player interactions, move validation, capturing, king promotion, turn switching, and game outcome determination, integrating with the UI for real-time updates
- Serves as the central engine orchestrating gameplay flow within the overall architecture.
ui
⦿ ui
File Name Summary
structs.slint - Defines core data structures and enumerations for the user interface, representing game states, player details, board positions, and view management
- Facilitates seamless communication between UI components and game logic, enabling dynamic rendering of game status, player actions, and visual updates within the overall architecture
- Ensures consistent data handling across the applications visual and interactive layers.
app.slint - Defines the main user interface window for the Checkers game, orchestrating view transitions between lobby and gameplay
- Manages layout, sizing, and user interactions such as starting a game, making moves, quitting, or returning to the lobby
- Serves as the central component connecting visual elements with game logic within the overall application architecture.
config.slint - Defines visual assets, themes, and color schemes to establish a consistent and customizable user interface for the application
- Facilitates centralized management of images and styling properties, ensuring cohesive appearance and easier updates across the entire UI architecture
- Supports the overall design system by providing reusable visual elements and theme configurations.
player.slint - Defines a visual component for displaying a players status and captured pieces within the game interface
- It visually presents the players name and a grid of captured game pieces, dynamically updating based on game state and turn
- Integrates seamlessly into the overall UI architecture, supporting real-time updates and consistent styling across the application.
game.slint - Defines the core user interface for the game, orchestrating layout, player interactions, and pause menu functionality
- Facilitates seamless gameplay experience by managing player input, rendering game components, and handling state transitions such as pausing, returning to lobby, or quitting
- Serves as the visual and interactive foundation within the overall architecture, connecting user actions to game logic.
lobby.slint - Defines the lobby interface for the application, providing users with options to start a new game or quit
- It displays the logo prominently and includes interactive buttons with hover effects, facilitating navigation within the apps user experience
- This component integrates visual branding with core user actions, forming a key entry point in the overall architecture.
board.slint - Defines the visual and interactive layout of an 8x8 game board, managing the rendering of tiles, highlighting selectable and selected positions, and displaying game pieces based on the current game state
- Facilitates user interactions by detecting clicks on tiles to trigger player moves, integrating seamlessly with the overall game logic and state management.

Getting Started

Prerequisites

This project requires the following dependencies:

  • Programming Language: Rust
  • Package Manager: Cargo

Installation

Build checkers from the source and install dependencies:

  1. Clone the repository:

    ❯ git clone https://github.com/Cody-will/checkers
  2. Navigate to the project directory:

    ❯ cd checkers
  3. Install the dependencies:

Using cargo:

❯ cargo build

Usage

Run the project with:

Using cargo:

cargo run

Testing

Checkers uses the {test_framework} test framework. Run the test suite with:

Using cargo:

cargo test


About

Some(checkers) - a checkers game built in rust. Because why not?

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages