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)
SourceInstance methods
add_animation(sheet, animations, name, frames, loops = true, flip_horizontal = false)
Sourceanimations
Sourceanimations_flame
Sourcecollision_radius
Sourcecollision_x
Sourcecollision_y
Sourcecx
Sourcecy
Sourcedead?
Sourcedeath_timer
Sourcedie!
Sourcedraw(window : SF::RenderWindow)
Sourcedraw_circle_from_torch(window, radius, color)
Sourcedraw_flame(window)
Sourcedraw_health(window)
Sourcedraw_monster_follow_radius(window : SF::RenderWindow)
Sourcedraw_monster_radius(window : SF::RenderWindow)
Sourcedraw_player_borders(window)
Sourcedraw_torch_visibility(window : SF::RenderWindow)
Sourcehealth
Sourceinit
Sourceinit_animations
Sourcejump_to_tile(row, col)
Sourcemonster_follow_radius
Sourcemonster_radius
Sourcemove(dx, dy)
Sourceplay_animations
Sourcereset
Sourcesize
Sourcespeed
Sourcetorch_cx
Sourcetorch_cy
Sourcetorch_left_percent
Sourcetorch_out?
Sourcetorch_refill!
Sourceupdate(frame_time, keys : Keys, joysticks : Joysticks, level_width, level_height, collidable_tiles : Tiles)
Sourceupdate_movement_dx_input(keys, joysticks)
Sourceupdate_movement_dy_input(keys, joysticks)
Sourceupdate_torch_segements
Sourcevisibility_radius
Source