class Snake::Player

Defined in:

snake/player.cr

Constant Summary

DIRECTION_SPEED = {Directions::Up => VERT_DELAY, Directions::Down => VERT_DELAY, Directions::Right => HORIZONTAL_DELAY, Directions::Left => HORIZONTAL_DELAY}
HORIZONTAL_DELAY = 0.01
VERT_DELAY = HORIZONTAL_DELAY * 3

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

def can_change?(direction) #

[View source]
def chage_direction(direction : Snake::Coordinate) #

[View source]
def direction : Coordinate #

[View source]
def direction=(direction : Coordinate) #

[View source]
def grow_tail #

[View source]
def head : Coordinate #

[View source]
def head=(head : Coordinate) #

[View source]
def move : Nil #

[View source]
def tail : Array(Tail) #

[View source]
def tail=(tail : Array(Tail)) #

[View source]
def x : Int16 #

[View source]
def y : Int16 #

[View source]