Giter VIP home page Giter VIP logo

defold-hyper-trails's Introduction

Hyper Trails Logo

Latest Release

Hyper Trails

Easy to use and customizable trail effect for the Defold game engine.

To draw a trail, Hyper Trails asset creates a buffer, sets the buffer to a mesh, updates the buffer on every frame update.

โš ๏ธ Requires Defold 1.4.3 and newer.

Feel free to ask questions: the topic about this asset is on the Defold forum.

Installation

You can use Hyper Trails in your own project by adding this project as a Defold library dependency. Open your game.project file and add the links in the dependencies field under project:

Usage

Using it in your 2D game is simple:

  1. Add the components /hyper_trails/trail_maker.script and /hyper_trails/models/trail_mesh.mesh to your game object.
  2. Run your game and move the game object. Enjoy!

Example App

See the demo game.project for examples of how to use Hyper Trails on its own.

๐Ÿ•น๏ธ View the demo online ๐Ÿ•น๏ธ

Settings

Terminology

trail_maker.script's options:

  • use_world_position (boolean) - Calculate object movement delta using go.get_position or go.get_world_position.
  • trail_width (number)
  • trail_tint_color (vector4)
  • segment_length_max (number)
  • segment_length_min (number)
  • points_count (number) - any number.
  • points_limit (number) - Set 0 to use all points (deprecated).
  • fade_tail_alpha (number)
  • shrink_tail_width (boolean)
  • shrink_length_per_sec (number)
  • texture_tiling (boolean)
  • trail_model_url (url)
  • auto_update (boolean) - Uncheck this and send the update message to the script instance to manually update the trail.

Change mesh's texture0 to draw custom texture on the trail.

Known Issues

Trail Position Lag

Defold now has such the update order so a trail head position will always be lagging behind for:

  1. Physics-based objects (see the picture below).
  2. Objects animated using go.animate().

Physics Update Order Problem

Tip: You can disable the Auto Update property for the trail maker instance and check the demo/demo_physics.script how to manually send update message to the trail maker script.

Note: vote for [defold/defold#7277 issue).

Credits

Artsiom Trubchyk (@aglitchman) is the current Hyper Trails owner within Indiesoft and is responsible for the open source repository.

Contributors

  • Dmitry Korolev (@KorolevSoftware) - rewrote the asset to use buffers and to create buffer resources dynamically in runtime.
  • @vbif1 - various bug fixes.

License

MIT License.

defold-hyper-trails's People

Contributors

aglitchman avatar korolevsoftware avatar vbif1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

defold-hyper-trails's Issues

Trail resets for factory-created game objects

I have a game object with the trail_maker.script and trail_model. Instances of this object are created via a factory. This results in what I can only describe as a reset for all objects created by the factory:

trails.mov

Notice how the trail behaves upon object creation. How can I prevent this reset from occurring?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.