Skip to content

Getting Started

jossse69 edited this page Jul 17, 2023 · 3 revisions

Getting Started with PETSCIITile Framework

Welcome to the PETSCIITile Framework! This guide will help you get started with using the framework to create your own tile-based games.

Installation

To use the PETSCIITile Framework in your projects, you'll need to have the following prerequisites installed:

  1. SFML: The framework utilizes SFML for graphics and window handling.

  2. .NET: PETSCIITile Framework is built using C# and requires .NET to run.

Once you have SFML and .NET set up, you can proceed with the installation of the framework.

Manual Installation

  1. Clone the PETSCIITile repository to your local machine using git clone https://github.com/jossse69/PETSCII-Tile.git.

  2. Reference the PETSCIITile library in your .NET project. You can do this by adding a project reference or by using a package manager like NuGet.

NuGet Package (Coming Soon)

We are working on publishing the PETSCIITile Framework as a NuGet package for easier integration with your projects. Stay tuned for updates on this!

Creating Your First Game

With the framework installed and set up, you can now create your first tile-based game. Here's a basic example of how to set up a simple game using the PETSCIITile Framework:

using PETSCIITile.Framework;

namespace MyTileGame
{
    class Program
    {
        static void Main()
        {
            // Initialize your game's map with tiles and entities
            Tile[,] map = InitializeMap();

            // Create the game object
            Game game = new Game(windowWidth: 800, windowHeight: 600, windowTitle: "My Tile Game", initialMap: map);

            // Run the game loop
            game.Run();
        }

        private static Tile[,] InitializeMap()
        {
            // Replace this method with your own map setup logic using the framework's Tile class
            // For simplicity, you can create a basic map manually or generate it procedurally.

            // Example: creating a 5x5 map with basic tiles
            Tile[,] map = new Tile[5, 5];

            for (int x = 0; x < 5; x++)
            {
                for (int y = 0; y < 5; y++)
                {
                    char asciiSymbol = 'X';
                    string graphicAssetPath = null; // Set this to your graphical asset path if using SFML sprites or textures
                    map[x, y] = new Tile(asciiSymbol, graphicAssetPath);
                }
            }

            return map;
        }
    }
}

Contributing

If you'd like to contribute to the PETSCIITile Framework, please read our Contribution Guidelines for more information on how to get involved.

License

PETSCIITile Framework is licensed under the MIT License.

We hope you enjoy using the PETSCIITile Framework and have fun creating your tile-based games!

Clone this wiki locally