class MonsterMaze::Player
- MonsterMaze::Player
- MonsterMaze::Movable
- Reference
- Object
Defined in:
monster_maze/player.crConstant Summary
-
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
Instance Method Summary
- #add_animation(sheet, animations, name, frames, loops = true, flip_horizontal = false)
- #animations : GSF::Animations
- #animations_flame : GSF::Animations
- #collision_radius
- #collision_x
- #collision_y
- #cx
- #cy
- #dead? : Bool
- #death_timer : Timer
- #die!
- #draw(window : SF::RenderWindow)
- #draw_circle_from_torch(window, radius, color)
- #draw_flame(window)
- #draw_health(window)
- #draw_monster_follow_radius(window : SF::RenderWindow)
- #draw_monster_radius(window : SF::RenderWindow)
- #draw_player_borders(window)
- #draw_torch_visibility(window : SF::RenderWindow)
- #health : Int32
- #init
- #init_animations
- #jump_to_tile(row, col)
- #monster_follow_radius
- #monster_radius
- #move(dx, dy)
- #play_animations
- #reset
- #size
- #speed
- #take_damage(damage : Int32)
- #torch_cx
- #torch_cy
- #torch_left_percent
- #torch_out?
- #torch_refill!
- #update(frame_time, keys : Keys, joysticks : Joysticks, level_width, level_height, collidable_tiles : Tiles)
- #update_movement_dx_input(keys, joysticks)
- #update_movement_dy_input(keys, joysticks)
- #update_torch_segements
- #visibility_radius
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