Skip to content

PaoloMazzon/Astro

Repository files navigation

Astro Engine

Astro Engine is a game development framework that provides all the things you need to easily develop games. It uses the scripting language Wren for game logic, taking full advantage of the features that come with an embedded scripting language.

Example gif

example

Features

  • Intuitive API that utilizes Wren as its language
  • Manual and automatic resource management
  • Fast and very flexible cameras
  • Simple level and entity management
  • Complete API documentation
  • Load Tiled maps automatically

Getting Started

See Getting Started for a detailed breakdown, and check out the API Reference for everything else. In short, you need a Wren file the engine will use as an entry point and at least one level.

class Game is Level {
    construct new() { }
    
    create() {
        _x = 100
        _y = 100
    }
    
    pre_frame() { }

    update() {
        var speed = Engine.delta * 100
        _x = _x + Keyboard.keys_as_axis(Keyboard.KEY_A, Keyboard.KEY_D) * speed
        _y = _y + Keyboard.keys_as_axis(Keyboard.KEY_W, Keyboard.KEY_S) * speed

        Renderer.draw_sprite(Assets.spr_sprite, _x, _y)
        Renderer.draw_font(Assets.fnt_font, "The quick brown fox jumps over the lazy dog.", 0, 0)
    }

    destroy() { }
}

Detailed Feature List

Before a was brief highlight of features, this is more complete list (but not complete) of things you can expect Astro to be capable of.

  • Scripting is done in the Wren language
  • All Astro library files/classes are automatically imported in every file
  • Detailed error logs are printed to file and stdout
  • Automatic resource loading through the Asset Compiler
  • Automatically load sprite data from Aseprite
  • Optionally store game files in a game.pak file so you don't have to distribute multiple files/folders
  • Detailed 2D rendering including textures, sprites, fonts, basic shapes, and polygon loading
  • Create 2D textures and draw to them
  • Load and use SPIR-V shaders on 2D textures
  • Simple 3D rendering, can load and render 3D models
  • Powerful camera support for 2D and 3D cameras, supports up to 10 cameras at once
  • Detailed renderer and window support, allows control over
    • Blend mode
    • Render colour modifier
    • Window size/fullscreen
    • Rendering features like MSAA/filtering
    • Camera control
  • Detailed text rendering allowing the user to change colour/size/shakiness/etc of text in strings
  • Easily control engine-level things like framerate/delta/timestep through the engine interface
  • Load/play audio
  • Simple and very powerful keyboard, mouse, and gamepad support
  • Entity/level management
  • Automatically load Tiled maps into levels
  • Use tilesets for fast and simplified tileset rendering and collisions
  • Basic filesystem support through buffers, file, and inis
  • Hitboxes may be rectangles, circles, or convex polygons and you may check for collisions between any combination of them

Platforms

Astro is currently tested exclusively on Windows. Previous versions have been tested successfully on Ubuntu with virtually no issue, but OSX support is untested. Astro is built on top of Vulkan2D and Wren, Wren should be fine on basically any platform including game consoles because its bytecode-interpreted and not JIT, but Vulkan2D is not as permissive. It requires a platform that supports Vulkan 1.2, meaning on OSX it has to be built with MoltenVK and other platforms are more complicated. If anybody wishes to contribute on these fronts, please create a pull request.

TODO

In no particular order,

  • Better Tiled loader
  • Networking support
  • Quadtree-based collisions
  • Load hitboxes from json
  • External asset managing program to make jsons automatically
  • Per-character kerning for ttf support
  • Spatial audio
  • Move Util.wren to C side for optimization purposes