### Install Fantas with pip Source: https://github.com/fantastair/fantasv3/blob/master/docs/source/index.rst Install the Fantas library using pip. This is the recommended way to get started. ```bash pip install fantas ``` -------------------------------- ### Fantas Quick Start Example Source: https://github.com/fantastair/fantasv3/blob/master/docs/source/index.rst A basic example demonstrating how to initialize Fantas and create a window. This is a good starting point for new users. ```python import fantas # Initialize Fantas fantas.init() # Create a window screen = fantas.display.set_mode((800, 600)) fantas.display.set_caption("Fantas Quick Start") # Game loop running = True while running: for event in fantas.event.get(): if event.type == fantas.QUIT: running = False # Fill the screen with white screen.fill((255, 255, 255)) # Update the display fantas.display.flip() # Quit Fantas fantas.quit() ``` -------------------------------- ### Fantas Quick Start Animation Example Source: https://github.com/fantastair/fantasv3/blob/master/docs/source/index.rst An example showing how to create a simple animation using Fantas. This builds upon the basic setup to introduce movement. ```python import fantas # Initialize Fantas fantas.init() # Create a window screen = fantas.display.set_mode((800, 600)) fantas.display.set_caption("Fantas Animation") # Load an image (replace 'player.png' with your image file) try: player_img = fantas.image.load("player.png") except fantas.error as e: print(f"Error loading image: {e}") # Create a placeholder surface if image loading fails player_img = fantas.Surface((50, 50)) player_img.fill((0, 128, 255)) # Blue color player_rect = player_img.get_rect(center=(400, 300)) # Animation variables x_speed = 5 y_speed = 5 # Game loop running = True while running: for event in fantas.event.get(): if event.type == fantas.QUIT: running = False # Move the player player_rect.x += x_speed player_rect.y += y_speed # Bounce off the edges if player_rect.left < 0 or player_rect.right > 800: x_speed = -x_speed if player_rect.top < 0 or player_rect.bottom > 600: y_speed = -y_speed # Fill the screen with white screen.fill((255, 255, 255)) # Draw the player screen.blit(player_img, player_rect) # Update the display fantas.display.flip() # Quit Fantas fantas.quit() ``` -------------------------------- ### Clone Fantas Repository Source: https://github.com/fantastair/fantasv3/blob/master/docs/source/index.rst Clone the Fantas source code repository from GitHub. This is necessary for development or building from source. ```bash git clone https://github.com/Fantastair/FantasV3.git ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.