Skip to content

Frequently Asked Questions

General

What is the Retro Game Engine?

The Retro Game Engine is a Python-based 2D game engine built on top of Pygame, designed for creating retro-style games with modern development practices.

What Python versions are supported?

The engine supports Python 3.9 and above.

Technical Questions

How do I handle input in my game?

from retro_game_engine import Input, Key

# Check for keyboard input
if Input.is_key_pressed(Key.SPACE):
    player.jump()

# Check for continuous input
if Input.is_key_down(Key.RIGHT):
    player.move_right()

How do I play audio?

from retro_game_engine import AudioManager

# Load and play a sound
audio_manager = AudioManager()
audio_manager.load_sound("jump", "assets/jump.wav")
audio_manager.play_sound("jump")

How do I create a new scene?

from retro_game_engine import Scene

class GameScene(Scene):
    def __init__(self):
        super().__init__()

    def update(self, dt: float):
        # Update game logic here
        pass

    def render(self):
        # Render game objects here
        pass

How do I manage game states?

Use the SceneManager to handle different game states:

from retro_game_engine import SceneManager

scene_manager = SceneManager()
scene_manager.register_scene("menu", MenuScene)
scene_manager.register_scene("game", GameScene)
scene_manager.push_scene("menu")

Performance

How do I optimize my game?

  1. Use sprite batching for rendering multiple sprites
  2. Implement object pooling for frequently created/destroyed objects
  3. Use the physics system's spatial partitioning
  4. Keep the update loop efficient

Use the built-in TileMap system which includes: - Efficient rendering with culling - Collision detection optimization - Layer support - TMX file format support

Troubleshooting

Why isn't my game running at the target FPS?

  1. Check if you're doing too much work in the update loop
  2. Verify that your assets are optimized
  3. Use the performance metrics to identify bottlenecks:
    game_loop = GameLoop(update, render)
    print(f"FPS: {game_loop._metrics.fps}")
    print(f"Frame Time: {game_loop._metrics.frame_time}ms")
    

How do I debug collision issues?

  1. Enable debug rendering for colliders
  2. Check collision layers and masks
  3. Verify object positions and sizes
  4. Use the physics debug tools

Contributing

How can I contribute to the engine?

  1. Check our GitHub Issues
  2. Read our Contributing Guide
  3. Submit a Pull Request

How do I report a bug?

  1. Check if the bug is already reported
  2. Include a minimal reproducible example
  3. Provide system information and engine version
  4. Submit an issue on GitHub