class

MonsterMaze::Player

Inherits MonsterMaze::Movable < Reference < Object

Constants

AnimationDuration = 42
CollisionRadius = 24
CollisionXOffset = 24
CollisionYOffset = 96
DeadDarkenMin = 63
DeathAnimationDuration = 300.milliseconds
FramesFlamesIdle = 4
FramesIdle = 1
FramesRun = 12
MaxHealth = 100
MonsterFollowRadius = VisibilityRadius - 128
MonsterRadiusColor = SF::Color.new(255, 251, 0, 7)
MonsterRadiusMax = 256
MonsterRadiusMin = 64
Sheet = "./assets/sprites/player.png"
SheetFlamesIdle = "./assets/sprites/flames_idle.png"
SheetFlamesRun = "./assets/sprites/flames_run.png"
Size = 96
Speed = 352
SpriteHeight = 128
SpriteWidth = 96
TorchMaxAlpha = 32
TorchSegmentDuration = 5.seconds
TorchSegments = 8
TorchXOffset = 12
TorchYOffset = 16
VisibilityRadius = 512

Constructors

new(row = 0, col = 0)
Source

Instance methods

add_animation(sheet, animations, name, frames, loops = true, flip_horizontal = false)
Source
animations
Source
animations_flame
Source
collision_radius
Source
collision_x
Source
collision_y
Source
dead?
Source
death_timer
Source
die!
Source
draw(window : SF::RenderWindow)
Source
draw_circle_from_torch(window, radius, color)
Source
draw_flame(window)
Source
draw_health(window)
Source
draw_monster_follow_radius(window : SF::RenderWindow)
Source
draw_monster_radius(window : SF::RenderWindow)
Source
draw_player_borders(window)
Source
draw_torch_visibility(window : SF::RenderWindow)
Source
health
Source
init
Source
init_animations
Source
jump_to_tile(row, col)
Source
monster_follow_radius
Source
monster_radius
Source
move(dx, dy)
Source
play_animations
Source
reset
Source
size
Source
speed
Source
take_damage(damage : Int32)
Source
torch_cx
Source
torch_cy
Source
torch_left_percent
Source
torch_out?
Source
torch_refill!
Source
update(frame_time, keys : Keys, joysticks : Joysticks, level_width, level_height, collidable_tiles : Tiles)
Source
update_movement_dx_input(keys, joysticks)
Source
update_movement_dy_input(keys, joysticks)
Source
update_torch_segements
Source
visibility_radius
Source