class RPG::Player

Defined in:

rpg/player.cr

Constant Summary

AxisThreshold = 10

Constructors

Instance Method Summary

Instance methods inherited from class RPG::Character

add_animation(name, row, frames, fps_factor, loops, flip_horizontal = false) add_animation, animate_move(dx, dy) animate_move, animations : GSF::Animations animations, draw(window : SF::RenderWindow) draw, draw_shadow(window) draw_shadow, init_animations init_animations, move(dx, dy) move, shadow_sprite : SF::Sprite shadow_sprite, update(frame_time) update

Constructor methods inherited from class RPG::Character

new(x = 0, y = 0, dialog_key = "") new

Instance methods inherited from class RPG::Collidable

action action, area_radius area_radius, area_triggered? : Bool area_triggered?, check_area_triggered?(player : Player) check_area_triggered?, collision_height collision_height, collision_width collision_width, dialog_key : String dialog_key, draw(window : SF::RenderWindow) draw, jump(x : Float32 | Int32, y : Float32 | Int32) jump, jump_to_tile(col, row, tile_size) jump_to_tile, reset_area_triggered reset_area_triggered, size size, update(frame_time) update, x : Int32 | Float32 x, y : Int32 | Float32 y

Constructor methods inherited from class RPG::Collidable

new(x : Float32 | Int32 = 0, y : Float32 | Int32 = 0, dialog_key : String = "") new

Constructor Detail

def self.new(x = 0, y = 0) #

[View source]

Instance Method Detail

def bag : Bag #

[View source]
def change_direction #

[View source]
def collision(obj : Collidable) : Tuple(Bool, Bool) #

[View source]
def direction : Direction #

[View source]
def dx : Int32 | Float32 #

[View source]
def dy : Int32 | Float32 #

[View source]
def facing?(other_x, other_y) #

[View source]
def move_with_level(level_width, level_height) #

[View source]
def moved? : Bool #

[View source]
def update(frame_time, keys : Keys, joysticks : Joysticks, level_width, level_height) #

[View source]
def update_dx_with_direction_and_speed(frame_time) #

[View source]
def update_movement(frame_time, level_width, level_height) #

[View source]
def update_movement_dx_input(keys, joysticks) #

[View source]
def update_movement_dy_input(keys, joysticks) #

[View source]