struct Rosegold::ManualControl::Input

Overview

One normalized controller frame. Held flags replace earlier ones; taps and look deltas accumulate until the next tick consumes them.

Defined in:

rosegold/control/manual_control.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(forward : Bool = false, backward : Bool = false, left : Bool = false, right : Bool = false, jump : Bool = false, sneak : Bool = false, sprint : Bool = false, jump_tap : Bool = false, ice_road_toggle : Bool = false, attack : Bool = false, use : Bool = false, attack_taps : Int32 = 0, use_taps : Int32 = 0, yaw_delta : Float32 = 0_f32, pitch_delta : Float32 = 0_f32, hotbar : UInt8 | Nil = nil) #

[View source]

Class Method Detail

def self.bound_delta(value : Float32) : Float32 #

[View source]

Instance Method Detail

def attack? : Bool #

[View source]
def attack_taps : Int32 #

[View source]
def backward? : Bool #

[View source]
def forward? : Bool #

[View source]
def hotbar : UInt8 | Nil #

Hotbar slot 1 through 9.


[View source]
def ice_road_toggle? : Bool #

One-shot request to flip the ice-road state.


[View source]
def jump? : Bool #

[View source]
def jump_tap? : Bool #

One-tick jump press that #without_one_shots drops.


[View source]
def left? : Bool #

[View source]
def merge(newer : Input) : Input #

Combines this unconsumed frame with a newer one.


[View source]
def pitch_delta : Float32 #

[View source]
def right? : Bool #

[View source]
def sneak? : Bool #

[View source]
def sprint? : Bool #

[View source]
def use? : Bool #

[View source]
def use_taps : Int32 #

[View source]
def without_one_shots : Input #

[View source]
def yaw_delta : Float32 #

[View source]