class MonsterMaze::Monster

Direct Known Subclasses

Defined in:

monster_maze/monster.cr

Constant Summary

AnimationFrames = 1
AttackSpeed = Speed * 3
CollisionRadius = 16
Damage = 5
EmptyString = ""
NextAttackDurationMax = 500
NextAttackDurationMin = 300
Speed = 256

Constructors

Instance Method Summary

Instance methods inherited from class MonsterMaze::Movable

collides?(dx, dy, box : Box, box_x, box_y)
collides?(dx, dy, circle : Circle, cx, cy)
collides?(circle : Circle, cx, cy)
collides?(dx, dy, movable : Movable)
collides?(movable : Movable)
collides?
, collision_circle : Circle collision_circle, collision_cx collision_cx, collision_cy collision_cy, collision_radius collision_radius, collision_x collision_x, collision_y collision_y, cx cx, cy cy, draw(window : SF::RenderWindow) draw, dx : Int32 | Float32 dx, dy : Int32 | Float32 dy, jump(x : Float32 | Int32, y : Float32 | Int32) jump, jump_to_tile(row, col) jump_to_tile, move(dx, dy) move, move_with_collidable_tiles(tiles) move_with_collidable_tiles, move_with_level(level_width, level_height) move_with_level, move_with_movables(movables) move_with_movables, moved? : Bool moved?, size size, speed speed, update_movement(frame_time, speed = speed, level_width = 0, level_height = 0, collidable_tiles = [] of TileData, movables = [] of Movable) update_movement, update_with_direction_and_speed(frame_time, speed) update_with_direction_and_speed, x : Int32 | Float32 x, y : Int32 | Float32 y

Constructor methods inherited from class MonsterMaze::Movable

new(row = 0, col = 0) new

Constructor Detail

def self.new(row = 0, col = 0) #

[View source]

Instance Method Detail

def add_animation(name, row, flip_horizontal = false, flip_vertical = false) #

[View source]
def animation_frames #

[View source]
def animations : GSF::Animations #

[View source]
def attack! #

[View source]
def attack_speed #

[View source]
def attacked? : Bool #

[View source]
def attacking? : Bool #

[View source]
def collision_radius #

[View source]
def damage #

[View source]
def draw(window : SF::RenderWindow) #

[View source]
def follow_player! #

[View source]
def follow_range?(player : Player) #

[View source]
def following? : Bool #

[View source]
def init_animations #

[View source]
def move_change_from_distance(p_value, value, p_dist, inner_threshold) #

[View source]
def move_towards(p_cx, p_cy, p_dist, inner_threshold) #

[View source]
def next_attack_timer : Timer #

[View source]
def play_animation #

[View source]
def ready_to_attack? #

[View source]
def speed #

[View source]
def sprite_sheet #

[View source]
def stop_attacking! #

[View source]
def update(frame_time) #

[View source]
def update_following(frame_time, p_cx, p_cy, p_dist, collidable_tiles, movables) #

[View source]