game

package
v0.0.0-...-e981eed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	// contains filtered or unexported fields
}

Card contains the information of every card

func (*Card) FaceDown

func (card *Card) FaceDown(position sdl.FPoint, turned bool)

FaceDown Hides the card image and shows a card backsite image

func (*Card) FaceUp

func (card *Card) FaceUp(position sdl.FPoint, turned bool)

FaceUp shows the card image

func (*Card) GetCardInstance

func (card *Card) GetCardInstance() graphic.Instance

GetCardInstance Returns a copy of the card instance of the card

func (*Card) Hide

func (card *Card) Hide()

Hide makes the card invisible

func (*Card) SetCardInstance

func (card *Card) SetCardInstance(cardInstance *graphic.Instance)

SetCardInstance Setter for cardInstance

func (*Card) SetFaceDownInstance

func (card *Card) SetFaceDownInstance(faceDownInstance *graphic.Instance)

SetFaceDownInstance Setter for facedown instance

func (*Card) ZoomOnce

func (card *Card) ZoomOnce()

ZoomOnce to card resets zoom of card if it is zommed in then zooms in

type CardStack

type CardStack struct {
	Cards  []Card
	Place  sdl.Rect
	Center sdl.Point
}

CardStack contains info for a stack of cards

func (*CardStack) CreateRenderStack

func (cardStack *CardStack) CreateRenderStack() []graphic.Instance

CreateRenderStack list the cards and returns the card instances to render

func (*CardStack) Init

func (cardStack *CardStack) Init()

Init slice in card stack

type GameField

type GameField []PlayerField

GameField contains the playing field

type PlayerField

type PlayerField struct {
	Deck, ExtraDeck, Graveyard, BannedStack CardStack
	MonsterSlots, SpellZone                 [5]SingleCardSlot
	FieldSpell                              SingleCardSlot
}

PlayerField contains all the card slots for one player

type SingleCardSlot

type SingleCardSlot struct {
	Card   Card
	Place  sdl.Rect
	Center sdl.Point
}

SingleCardSlot contains position and Card

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL