class Phase::Ship

Defined in:

phase/ship.cr

Constant Summary

BumpBackFactor = 3
FireDuration = 150.milliseconds
FireSound = SF::SoundBuffer.from_file("./assets/pew.wav")
HitRadius = 64
Sheet = "./assets/ship.png"
ShipSize = 128
Speed = 666
SuperWeaponDuration = 10.seconds
ThrusterSheet = "./assets/thruster.png"
ThrusterSize = 64

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) #

[View source]

Class Method Detail

def self.hit_radius #

[View source]
def self.size #

[View source]

Instance Method Detail

def animations : GSF::Animations #

[View source]
def beam : Beam #

[View source]
def cannon : Cannon #

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

[View source]
def fire(mouse_rotation : Float64) #

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

[View source]
def fire_timer : Timer #

[View source]
def laser : Laser | Nil #

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

[View source]
def next_super_weapon #

[View source]
def play_thruster(dir : Symbol) #

[View source]
def prev_super_weapon #

[View source]
def pulse : Pulse #

[View source]
def reset_thrusters #

[View source]
def size #

[View source]
def super_weapon : SuperWeapon #

[View source]
def super_weapon_timer : Timer #

[View source]
def super_weapons : Array(SuperWeapon) #

[View source]
def thrusters : ThrusterAnimationsTuple #

[View source]
def update(frame_time, keys : Keys, mouse : Mouse, objs : Array(HealthObj)) #

[View source]
def update_cannon(frame_time, mouse : Mouse, mouse_rotation : Float64, objs : Array(HealthObj)) #

[View source]
def update_firing(mouse : Mouse, mouse_rotation : Float64) #

[View source]
def update_movement(frame_time, keys : Keys, objs : Array(HealthObj)) #

[View source]
def update_super_weapon(frame_time, keys : Keys, mouse : Mouse, mouse_rotation : Float64, objs : Array(HealthObj)) #

[View source]