class Phase::HealthObj

Direct Known Subclasses

Defined in:

phase/health_obj.cr

Constant Summary

CollisionDamage = 1
DebugHitBox = false
HitColor = SF::Color::Red
HitRadius = 64
HitSound = SF::SoundBuffer.from_file("./assets/hit.wav")
MaxHealth = 100
UnhitColor = SF::Color::White

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

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

[View source]

Class Method Detail

def self.collision_damage #

[View source]
def self.hit_radius #

[View source]
def self.max_health #

[View source]
def self.unhit_color #

[View source]

Instance Method Detail

def bump(dx, dy, bumped_by, objs) #

[View source]
def bumped? : Bool #

[View source]
def collision_damage #

[View source]
def distance(cx, cy, radius = 0) #

[View source]
def distance(obj : HealthObj) #

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

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

[View source]
def health : Int32 #

[View source]
def health_color #

[View source]
def hit(damage : Int32) #

[View source]
def hit?(circle : Circle) #

[View source]
def hit? : Bool #

[View source]
def hit_circle #

[View source]
def hit_radius #

[View source]
def hit_sound : SF::Sound #

[View source]
def max_health #

[View source]
def move(dx : Float64, dy : Float64) #

[View source]
def remove? : Bool #

[View source]
def reset_hit_bumped #

[View source]
def rotation_from(other_x, other_y) #

[View source]
def rotation_from(obj : HealthObj) #

[View source]
def rotation_to(other_x, other_y) #

[View source]
def rotation_to(obj : HealthObj) #

[View source]
def static? #

[View source]
def unhit_color #

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

[View source]
def x : Float64 #

[View source]
def y : Float64 #

[View source]