class Works::Player

Defined in:

works/player.cr

Constant Summary

AnimationIdleInterval = 10.seconds
BuildDistance = Cell.size.to_i * 10
MiningAmount = 1
MiningDistance = Cell.size.to_i * 4
MiningInterval = 500.milliseconds
ProgressBarHeight = 5 * Screen.scale_factor

HUD

StructRemovalDistance = Cell.size.to_i * 5
StructRemovalInterval = 1.seconds

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def animations : Works::Animations #

[View source]
def animations=(animations : Works::Animations) #

[View source]
def buildable?(cell : Cell) #

[View source]
def destroy #

[View source]
def distance(cell : Cell) #

[View source]
def draw(dx, dy) #

[View source]
def draw_action_progress(x, y) #

[View source]
def draw_inventory(x, y) #

[View source]
def draw_player_x #

[View source]
def draw_selection(dx, dy, color) #

[View source]
def draw_selections(x, y) #

[View source]
def height #

[View source]
def hide_struct_info #

[View source]
def idle_timer : Works::Timer #

[View source]
def init(sheet : LibAllegro::Bitmap) #

[View source]
def init_animations(sheet : LibAllegro::Bitmap) #

[View source]
def inventory : Works::Inventory #

[View source]
def minable?(cell : Cell) #

[View source]
def mining_timer : Works::Timer #

[View source]
def ore_hover : Tile::Ore::Base | Nil #

[View source]
def overlaps?(cell : Cell) #

[View source]
def removable?(cell : Cell) #

[View source]
def speed : Int32 #

[View source]
def speed=(speed : Int32) #

[View source]
def sprite_width #

[View source]
def struct_hover : Struct::Base | Nil #

[View source]
def struct_hud_shown #

[View source]
def struct_info : Struct::Base | Nil #

[View source]
def struct_removal_timer : Works::Timer #

[View source]
def update(keys : Keys, mouse : Mouse, map : Map) #

[View source]
def update_inventory(keys : Keys, mouse : Mouse, map : Map) #

[View source]
def update_mining(map : Map, mouse : Mouse, mouse_col, mouse_row) #

[View source]
def update_movement(keys : Keys) #

[View source]
def update_struct_info(mouse : Mouse) #

[View source]
def update_structs(map : Map, keys : Keys, mouse : Mouse, mouse_col, mouse_row) #

[View source]
def width #

[View source]
def x : Int32 #

[View source]
def x=(x : Int32) #

[View source]
def y : Int32 #

[View source]
def y=(y : Int32) #

[View source]