Coder Social home page Coder Social logo

gd-rewind's Introduction

Godot Rewind Mechanic

Note

Experiment to implement rewind mechanic in Godot engine. It's all pretty messy right now. But the essentials for the rewind effect are rewind_system.gd and rewinder.gd.

alt text

Controls

movement - WASD

rewind - Shift

How it works

You basically record a limited amount of data, popping the oldest entry when you reach the maximum amount of recorded data.

This data, includes position and other rewindable data depending on the situation.

Implementation

The rewind effect is created by adding a plain Node as a child of the Node2D you want to be able to rewind and attach the rewinder.gd script to it. The rewinder.gd script records only the global_position of it's parent node (i.e. the Node you want to rewind).

You can however, extend the rewinder.gd script and override the __record() and __rewind(data) methods, to specify the data you want to record. An example of this is in player_rewinder.gd.

gd-rewind's People

Contributors

emelent avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

r2d2m

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.