class Escapist::LaserBlock

Defined in:

escapist/laser_block.cr

Constant Summary

Key = "laser"
LaserBarrelColor = SF::Color.new(153, 0, 0, 51)
LaserBarrelColorFilled = SF::Color.new(51, 51, 51)
LaserBarrelOutlineColor = SF::Color.new(153, 0, 0, 153)
LaserBarrelOutlineThickness = 3
LaserCenterColor = SF::Color.new(153, 0, 0, 153)
LaserCenterOutlineColor = SF::Color.new(102, 0, 0, 102)
LaserCenterOutlineThickness = 2
LaserCenterWidth = 4
LaserColor = SF::Color.new(102, 0, 0, 102)
LaserOutlineColor = SF::Color.new(153, 0, 0, 51)
LaserOutlineThickness = 4
LaserWidth = 16
RotatableIndicatorOutlineColor = SF::Color.new(153, 0, 0, 153)
RotatableIndicatorOutlineThickness = 6
RotationAmount = 45
RotationSpeed = 90

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Escapist::MovableBlock

draw(window : SF::RenderWindow) draw, draw_icon(window) draw_icon, draw_movable(window : SF::RenderWindow) draw_movable, dx : Float32 | Int32 dx, dy : Float32 | Int32 dy, movable? movable?, move(dx : Float32 | Int32, dy : Float32 | Int32) move, x x, y y

Constructor methods inherited from class Escapist::MovableBlock

new(pull : JSON::PullParser)
new(col = 0, row = 0)
new

Class methods inherited from class Escapist::MovableBlock

key key

Instance methods inherited from class Escapist::BaseBlock

block : String block, block=(block : String) block=, collidable? collidable?, draw(window : SF::RenderWindow) draw

Constructor methods inherited from class Escapist::BaseBlock

new(pull : JSON::PullParser)
new(block : String, col = 0, row = 0)
new

Class methods inherited from class Escapist::BaseBlock

key key

Instance methods inherited from class Escapist::TileObj

area? area?, area_box area_box, area_entered area_entered, area_entered? area_entered?, area_exited area_exited, col : Int32 col, collidable? collidable?, collision_box collision_box, draw(window : SF::RenderWindow) draw, draw_offset draw_offset, draw_size draw_size, jump_to(col : Int32, row : Int32) jump_to, key key, movable? movable?, move(dx : Float32 | Int32, dy : Float32 | Int32) move, row : Int32 row, size size, type : String type, type=(type : String) type=, x x, y y

Constructor methods inherited from class Escapist::TileObj

new(pull : JSON::PullParser)
new(type : String = "block", col : Int32 = 0, row : Int32 = 0)
new(*, __pull_for_json_serializable pull : JSON::PullParser)
new

Class methods inherited from class Escapist::TileObj

cells_near(x, y) cells_near, draw_size draw_size, key key

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(col = 0, row = 0) #

[View source]

Class Method Detail

def self.key #

[View source]

Instance Method Detail

def area? #

[View source]
def area_box #

[View source]
def area_entered #

[View source]
def area_entered? : Bool #

[View source]
def area_exited #

[View source]
def cast_ray(start_point, direction, room) #

[View source]
def done_rotating? #

[View source]
def draw_laser(window, laser) #

[View source]
def draw_laser_barrel(window) #

[View source]
def draw_lasers(window) #

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

[View source]
def draw_rotatable_indicator(window) #

[View source]
def laser_switch_collision?(laser_switch : LaserSwitch, x, y, distance) #

[View source]
def laser_switch_found?(row, col, room, x, y, distance) #

[View source]
def lasers : Array(LaserInfo) #

[View source]
def rotatable? #

[View source]
def rotate(direction : Int32 = 1) #

[View source]
def rotate_reverse #

[View source]
def rotating? : Bool #

[View source]
def rotation_angle : Float32 | Int32 #

[View source]
def tile_found?(row, col, room) #

[View source]
def update(frame_time, room) #

[View source]
def update_laser_distance(room) #

[View source]
def update_rotation(frame_time) #

[View source]