class Phase::Enemy

Direct Known Subclasses

Defined in:

phase/enemy.cr

Constant Summary

BumpBackFactor = 3
FacingRotationThreshold = 0.1_f32
HitRadius = 64
RotationSpeed = 100
ScoreValue = 1
Sheet = "./assets/enemy.png"
SpriteSize = 128

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Phase::HealthObj

bump(dx, dy, bumped_by, objs) bump, bumped? : Bool bumped?, collision_damage collision_damage, distance(cx, cy, radius = 0)
distance(obj : HealthObj)
distance
, draw(window : SF::RenderWindow) draw, draw_hit_circle(window : SF::RenderWindow) draw_hit_circle, health : Int32 health, health_color health_color, hit(damage : Int32) hit, hit?(circle : Circle)
hit? : Bool
hit?
, hit_circle hit_circle, hit_radius hit_radius, hit_sound : SF::Sound hit_sound, max_health max_health, move(dx : Float64, dy : Float64) move, remove? : Bool remove?, reset_hit_bumped reset_hit_bumped, rotation_from(other_x, other_y)
rotation_from(obj : HealthObj)
rotation_from
, rotation_to(other_x, other_y)
rotation_to(obj : HealthObj)
rotation_to
, static? static?, unhit_color unhit_color, update(frame_time, objs : Array(HealthObj)) update, x : Float64 x, y : Float64 y

Constructor methods inherited from class Phase::HealthObj

new(x : Float64 = 0, y : Float64 = 0) new

Class methods inherited from class Phase::HealthObj

collision_damage collision_damage, hit_radius hit_radius, max_health max_health, unhit_color unhit_color

Constructor Detail

def self.new(x = 0, y = 0, rotation : Float32 = 0) #

[View source]

Class Method Detail

def self.hit_radius #

[View source]
def self.score_value #

[View source]
def self.sheet #

[View source]
def self.sprite_height #

[View source]
def self.sprite_width #

[View source]

Instance Method Detail

def animations : GSF::Animations #

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

[View source]
def facing?(target_rotation) #

[View source]
def move_forward(speed, objs : Array(HealthObj)) #

[View source]
def rotate(amount) #

[View source]
def rotate_towards(target_rotation, rotation_speed) #

[View source]
def rotation : Float32 #

[View source]
def score_value #

[View source]
def sheet #

[View source]
def sprite_height #

[View source]
def sprite_width #

[View source]
def update(frame_time, objs : Array(HealthObj)) #

[View source]