Skip to content

oussamabertiza39/game-sdl3

Repository files navigation

Bulltricker Game - SDL3 Compatible

A strategic board game built with SDL3.

SDL3 Compatibility

This game has been updated to be fully compatible with SDL3. The following changes were made:

Key SDL3 API Changes

  1. Window and Renderer Creation

    • SDL2: SDL_CreateWindow(title, x, y, w, h, flags)
    • SDL3: SDL_CreateWindow(title, w, h, flags)
    • SDL2: SDL_CreateRenderer(window, index, flags)
    • SDL3: SDL_CreateRenderer(window, name)
  2. Event Type Names

    • SDL_QUITSDL_EVENT_QUIT
    • SDL_MOUSEMOTIONSDL_EVENT_MOUSE_MOTION
    • SDL_MOUSEBUTTONDOWNSDL_EVENT_MOUSE_BUTTON_DOWN
    • SDL_KEYDOWNSDL_EVENT_KEY_DOWN
  3. Initialization

    • SDL3's SDL_Init() returns bool instead of int
    • Check with !SDL_Init(SDL_INIT_VIDEO) instead of SDL_Init(SDL_INIT_VIDEO) < 0
  4. Timing Functions

    • SDL_GetTicks() now returns Uint64 instead of Uint32
  5. Mutex and Condition Variables

    • API remains mostly the same: SDL_CreateMutex(), SDL_DestroyMutex(), etc.
    • SDL_CreateCondition() and SDL_DestroyCondition() are used

Bug Fixes

  • Fixed array indexing bug in gui.c where *current_allowed_piece was used instead of current_allowed_piece[i]
  • Improved click handling to allow re-selecting pieces
  • Added audio feedback for moves and selections

Building

Linux / macOS

make

Windows (MinGW)

make

Or use your preferred build system with the provided source files.

Requirements

  • SDL3
  • SDL3_net
  • SDL3_image (optional)
  • SDL3_ttf (optional)
  • C11 compatible compiler

Running

./bulltricker

Or on Windows:

bulltricker.exe

Controls

  • Mouse: Click to select and move pieces
  • R: Rotate board
  • U: Undo last move
  • N: New game
  • ESC: Quit

Game Rules

Bulltricker is a strategic board game with unique pieces:

  • Pawns: Move diagonally forward
  • Queens: Can move diagonally in multiple directions
  • Kings: Special pieces that must be captured to win

Directory Structure

Bulltricker_Data/
  ├── Logs/       - Game logs
  ├── Saves/      - Save files
  ├── Sprites/    - Game graphics
  ├── Sounds/     - Sound effects
  └── Fonts/      - Font files

Development

Source Files

  • main.c - Entry point and main game loop
  • init.c - Initialization and board setup
  • gui.c - Graphics and user interface
  • move.c - Game logic and move validation
  • utilities.c - Helper functions
  • thread.c - Threading and synchronization
  • client.c / server.c - Networking (for multiplayer)

Headers

  • init.h - Initialization functions
  • gui.h - GUI functions
  • move.h - Move validation
  • utilities.h - Utility functions
  • thread.h - Threading
  • client.h / server.h - Networking
  • net.h - Network protocol
  • config.h - Configuration

License

[Add your license information here]

Credits

Developed with SDL3 for cross-platform compatibility.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors