class Snake::World

Defined in:

snake/world.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(width : Int16, height : Int16) #

[View source]

Instance Method Detail

def add(item : Snake::Player) #

[View source]
def add(item : Snake::Apple) #

[View source]
def apples : Array(Snake::Apple) #

[View source]
def height : Int16 #

[View source]
def map : Array(Array(Player | Tail | Apple | Nil)) #

[View source]
def move(player : Snake::Player) #

[View source]
def players : Array(Snake::Player) #

[View source]
def remove(player : Snake::Player) #

[View source]
def remove(apple : Snake::Apple) #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def update #

[View source]
def width : Int16 #

[View source]