Hand
The cards a player holds, fanned out along the bottom of the screen, with no code. It draws StartWith from its Deck as the game starts. Drag a card onto a PlayZone that takes it to play it, or click it and then the zone (a tap and a tap on a touch screen); dropped anywhere else it slides back. Hovering a card lifts it out of the fan. With the keys or a gamepad, left and right pick a card, the PickAction (Space, A) takes it up, left and right choose where it goes and the Pick Action again plays it; the CancelAction puts it back.
Part of the Cards module: Card games: cards (Card) drawn from decks (Deck) into hands (Hand) and played by dragging them onto play zones (PlayZone), shuffled, discarded and sliding between them; the Cards template, a duel against the computer made from a table of cards; and Create Deck, Create Play Zone and Create Card in the Entity menu.
Give it a TurnTaker naming its team and it’s played only on its team’s turn, each card played using one of the turn taker’s actions (with Actions set), and in a network game only by the players on that team (the Multiplayer’s Teams). With Hidden, only its own team sees its faces. Its mana is an item like any other (see Items): “Mana” a teammate picks up or a trigger gives goes into it, and a card’s Card.Price is paid from its team’s other items. Its Draw and Discard actions are there for a Trigger (draw a card as each turn starts, discard the hand as it ends), a wire or a script, and its Count output for a Counter or a Text. Untick Controllable (or Focus something else) and it ignores the mouse and keys.
Works with: Deck (the deck it draws from); PlayZone (where its cards are played); TurnTaker (its team: played on its team’s turn)
Takes the player’s input only while it has focus (its Controllable): its Focus action hands it the input and takes it from everything else the same player plays.
Draws itself (its entity draws at Order 5 unless it has a Sprite, whose order counts).
Changes how its entity is drawn (a tint, a shake or drawing it on top).
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
deck: text = null. The deck it draws from, by name. Empty draws from the scene’s first face-down deck. (Names an entity.) (Field: an entity’s name.)discardPile: text = null. The deck its Discard action puts its cards on, by name. Empty uses the scene’s first face-up deck. (Names an entity.) (Field: an entity’s name.)startWith: a whole number = 5. How many cards it draws as the game starts, dealt one after another. (Field: a number.)limit: a whole number = 10. The most cards it holds: once it has this many it draws no more. 0 is no limit. (Field: a number.)hidden: true or false = false. Shows its cards’ faces only to its own side (its Turn Taker’s): in a network game, players on other teams see their backs, and their machines aren’t even sent which cards they are; at one screen, a team the computer plays keeps its cards face down, and with several people taking turns, each hand is face down while it isn’t its team’s turn. (Field: on or off.)controllable: true or false = true. Untick it to have it ignore the mouse, keys and gamepad (its actions and scripts still work): another part of the scene has the player’s input. Its Focus action ticks it and unticks it on everything else the player plays. (Field: on or off.)hero: text = null. The entity whose Health is this side’s life, by name, e.g. “Blue Hero”: what its cards’ effects do to “Self”, and the other teams’ to “Opponent”. Empty: the hand itself if it has a Health, else the first entity with a Health and a Turn Taker on its team. (Names an entity.) (Field: an entity’s name.)
maxMana: a whole number = 0. The mana it fills up to as each of its team’s turns starts. Changing it while full keeps it full. 0 doesn’t refill. (Field: a number.)mana: a whole number = 0. Mana it has to pay its cards’ costs with: it fills up to MaxMana as each of its team’s turns starts. (Field: a number.)manaGrowth: a whole number = 0. How much MaxMana grows as each of its team’s turns starts, up to ManaLimit: 1 adds a crystal a turn. (Field: a number.)manaLimit: a whole number = 10. The most MaxMana grows to. (Only used when manaGrowth is set.) (Field: a number.)
Computer
Section titled “Computer”thinkTime: a number = 0.8. For the computer (a hand on one of its turn order’s Computer Teams): seconds it thinks before each play, the last part of it showing the card it’s about to play lifted out of its hand, so the player can follow. 0 plays at once. (Field: a number.)healBelow: a number = 0.5. For the computer: the share of its hero’s health below which it plays its healing, e.g. 0.5 for under half. It keeps healing cards until then. (Field: a number.)keep: a whole number = 0. For the computer: how many cards it keeps in its hand for later rather than play. (Field: a number.)
spacing: a number = 1.15. How far apart its cards are, middle to middle, while there’s room. (Field: a number.)maxWidth: a number = 9. How wide it fans out at most: more cards than fit squeeze closer together. (Field: a number.)fan: a number = 4. Degrees each card is turned from the one beside it, fanning them out. 0 lines them up straight. (Field: a number.)arc: a number = 0.2. How far the cards at the ends sit below the middle one, so the fan curves. (Field: a number.)hoverRise: a number = 0.6. How far a card is lifted out of the fan while it’s under the mouse or picked. (Field: a number.)hoverScale: a number = 1.15. How much bigger a card is drawn while it’s lifted: 1.15 is 15% bigger. (Field: a number.)highlightColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#FFD84AFF”. The outline round the card picked, and the one the keys are on. (Field: a color.)slideTime: a number = 0.25. Seconds a card takes to slide into the hand. (Field: a number.)
Controls
Section titled “Controls”pickAction: text = “Jump”. The input action that takes up the card the keys are on, and plays it where they point: “Jump” is Space or the gamepad’s A. (Names an input action.) (Field: a name.)cancelAction: text = “Dash”. The input action that puts a card taken up back, as a right click does: “Dash” is Shift or the gamepad’s B. (Names an input action.) (Field: a name.)drawAction: text = “Interact”. The input action that draws a card from its deck (one with Click To Draw): “Interact” is E, Enter or the gamepad’s Y. (Names an input action.) (Field: a name.)
Sound and Messages
Section titled “Sound and Messages”pickSound: text = null. A sound played as a card is taken up, e.g. “Sounds/pick.wav”. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)drawMessage: text = null. A message sent as a card is drawn into it, with the card’s entity as its data. (Names a message.) (Field: a name.)
dealt: true or false = false. Set by the game once it has drawn its Start With, so a rewind doesn’t deal again. Leave it be. (Field: on or off.)toDraw: a whole number = 0. Cards still to draw, one a tenth of a second (Draw asks for them). Saved with the scene, so a rewind keeps them. (Field: a number.)said: text = null. What was last played from it, e.g. “Red plays Fireball on Blue Hero: 3 damage.”, or what one of its cards on the table did as its team’s turn began (“Wolf: 2 damage to Blue Hero.”). The game sets it. Read as the “Said” output. (Plain text: what was last played: the game sets it.) (Field: text.)
Actions
Section titled “Actions”What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).
Draw(done with a whole number, its count: a trigger’s with, 1 without one). Draws count cards from its deck, starting at the next frame, a tenth of a second apart.Discard. Puts every card in it on its discard pile at the start of the next frame.GainMana(done with a whole number, its amount: a trigger’s with, 1 without one). Gives it amount more mana to pay its cards’ costs with (less than 0 takes some away).Focus. Gives its entity the player’s input: whatever there and inside it has focus, and everything else the same player plays loses it (a platformer’s player stops on the arrow keys while a board takes them).
Outputs
Section titled “Outputs”What anything can read with no code: a Counter’s, Bar’s or Text’s output, a Contraptions Wire’s output as its signal; Text shows names too, the rest read numbers, true as 1.
Count(a whole number). How many cards are in it. Kept up to date by the game; in a network game, players’ machines are sent it.MaxMana(a whole number). The mana it fills up to as each of its team’s turns starts. Changing it while full keeps it full. 0 doesn’t refill.Mana(a whole number, out of its maxMana). Mana it has to pay its cards’ costs with: it fills up to MaxMana as each of its team’s turns starts.Said(a name). What was last played from it, e.g. “Red plays Fireball on Blue Hero: 3 damage.”, or what one of its cards on the table did as its team’s turn began (“Wolf: 2 damage to Blue Hero.”). The game sets it. Read as the “Said” output.
While the game runs
Section titled “While the game runs”Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.
team: text. Its team: its Turn Taker’s (on it or an entity it’s inside) or whatever else puts it on a team (see Teams), or empty with none. Hands on the same team are friends; on different teams, foes.side: text. What Team was called before every genre’s teams were one idea. Kept for scripts.picked: an entity with a Card: its name, id or path. The card this machine’s player has taken up from it (clicked, or with the keys), or null.count: a whole number. How many cards are in it. Kept up to date by the game; in a network game, players’ machines are sent it. (Sent in a network game.)
Scripts use it as Hand: its methods, events and values that aren’t saved with the scene.