Class: CustomEasing

Inherits:
Metro::Easing show all
Defined in:
lib/templates/game/lib/custom_easing.rb

Overview

This custom easing is an exact copy of the ‘Ease In’ easing defined in Metro. It is present here as an example.

Class Method Summary collapse

Methods inherited from Metro::Easing

calculate, easing_for, easings, register

Class Method Details

.calculation(moment, start, change, interval) ⇒ Float



26
27
28
29
# File 'lib/templates/game/lib/custom_easing.rb', line 26

def self.calculation(moment,start,change,interval)
  # @note this is the exact same as the already defined Ease In
  change * (moment = moment / interval) * moment + start
end