class Cards::Card

Included Modules

Defined in:

cards/card.cr

Constant Summary

DROP_SHADOW = 1
HEIGHT = 88
HEIGHT_DEPTH = 0.666_f32
MARGIN = 10
MOVEMENT_FRAMES = 16
WIDTH = 64

bicycle card size in mm from https://en.wikipedia.org/wiki/Standard_52-card_deck#Size_of_the_cards

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(rank : Cards::Rank, suit : Cards::Suit, flipped : Bool = true, position : Game::Vector = Game::Vector.new) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Class Method Detail

def self.height #

[View source]
def self.height_depth #

[View source]
def self.margin #

[View source]
def self.width #

[View source]

Instance Method Detail

def clone : Card #

[View source]
def draw(deck, screen_x = 0, screen_y = 0) #

[View source]
def draw_shadow(screen_x, screen_y) #

[View source]
def flip #

[View source]
def flipped=(flipped : Bool) #

[View source]
def flipped? : Bool #

[View source]
def height #

[View source]
def height_depth #

[View source]
def mouse_in? #

[View source]
def move(move_to : Game::Vector, frames = MOVEMENT_FRAMES) #

[View source]
def moved? #

[View source]
def moving? #

[View source]
def name #

[View source]
def position : Game::Vector #

[View source]
def position=(position : Game::Vector) #

[View source]
def rank : Rank #

[View source]
def rank=(rank : Rank) #

[View source]
def short_name #

[View source]
def suit : Suit #

[View source]
def suit=(suit : Suit) #

[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def update(frame_time) #

[View source]
def width #

methods for width/height in case of changing to instance vars later


[View source]
def x(*args, **options) #

[View source]
def x(*args, **options, &) #

[View source]
def x=(arg) #

[View source]
def y(*args, **options) #

[View source]
def y(*args, **options, &) #

[View source]
def y=(arg) #

[View source]