<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Augment+reality</id>
	<title>Board Game Arena - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Augment+reality"/>
	<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/Special:Contributions/Augment_reality"/>
	<updated>2026-10-27T09:52:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpthenetworksprimetime&amp;diff=31922</id>
		<title>Gamehelpthenetworksprimetime</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpthenetworksprimetime&amp;diff=31922"/>
		<updated>2026-10-20T03:46:44Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;The Networks: PrimeTime&#039;&#039;&#039;, each player runs a television network for four rounds. You will sign Stars, land Ads, produce Shows, and arrange those Shows in your lineup to attract viewers while keeping your network solvent.&lt;br /&gt;
&lt;br /&gt;
Your final score is the total of your four round scores plus end-game bonuses. The player with the most viewers wins. Tied players share the victory.&lt;br /&gt;
&lt;br /&gt;
== The basic idea ==&lt;br /&gt;
&lt;br /&gt;
Your network has three main areas:&lt;br /&gt;
&lt;br /&gt;
* Your &#039;&#039;&#039;lineup&#039;&#039;&#039; contains one Show in each timeslot: Daytime, Primetime, and Late Night.&lt;br /&gt;
* Your &#039;&#039;&#039;green room&#039;&#039;&#039; holds Stars, Ads, and Network cards you have acquired but have not attached or used. There is no hand limit, and cards may remain there between rounds.&lt;br /&gt;
* Your &#039;&#039;&#039;reruns&#039;&#039;&#039; contain Shows that have been canceled. They score again at the end of the game.&lt;br /&gt;
&lt;br /&gt;
The shared &#039;&#039;&#039;market&#039;&#039;&#039; contains the Shows, Stars, Ads, and Network cards available to everyone. Cards taken from the market are not replaced during the round. A completely new market is dealt after the round ends.&lt;br /&gt;
&lt;br /&gt;
Only cards in your lineup count for normal round income, expenses, and viewers. Cards waiting in your green room do not.&lt;br /&gt;
&lt;br /&gt;
== Setup and Pilot Season ==&lt;br /&gt;
&lt;br /&gt;
BGA performs the physical setup automatically. Every player begins with three Starter Shows, one in each timeslot, and receives cash based on starting turn order.&lt;br /&gt;
&lt;br /&gt;
=== Normal Pilot Setup ===&lt;br /&gt;
&lt;br /&gt;
Each player is privately dealt four Pilot Season cards and keeps two.&lt;br /&gt;
&lt;br /&gt;
* Pay the costs of kept Stars and Shows.&lt;br /&gt;
* Gain the signing bonuses of kept Ads.&lt;br /&gt;
* Put kept Stars and Ads in your green room.&lt;br /&gt;
* Produce any kept Pilot Shows and place them in your lineup.&lt;br /&gt;
&lt;br /&gt;
Unchosen Pilot cards are removed from the game.&lt;br /&gt;
&lt;br /&gt;
=== Simplified Pilot Setup ===&lt;br /&gt;
&lt;br /&gt;
Each player receives two Pilot Stars and/or Ads and keeps both automatically. Pilot Shows are not used. This option is intended for a faster first game.&lt;br /&gt;
&lt;br /&gt;
== Playing a round ==&lt;br /&gt;
&lt;br /&gt;
Starting with the first player, players take one action at a time in turn order. A player who passes takes no more normal turns that round. The round ends after everyone has passed.&lt;br /&gt;
&lt;br /&gt;
On your turn, take &#039;&#039;&#039;one&#039;&#039;&#039; of the following actions.&lt;br /&gt;
&lt;br /&gt;
=== Sign a Star ===&lt;br /&gt;
&lt;br /&gt;
Choose a Star from the market, pay its signing cost, and put it in your green room. A Star cannot be attached immediately unless a card effect says otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Sign an Ad ===&lt;br /&gt;
&lt;br /&gt;
Choose an Ad from the market, immediately gain its signing bonus, and put it in your green room. Signing an Ad does not cost money.&lt;br /&gt;
&lt;br /&gt;
=== Take a Network card ===&lt;br /&gt;
&lt;br /&gt;
Choose a Network card from the market.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Immediate&#039;&#039;&#039; cards resolve at once.&lt;br /&gt;
* &#039;&#039;&#039;Use once&#039;&#039;&#039; cards stay in your green room until used, then are discarded or otherwise consumed as shown by BGA.&lt;br /&gt;
* &#039;&#039;&#039;Ongoing&#039;&#039;&#039; cards provide a continuing ability.&lt;br /&gt;
* &#039;&#039;&#039;Game End&#039;&#039;&#039; cards score during final scoring.&lt;br /&gt;
&lt;br /&gt;
Using an available Use Once Network card is a free action and does not replace your normal action. Follow the card text when it conflicts with a general rule.&lt;br /&gt;
&lt;br /&gt;
=== Produce a Show ===&lt;br /&gt;
&lt;br /&gt;
You cannot store an unproduced Show in your green room. When you take a Show from the market, you must be able to complete all of these steps:&lt;br /&gt;
&lt;br /&gt;
# Pay the Show&#039;s production cost.&lt;br /&gt;
# Attach Stars and Ads from your green room. Every coloured slot is required; grey slots are optional. You may fill any number of optional slots while producing the Show.&lt;br /&gt;
# Choose a timeslot in your lineup. Cancel the Show already there, if any, and put the new Show in its place.&lt;br /&gt;
# Place the Show&#039;s season marker. In a preferred timeslot it begins on the top row; outside a preferred timeslot it begins on the &#039;&#039;&#039;X&#039;&#039;&#039; row, shortening its useful life as well as reducing its early viewers.&lt;br /&gt;
# Advance one space on the matching genre track and immediately resolve any bonus reached.&lt;br /&gt;
&lt;br /&gt;
A half-Star/half-Ad slot can hold either type, but each slot holds only one card.&lt;br /&gt;
&lt;br /&gt;
=== Add or replace a Star or Ad ===&lt;br /&gt;
&lt;br /&gt;
Move &#039;&#039;&#039;one&#039;&#039;&#039; Star or Ad from your green room to a compatible slot on a Show in your lineup. You may instead replace an attached card with another card that can legally occupy that slot. The removed card is discarded; it does not return to your green room.&lt;br /&gt;
&lt;br /&gt;
When a Show has a wild slot, you may sometimes replace a Star with an Ad or vice versa, provided the final set of attachments still fits all of that Show&#039;s slots.&lt;br /&gt;
&lt;br /&gt;
=== Pass ===&lt;br /&gt;
&lt;br /&gt;
Take the leftmost available place on the pass track and choose its cash or viewer reward. Earlier pass positions offer better rewards. Cash is gained immediately; viewers are added to this round&#039;s score.&lt;br /&gt;
&lt;br /&gt;
Passing is permanent for the rest of the round. When only one player has not passed, that player may take as many consecutive actions as desired. When finished, that player passes into the last, cash-only space.&lt;br /&gt;
&lt;br /&gt;
== Shows, Stars, and Ads ==&lt;br /&gt;
&lt;br /&gt;
=== Seasons and timeslots ===&lt;br /&gt;
&lt;br /&gt;
Each Show&#039;s season marker indicates its current viewers. After round scoring, it moves down one row. If it moves beyond the bottom of the card, the Show is canceled.&lt;br /&gt;
&lt;br /&gt;
Most Shows have a preferred timeslot. Scheduling a Show elsewhere puts its season marker directly on the X row instead of its first row. Starter Shows have no preferred timeslot.&lt;br /&gt;
&lt;br /&gt;
=== Attachment conditions ===&lt;br /&gt;
&lt;br /&gt;
Some Stars and Ads have a condition, such as a genre, timeslot, or number of other attachments.&lt;br /&gt;
&lt;br /&gt;
* If the condition is met when the card is attached, attach it upright and use its normal values.&lt;br /&gt;
* If the condition is not met, rotate it and use its grey values.&lt;br /&gt;
* The card normally keeps that orientation even if the lineup later changes. Only a card effect can rotate it afterward.&lt;br /&gt;
&lt;br /&gt;
For a timeslot condition, use the timeslot the Show actually occupies, not the Show&#039;s preferred timeslot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Promo Ads&#039;&#039;&#039; are different: when attaching one, either pay its printed cost to keep it upright or attach it rotated. An upright Promo supplies viewers and income; a rotated Promo supplies only its rotated income.&lt;br /&gt;
&lt;br /&gt;
=== Canceling a Show ===&lt;br /&gt;
&lt;br /&gt;
When a Show is canceled:&lt;br /&gt;
&lt;br /&gt;
# Its season marker returns to your supply.&lt;br /&gt;
# All attached Stars and Ads are discarded unless an effect says otherwise.&lt;br /&gt;
# The Show goes faceup to your reruns.&lt;br /&gt;
&lt;br /&gt;
You may cancel a Show only when a rule or card effect tells you to do so, such as replacing it, aging it beyond its final season, or being unable to pay upkeep.&lt;br /&gt;
&lt;br /&gt;
== End of the round ==&lt;br /&gt;
&lt;br /&gt;
After everyone has passed, BGA resolves these steps in order.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Upkeep:&#039;&#039;&#039; Add all income in your lineup, then subtract all expenses in your lineup. Gain a positive difference or pay a negative difference.&lt;br /&gt;
# &#039;&#039;&#039;Score the lineup:&#039;&#039;&#039; Add the current viewers from your Shows and attached cards, plus pass-track viewers and other applicable bonuses.&lt;br /&gt;
# &#039;&#039;&#039;Age Shows:&#039;&#039;&#039; Move every season marker down one row. Cancel Shows whose markers move off their cards.&lt;br /&gt;
# &#039;&#039;&#039;Check genres:&#039;&#039;&#039; Any genre-track advances and bonuses from Shows produced this round are confirmed.&lt;br /&gt;
# &#039;&#039;&#039;Clear the pass track.&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Set next round&#039;s first player or turn order.&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Refresh the market:&#039;&#039;&#039; Discard all remaining market cards and deal a full new display.&lt;br /&gt;
&lt;br /&gt;
If you cannot afford upkeep, you must cancel a Show of your choice and recalculate. Continue until you can pay or have no Shows left. A Show canceled during upkeep scores no viewers that round because upkeep happens before scoring.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Forecast&#039;&#039;&#039; above your lineup shows what you would earn and score if the round ended now. It does not include choices that would happen only at round end.&lt;br /&gt;
&lt;br /&gt;
== Genre tracks ==&lt;br /&gt;
&lt;br /&gt;
Whenever you produce a Show, advance one space on its genre track. If you have not entered that genre before, place your marker on space 1.&lt;br /&gt;
&lt;br /&gt;
Some spaces award an immediate choice of cards. BGA presents the eligible cards privately in the choice strip. Reaching the top does not give another immediate reward, but it is worth 15 end-game viewers. Further advances in that genre have no effect.&lt;br /&gt;
&lt;br /&gt;
== Game end and final scoring ==&lt;br /&gt;
&lt;br /&gt;
After round 4, resolve upkeep, lineup scoring, and aging normally. Then score:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Genres:&#039;&#039;&#039; the value reached on every genre track where you have a marker.&lt;br /&gt;
* &#039;&#039;&#039;Reruns:&#039;&#039;&#039; the rerun value printed on every canceled Show in your reruns.&lt;br /&gt;
* &#039;&#039;&#039;Network cards:&#039;&#039;&#039; all applicable Game End effects.&lt;br /&gt;
* &#039;&#039;&#039;Cash:&#039;&#039;&#039; 1 viewer for every $3M remaining, rounded down.&lt;br /&gt;
&lt;br /&gt;
Add these bonuses to all four round scores. The highest total wins; ties are shared.&lt;br /&gt;
&lt;br /&gt;
== Reading the interface ==&lt;br /&gt;
&lt;br /&gt;
=== Your table ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Market&#039;&#039;&#039; (top): Shows, Stars, Ads, and Network cards available to take, with deck counts. With Telly Time, the pass board sits above it.&lt;br /&gt;
* &#039;&#039;&#039;Your area&#039;&#039;&#039;: green room on the left, player board in the middle, and lineup on the right.&lt;br /&gt;
* &#039;&#039;&#039;Opponents&#039;&#039;&#039;: use the tabs to inspect another player&#039;s area. Lineups, green rooms, and reruns are public.&lt;br /&gt;
* &#039;&#039;&#039;Scoreboard&#039;&#039;&#039;: round scores followed by end-game categories. Use the arrow to switch pages.&lt;br /&gt;
&lt;br /&gt;
=== Tooltips ===&lt;br /&gt;
&lt;br /&gt;
* Hover over a card, or long-press it on mobile, to read its printed information in words.&lt;br /&gt;
* Hover or long-press the &#039;&#039;&#039;Actions&#039;&#039;&#039; and &#039;&#039;&#039;Round End&#039;&#039;&#039; areas of your player board for a reference.&lt;br /&gt;
* With Executives, hover or long-press the board for that Executive&#039;s abilities and drawbacks.&lt;br /&gt;
* With Telly Time, hover or long-press the genre grid for its rules.&lt;br /&gt;
* On mobile, tap elsewhere to close a tooltip.&lt;br /&gt;
&lt;br /&gt;
=== Forecast ===&lt;br /&gt;
&lt;br /&gt;
* Above your lineup, &#039;&#039;&#039;Forecast&#039;&#039;&#039; shows the viewers and upkeep you would receive if the round ended now, before Quiz purchases and other round-end choices.&lt;br /&gt;
* Beside each Show, a badge shows that Show&#039;s current viewers and upkeep.&lt;br /&gt;
* A cube on your board&#039;s &#039;&#039;&#039;Round Scoring Track&#039;&#039;&#039; marks the same forecast total. Past 50, it laps and displays +50.&lt;br /&gt;
&lt;br /&gt;
=== Choices and confirmations ===&lt;br /&gt;
&lt;br /&gt;
* Mandatory choices, such as a genre bonus or Network effect, appear in a strip at the top of the table.&lt;br /&gt;
* Cards and Shows that cannot be used for the current action are dimmed.&lt;br /&gt;
* Most actions require confirmation in the status bar after a short countdown. Change the delay under &#039;&#039;&#039;Action confirmation delay&#039;&#039;&#039; in the game preferences.&lt;br /&gt;
* At round end, scoring may pause while a player resolves an effect.&lt;br /&gt;
&lt;br /&gt;
== How to read the cards ==&lt;br /&gt;
&lt;br /&gt;
=== Shows ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Genre&#039;&#039;&#039;: the track advanced when the Show is produced.&lt;br /&gt;
# &#039;&#039;&#039;Expenses&#039;&#039;&#039;: paid during every upkeep while the Show remains in the lineup.&lt;br /&gt;
# &#039;&#039;&#039;Preferred timeslot&#039;&#039;&#039;: sun = Daytime, sunset = Primetime, moon = Late Night.&lt;br /&gt;
# &#039;&#039;&#039;Viewers by season&#039;&#039;&#039;: the viewers scored on each row.&lt;br /&gt;
# &#039;&#039;&#039;X row&#039;&#039;&#039;: the starting row when the Show is outside a preferred timeslot.&lt;br /&gt;
# &#039;&#039;&#039;Production cost&#039;&#039;&#039;: paid once when producing the Show.&lt;br /&gt;
# &#039;&#039;&#039;Attachment slots&#039;&#039;&#039;: coloured slots are required; grey slots are optional; split slots hold either a Star or an Ad.&lt;br /&gt;
# &#039;&#039;&#039;Rerun viewers&#039;&#039;&#039;: scored at game end after the Show has been canceled.&lt;br /&gt;
&lt;br /&gt;
=== Stars ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Signing cost&#039;&#039;&#039;: paid when the Star is taken.&lt;br /&gt;
# &#039;&#039;&#039;Expenses&#039;&#039;&#039;: paid at upkeep while attached to a Show.&lt;br /&gt;
# &#039;&#039;&#039;Viewers by season&#039;&#039;&#039;: added to the Show while upright.&lt;br /&gt;
# &#039;&#039;&#039;Rotated values&#039;&#039;&#039;: used when the Star was attached without satisfying its condition.&lt;br /&gt;
# &#039;&#039;&#039;Condition or special effect&#039;&#039;&#039;: determines how the card is attached or used.&lt;br /&gt;
&lt;br /&gt;
=== Ads ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Signing bonus&#039;&#039;&#039;: gained immediately when the Ad is taken.&lt;br /&gt;
# &#039;&#039;&#039;Income&#039;&#039;&#039;: gained at upkeep while attached.&lt;br /&gt;
# &#039;&#039;&#039;Rotated income&#039;&#039;&#039;: used when the Ad is attached rotated.&lt;br /&gt;
# &#039;&#039;&#039;Condition or Promo cost&#039;&#039;&#039;: determines whether the Ad is upright or rotated.&lt;br /&gt;
&lt;br /&gt;
=== Network cards ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Timing icon&#039;&#039;&#039;: ! = Immediate, 1x = Use Once, infinity symbol = Ongoing, eye = Game End.&lt;br /&gt;
# &#039;&#039;&#039;Icon summary&#039;&#039;&#039;: a compact picture of the effect.&lt;br /&gt;
# &#039;&#039;&#039;Rules text&#039;&#039;&#039;: the full effect in words.&lt;br /&gt;
&lt;br /&gt;
== Game options ==&lt;br /&gt;
&lt;br /&gt;
=== Pilot Setup ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Normal:&#039;&#039;&#039; choose two cards from a private four-card Pilot Season offer.&lt;br /&gt;
* &#039;&#039;&#039;Simplified:&#039;&#039;&#039; automatically keep two Pilot Stars and/or Ads; Pilot Shows are omitted.&lt;br /&gt;
&lt;br /&gt;
=== Turn Order ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Fixed Order:&#039;&#039;&#039; play clockwise; the first-player marker moves one seat after each round.&lt;br /&gt;
* &#039;&#039;&#039;Low to High:&#039;&#039;&#039; after round 1, players act from the lowest previous-round score to the highest. For a tie, the player who was later in the previous order acts earlier.&lt;br /&gt;
&lt;br /&gt;
== Expansion modules ==&lt;br /&gt;
&lt;br /&gt;
Expansion availability depends on the options offered at the table. The modules may be used separately or together.&lt;br /&gt;
&lt;br /&gt;
=== Telly Time ===&lt;br /&gt;
&lt;br /&gt;
Telly Time adds a fourth timeslot, three genres, and a personal Genre Grid in place of the normal genre tracks.&lt;br /&gt;
&lt;br /&gt;
==== Genre Grid ====&lt;br /&gt;
&lt;br /&gt;
* The first Show you produce in a genre fills that genre&#039;s square.&lt;br /&gt;
* Completing a row, column, or diagonal awards the bonus at the end of that line. One placement can complete more than one line.&lt;br /&gt;
* When passing, gain $1M for each empty square in addition to any other eligible pass reward.&lt;br /&gt;
* At round end, score 1 viewer for each filled square.&lt;br /&gt;
* Normal genre-track end-game scoring does not apply.&lt;br /&gt;
&lt;br /&gt;
==== Timeslots and genres ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Weekend&#039;&#039;&#039; is a fourth timeslot.&lt;br /&gt;
* A Show with two preferred timeslots may use either without penalty. &#039;&#039;&#039;ANY&#039;&#039;&#039; means any available timeslot.&lt;br /&gt;
* &#039;&#039;&#039;Kids&#039;&#039;&#039; Shows cannot air in Primetime or Late Night.&lt;br /&gt;
* Each &#039;&#039;&#039;Quiz&#039;&#039;&#039; Show may spend up to $5M during scoring for 1 viewer per $1M.&lt;br /&gt;
* Each &#039;&#039;&#039;Chat&#039;&#039;&#039; Show gains viewers equal to the current Star viewers on your other Shows.&lt;br /&gt;
&lt;br /&gt;
=== Moguls ===&lt;br /&gt;
&lt;br /&gt;
Moguls are powerful cards with Immediate, Use Once, Ongoing, or Game End abilities. A player normally acquires at most one Mogul.&lt;br /&gt;
&lt;br /&gt;
==== Acquiring a Mogul ====&lt;br /&gt;
&lt;br /&gt;
* A Mogul token begins on space 3 of each genre track.&lt;br /&gt;
* The first eligible player to land there takes the token instead of the normal Network-card bonus, draws three Moguls, and keeps one.&lt;br /&gt;
* After a token has been removed, that space gives its normal Network-card bonus to later players.&lt;br /&gt;
* A player who already owns a Mogul receives the normal genre bonus instead of another Mogul.&lt;br /&gt;
&lt;br /&gt;
Immediate Moguls remain owned after resolving. A used Use Once Mogul flips facedown but still counts as the player&#039;s Mogul. Ongoing and Game End Moguls score or operate at their stated timing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;With Telly Time:&#039;&#039;&#039; the second completed Genre Grid line awards a Mogul instead of its printed reward; draw two and keep one.&lt;br /&gt;
&lt;br /&gt;
=== Executives ===&lt;br /&gt;
&lt;br /&gt;
Executives replace the standard player boards with asymmetric abilities and drawbacks. Each player privately receives two Executives and chooses one, including the preferred artwork side.&lt;br /&gt;
&lt;br /&gt;
* Complexity 1 Executives make relatively small rules changes.&lt;br /&gt;
* Complexity 2 or 3 Executives change more of the normal turn, economy, or scoring rules.&lt;br /&gt;
* Hover or long-press an Executive board to read its full abilities and drawbacks.&lt;br /&gt;
* BGA automatically applies special interactions when Executives are combined with Telly Time or Moguls.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Specialist&#039;&#039;&#039; requires the Moguls module and can acquire two Moguls instead of one.&lt;br /&gt;
&lt;br /&gt;
== Strategy tips ==&lt;br /&gt;
&lt;br /&gt;
* Producing a strong Show early lets it score for more rounds. Putting it outside its preferred timeslot both lowers its opening value and makes it age out sooner.&lt;br /&gt;
* Attach optional Stars and Ads while producing when practical. A later Add or Replace action handles only one card.&lt;br /&gt;
* Watch both cash now and upkeep later. A lucrative Ad can support several expensive Shows and Stars.&lt;br /&gt;
* Passing early can secure a strong reward, but leaves more of the shrinking market to the remaining players. The last player may take several consecutive actions.&lt;br /&gt;
* Genre bonuses are useful, but repeatedly advancing one genre can compete with building a balanced, profitable lineup.&lt;br /&gt;
* Before confirming a Show, check its production cost, required slots, timeslot row, genre bonus, and forecasted upkeep together.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpthenetworksprimetime&amp;diff=31905</id>
		<title>Gamehelpthenetworksprimetime</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpthenetworksprimetime&amp;diff=31905"/>
		<updated>2026-10-17T15:04:28Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: modified expansion details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Reading the interface ==&lt;br /&gt;
&lt;br /&gt;
=== Your table ===&lt;br /&gt;
* &#039;&#039;&#039;Market&#039;&#039;&#039; (top): Shows, Stars, Ads and Network cards you can take, with deck counts. With Telly Time, the pass board sits above it.&lt;br /&gt;
* &#039;&#039;&#039;Your area&#039;&#039;&#039;: green room (Stars, Ads, Network cards and Moguls you own) on the left, your player board in the middle, your lineup on the right.&lt;br /&gt;
* &#039;&#039;&#039;Opponents&#039;&#039;&#039;: use the tabs to view another player&#039;s area. Everything in a lineup and in reruns is public.&lt;br /&gt;
* &#039;&#039;&#039;Scoreboard&#039;&#039;&#039;: round scores, then endgame scores (Genres, Reruns, Network/Moguls/Executives, Cash). Use the arrow to switch pages.&lt;br /&gt;
&lt;br /&gt;
=== Tooltips ===&lt;br /&gt;
* Hover over any card (or long-press it on mobile) to read everything printed on it in words.&lt;br /&gt;
* Hover or long-press the &#039;&#039;&#039;Actions&#039;&#039;&#039; and &#039;&#039;&#039;Round End&#039;&#039;&#039; areas of your player board for the printed reference.&lt;br /&gt;
* With Executives, hover or long-press your board for your Executive&#039;s abilities and drawbacks.&lt;br /&gt;
* With Telly Time, hover or long-press your genre grid for how it works.&lt;br /&gt;
* On mobile, tap anywhere else to close a tooltip.&lt;br /&gt;
&lt;br /&gt;
=== Forecast ===&lt;br /&gt;
* Above your lineup: &#039;&#039;&#039;Forecast&#039;&#039;&#039; shows the viewers and upkeep you would get if the round ended now (before Quiz purchases and round-end choices).&lt;br /&gt;
* Beside each Show: a badge with that Show&#039;s viewers and upkeep this round.&lt;br /&gt;
* On your player board: a cube on the &#039;&#039;&#039;Round Scoring Track&#039;&#039;&#039; marks the same forecast total (past 50 it laps around and shows +50).&lt;br /&gt;
&lt;br /&gt;
=== Choices and confirmations ===&lt;br /&gt;
* When you must choose (a genre bonus, a Network card&#039;s effect, a Mogul, a grid line...), the choice appears in a strip at the top of the table. The rest of the table stays visible.&lt;br /&gt;
* Cards and Shows you can&#039;t use for the current action are dimmed; valid targets stay bright.&lt;br /&gt;
* Most actions ask you to confirm in the status bar, with a short countdown. Change this in the game preferences under &#039;&#039;&#039;Action confirmation delay&#039;&#039;&#039; (0, 3, 5 or 10 seconds, or Off).&lt;br /&gt;
* At round end, the game may wait for a player to make a round-end choice (for example Surpriser) before scoring continues.&lt;br /&gt;
&lt;br /&gt;
== How to read the cards ==&lt;br /&gt;
&lt;br /&gt;
=== Shows ===&lt;br /&gt;
# &#039;&#039;&#039;Genre&#039;&#039;&#039;: producing the Show advances you on this genre track.&lt;br /&gt;
# &#039;&#039;&#039;Expenses&#039;&#039;&#039;: paid every round at upkeep.&lt;br /&gt;
# &#039;&#039;&#039;Preferred timeslot&#039;&#039;&#039;: sun = daytime, sunset = primetime, moon = late night.&lt;br /&gt;
# &#039;&#039;&#039;Viewers by season&#039;&#039;&#039;: scored each round. The marker moves down one row per round, and the Show is canceled when it runs off the bottom.&lt;br /&gt;
# &#039;&#039;&#039;The X&#039;&#039;&#039;: outside its preferred timeslot, the Show starts on this row instead.&lt;br /&gt;
# &#039;&#039;&#039;Production cost&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;Attachment slots&#039;&#039;&#039;: coloured = required, grey = optional. A half Star/half Ad slot takes either.&lt;br /&gt;
# &#039;&#039;&#039;Rerun viewers&#039;&#039;&#039;: scored at game end once the Show has been canceled.&lt;br /&gt;
&lt;br /&gt;
=== Stars ===&lt;br /&gt;
# &#039;&#039;&#039;Signing cost&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;Expenses&#039;&#039;&#039;: paid every round at upkeep (if shown).&lt;br /&gt;
# &#039;&#039;&#039;Viewers by season&#039;&#039;&#039;: when attached upright.&lt;br /&gt;
# &#039;&#039;&#039;Rotated values&#039;&#039;&#039; (upside down): used when the Star is attached rotated.&lt;br /&gt;
# &#039;&#039;&#039;Condition&#039;&#039;&#039;: if met, the Star stays upright; otherwise it is rotated. Some Stars have an effect on a black strip instead.&lt;br /&gt;
&lt;br /&gt;
=== Ads ===&lt;br /&gt;
# &#039;&#039;&#039;Signing bonus&#039;&#039;&#039;: gained when you sign the Ad.&lt;br /&gt;
# &#039;&#039;&#039;Income&#039;&#039;&#039;: gained every round at upkeep.&lt;br /&gt;
# &#039;&#039;&#039;Rotated income&#039;&#039;&#039;: when the Ad is attached rotated.&lt;br /&gt;
# &#039;&#039;&#039;Condition&#039;&#039;&#039;: if met, the Ad stays upright; otherwise it is rotated. Promos instead let you pay to keep them upright.&lt;br /&gt;
&lt;br /&gt;
=== Network cards ===&lt;br /&gt;
# &#039;&#039;&#039;Timing&#039;&#039;&#039;: ! Immediate (resolves when taken), 1x Use once, ∞ Ongoing, eye = Game end.&lt;br /&gt;
# &#039;&#039;&#039;The effect&#039;&#039;&#039;, in icons.&lt;br /&gt;
# &#039;&#039;&#039;The effect&#039;&#039;&#039;, in words.&lt;br /&gt;
&lt;br /&gt;
== Expansion notes ==&lt;br /&gt;
&lt;br /&gt;
##Expansions&lt;br /&gt;
&lt;br /&gt;
The game includes three optional modules: **Telly Time**, **Moguls**, and **Executives**. They can be played separately or combined.&lt;br /&gt;
&lt;br /&gt;
###Telly Time&lt;br /&gt;
&lt;br /&gt;
Telly Time changes the base game with a fourth timeslot, new genres, and a Genre Grid that replaces the usual genre tracks.&lt;br /&gt;
&lt;br /&gt;
**Genre Grid**&lt;br /&gt;
&lt;br /&gt;
- Each genre has one space on your grid. Producing your first Show of that genre fills its space.&lt;br /&gt;
- Completing a row, column, or diagonal earns the bonus shown at the end of that line. Multiple lines can score at once.&lt;br /&gt;
- When passing, gain $1M for each empty space, regardless of your pass bonus.&lt;br /&gt;
- At round end, score 1 viewer for each filled space.&lt;br /&gt;
- Genre tracks no longer score endgame viewers.&lt;br /&gt;
&lt;br /&gt;
**Timeslots**&lt;br /&gt;
&lt;br /&gt;
- Weekend is a fourth timeslot and works like the original three.&lt;br /&gt;
- Shows with two preferred timeslots can use either without penalty.&lt;br /&gt;
- Shows marked ANY can use any timeslot without penalty.&lt;br /&gt;
&lt;br /&gt;
**New Genres**&lt;br /&gt;
&lt;br /&gt;
| Genre | Special rule |&lt;br /&gt;
|---|---|&lt;br /&gt;
| Kids | Cannot air in Primetime or Late Night |&lt;br /&gt;
| Quiz | Pay up to $5M when scoring to gain 1 viewer per $1M |&lt;br /&gt;
| Chat | Gains viewers equal to the current viewers from Stars on your other Shows |&lt;br /&gt;
&lt;br /&gt;
###Moguls&lt;br /&gt;
&lt;br /&gt;
Moguls are powerful cards that give your network special abilities and scoring bonuses. You can normally acquire only **one Mogul per game**.&lt;br /&gt;
&lt;br /&gt;
**Getting a Mogul**&lt;br /&gt;
&lt;br /&gt;
- The first player to reach space 3 on a genre track takes its Mogul token instead of the usual Network card bonus.&lt;br /&gt;
- Draw 3 Mogul cards and keep 1.&lt;br /&gt;
- Once you&#039;ve acquired a Mogul, you receive normal genre bonuses from any remaining Mogul spaces you reach.&lt;br /&gt;
- Other players can collect the normal Network card bonus after a Mogul token has been removed.&lt;br /&gt;
&lt;br /&gt;
**Using Moguls**&lt;br /&gt;
&lt;br /&gt;
Moguls work much like Network cards, with a few differences:&lt;br /&gt;
&lt;br /&gt;
- **Immediate:** Resolve the effect, but keep the card for its other abilities.&lt;br /&gt;
- **One-time:** Flip the card facedown after use. It still counts as your Mogul.&lt;br /&gt;
- **Ongoing:** Provides continuing abilities or round-end viewers.&lt;br /&gt;
- **Game End:** Adds viewers to your final score.&lt;br /&gt;
&lt;br /&gt;
**With Telly Time:** Your second completed Genre Grid line awards a Mogul instead of its normal bonus. Draw 2 Moguls and keep 1.&lt;br /&gt;
&lt;br /&gt;
###Executives&lt;br /&gt;
&lt;br /&gt;
Executives replace the standard Player Boards with unique abilities and drawbacks. Each player chooses one of two randomly offered Executives at the start of the game.&lt;br /&gt;
&lt;br /&gt;
**Abilities &amp;amp; Drawbacks**&lt;br /&gt;
&lt;br /&gt;
- Every Executive changes how you play, with special advantages balanced by restrictions or penalties.&lt;br /&gt;
- Some affect drafting, production, income, or scoring. Others change your actions or turn order.&lt;br /&gt;
- Executives have complexity ratings from 1 to 3, indicating how many unusual rules they introduce.&lt;br /&gt;
&lt;br /&gt;
Your Executive&#039;s abilities and drawbacks are displayed on your Player Board.&lt;br /&gt;
&lt;br /&gt;
**Combining Expansions**&lt;br /&gt;
&lt;br /&gt;
Some Executives have special interactions with Telly Time or Moguls. These adjustments are handled automatically by BGA.&lt;br /&gt;
&lt;br /&gt;
The Specialist Executive requires Moguls and can acquire two instead of one.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=31892</id>
		<title>Gamehelpscovilleseconded</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=31892"/>
		<updated>2026-10-16T10:45:42Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: Reworded and formated existing text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
UI help: At the bottom of the board is a button to toggle player hand float/anchor. Beneath the trophies is a toggle for award choies. At the bottom right of the field that toggles permanent visiblity of breeding outcomes. The pepper next to the recipes toggles a mode that indicates which peppers you still need before you can fill a recipe.&lt;br /&gt;
&lt;br /&gt;
==Turn Structure==&lt;br /&gt;
Every turn, you &#039;&#039;&#039;must plant a pepper&#039;&#039;&#039; and &#039;&#039;&#039;must move your farmer&#039;&#039;&#039;.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Phase!!Turn order&lt;br /&gt;
|-&lt;br /&gt;
|Planting||1 → 6&lt;br /&gt;
|-&lt;br /&gt;
|Harvesting||6 → 1&lt;br /&gt;
|-&lt;br /&gt;
|Fulfillment|| 1 → 6&lt;br /&gt;
|}&lt;br /&gt;
===Bidding and Turn Order===&lt;br /&gt;
*Tied bids are resolved in favor of the player who planted earlier in the previous round.&lt;br /&gt;
*Players who bid nothing are assigned the highest available turn-order positions, using the previous round&#039;s order.&lt;br /&gt;
==Important Rules==*Only one of each market card, recipe, and planting award may be acquired per round.&lt;br /&gt;
*Only one pepper color may be sold per round.&lt;br /&gt;
* Peppers acquired from the market may be used to fulfill recipes in the same round.&lt;br /&gt;
==Scoring==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Item!! Points&lt;br /&gt;
|-&lt;br /&gt;
| Bonus card||4 VP each&lt;br /&gt;
|-&lt;br /&gt;
|Coins||1 VP per 3 coins&lt;br /&gt;
|}&#039;&#039;&#039;Note:&#039;&#039;&#039; Bonus cards and coins are hidden in player hands, so their points are not included in the live score displayed during the game.&lt;br /&gt;
== Game End Conditions==&lt;br /&gt;
End conditions are checked at the end of each round.&lt;br /&gt;
===Morning===&lt;br /&gt;
If fewer recipes remain than the number of players, one final round is played.&lt;br /&gt;
===Afternoon===&lt;br /&gt;
*If either the recipe supply or market supply drops below the player count, one final round is played.&lt;br /&gt;
*If both supplies drop below the player count, the game ends immediately.&lt;br /&gt;
==Board Game Arena Interface==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Control!!Function&lt;br /&gt;
|-&lt;br /&gt;
|Hand toggle||Float or anchor your player hand&lt;br /&gt;
|-&lt;br /&gt;
| Award toggle||Change award display&lt;br /&gt;
|-&lt;br /&gt;
| Breeding toggle||Keep breeding outcomes visible&lt;br /&gt;
|-&lt;br /&gt;
|Pepper icon beside recipes||Highlight peppers still needed for recipes&lt;br /&gt;
|-&lt;br /&gt;
|Available Cards||View available cards without relying on hover pop-ups&lt;br /&gt;
|}The Available Cards button is particularly useful on mobile devices.&lt;br /&gt;
==LABS Expansion==&lt;br /&gt;
*Adds 12 recipe cards and 12 market cards.&lt;br /&gt;
*Each player receives an additional bonus planting token.&lt;br /&gt;
*No awards are removed at lower player counts.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpthenetworksprimetime&amp;diff=31704</id>
		<title>Gamehelpthenetworksprimetime</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpthenetworksprimetime&amp;diff=31704"/>
		<updated>2026-10-03T17:18:34Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: Created page with &amp;quot;== Reading the interface ==  === Your table === * &amp;#039;&amp;#039;&amp;#039;Market&amp;#039;&amp;#039;&amp;#039; (top): Shows, Stars, Ads and Network cards you can take, with deck counts. With Telly Time, the pass board sits above it. * &amp;#039;&amp;#039;&amp;#039;Your area&amp;#039;&amp;#039;&amp;#039;: green room (Stars, Ads, Network cards and Moguls you own) on the left, your player board in the middle, your lineup on the right. * &amp;#039;&amp;#039;&amp;#039;Opponents&amp;#039;&amp;#039;&amp;#039;: use the tabs to view another player&amp;#039;s area. Everything in a lineup and in reruns is public. * &amp;#039;&amp;#039;&amp;#039;Scoreboard&amp;#039;&amp;#039;&amp;#039;: round scor...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Reading the interface ==&lt;br /&gt;
&lt;br /&gt;
=== Your table ===&lt;br /&gt;
* &#039;&#039;&#039;Market&#039;&#039;&#039; (top): Shows, Stars, Ads and Network cards you can take, with deck counts. With Telly Time, the pass board sits above it.&lt;br /&gt;
* &#039;&#039;&#039;Your area&#039;&#039;&#039;: green room (Stars, Ads, Network cards and Moguls you own) on the left, your player board in the middle, your lineup on the right.&lt;br /&gt;
* &#039;&#039;&#039;Opponents&#039;&#039;&#039;: use the tabs to view another player&#039;s area. Everything in a lineup and in reruns is public.&lt;br /&gt;
* &#039;&#039;&#039;Scoreboard&#039;&#039;&#039;: round scores, then endgame scores (Genres, Reruns, Network/Moguls/Executives, Cash). Use the arrow to switch pages.&lt;br /&gt;
&lt;br /&gt;
=== Tooltips ===&lt;br /&gt;
* Hover over any card (or long-press it on mobile) to read everything printed on it in words.&lt;br /&gt;
* Hover or long-press the &#039;&#039;&#039;Actions&#039;&#039;&#039; and &#039;&#039;&#039;Round End&#039;&#039;&#039; areas of your player board for the printed reference.&lt;br /&gt;
* With Executives, hover or long-press your board for your Executive&#039;s abilities and drawbacks.&lt;br /&gt;
* With Telly Time, hover or long-press your genre grid for how it works.&lt;br /&gt;
* On mobile, tap anywhere else to close a tooltip.&lt;br /&gt;
&lt;br /&gt;
=== Forecast ===&lt;br /&gt;
* Above your lineup: &#039;&#039;&#039;Forecast&#039;&#039;&#039; shows the viewers and upkeep you would get if the round ended now (before Quiz purchases and round-end choices).&lt;br /&gt;
* Beside each Show: a badge with that Show&#039;s viewers and upkeep this round.&lt;br /&gt;
* On your player board: a cube on the &#039;&#039;&#039;Round Scoring Track&#039;&#039;&#039; marks the same forecast total (past 50 it laps around and shows +50).&lt;br /&gt;
&lt;br /&gt;
=== Choices and confirmations ===&lt;br /&gt;
* When you must choose (a genre bonus, a Network card&#039;s effect, a Mogul, a grid line...), the choice appears in a strip at the top of the table. The rest of the table stays visible.&lt;br /&gt;
* Cards and Shows you can&#039;t use for the current action are dimmed; valid targets stay bright.&lt;br /&gt;
* Most actions ask you to confirm in the status bar, with a short countdown. Change this in the game preferences under &#039;&#039;&#039;Action confirmation delay&#039;&#039;&#039; (0, 3, 5 or 10 seconds, or Off).&lt;br /&gt;
* At round end, the game may wait for a player to make a round-end choice (for example Surpriser) before scoring continues.&lt;br /&gt;
&lt;br /&gt;
== How to read the cards ==&lt;br /&gt;
&lt;br /&gt;
=== Shows ===&lt;br /&gt;
# &#039;&#039;&#039;Genre&#039;&#039;&#039;: producing the Show advances you on this genre track.&lt;br /&gt;
# &#039;&#039;&#039;Expenses&#039;&#039;&#039;: paid every round at upkeep.&lt;br /&gt;
# &#039;&#039;&#039;Preferred timeslot&#039;&#039;&#039;: sun = daytime, sunset = primetime, moon = late night.&lt;br /&gt;
# &#039;&#039;&#039;Viewers by season&#039;&#039;&#039;: scored each round. The marker moves down one row per round, and the Show is canceled when it runs off the bottom.&lt;br /&gt;
# &#039;&#039;&#039;The X&#039;&#039;&#039;: outside its preferred timeslot, the Show starts on this row instead.&lt;br /&gt;
# &#039;&#039;&#039;Production cost&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;Attachment slots&#039;&#039;&#039;: coloured = required, grey = optional. A half Star/half Ad slot takes either.&lt;br /&gt;
# &#039;&#039;&#039;Rerun viewers&#039;&#039;&#039;: scored at game end once the Show has been canceled.&lt;br /&gt;
&lt;br /&gt;
=== Stars ===&lt;br /&gt;
# &#039;&#039;&#039;Signing cost&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;Expenses&#039;&#039;&#039;: paid every round at upkeep (if shown).&lt;br /&gt;
# &#039;&#039;&#039;Viewers by season&#039;&#039;&#039;: when attached upright.&lt;br /&gt;
# &#039;&#039;&#039;Rotated values&#039;&#039;&#039; (upside down): used when the Star is attached rotated.&lt;br /&gt;
# &#039;&#039;&#039;Condition&#039;&#039;&#039;: if met, the Star stays upright; otherwise it is rotated. Some Stars have an effect on a black strip instead.&lt;br /&gt;
&lt;br /&gt;
=== Ads ===&lt;br /&gt;
# &#039;&#039;&#039;Signing bonus&#039;&#039;&#039;: gained when you sign the Ad.&lt;br /&gt;
# &#039;&#039;&#039;Income&#039;&#039;&#039;: gained every round at upkeep.&lt;br /&gt;
# &#039;&#039;&#039;Rotated income&#039;&#039;&#039;: when the Ad is attached rotated.&lt;br /&gt;
# &#039;&#039;&#039;Condition&#039;&#039;&#039;: if met, the Ad stays upright; otherwise it is rotated. Promos instead let you pay to keep them upright.&lt;br /&gt;
&lt;br /&gt;
=== Network cards ===&lt;br /&gt;
# &#039;&#039;&#039;Timing&#039;&#039;&#039;: ! Immediate (resolves when taken), 1x Use once, ∞ Ongoing, eye = Game end.&lt;br /&gt;
# &#039;&#039;&#039;The effect&#039;&#039;&#039;, in icons.&lt;br /&gt;
# &#039;&#039;&#039;The effect&#039;&#039;&#039;, in words.&lt;br /&gt;
&lt;br /&gt;
== Expansion notes ==&lt;br /&gt;
&lt;br /&gt;
=== Telly Time: the genre grid ===&lt;br /&gt;
* Producing a Show covers its genre&#039;s space on your grid, once per genre. There is no genre track.&lt;br /&gt;
* Completing a row, column or diagonal gives the bonus printed at its end: draw cards and keep one, as with a genre bonus.&lt;br /&gt;
* With Moguls, your 2nd completed line draws Moguls instead of its printed bonus.&lt;br /&gt;
* When you pass: $1M for each empty space. At round end: 1 viewer for each covered space.&lt;br /&gt;
* The Show space on the grid is your Weekend timeslot.&lt;br /&gt;
&lt;br /&gt;
=== Writeoff (Network card) ===&lt;br /&gt;
* Writeoff cancels your lowest-scoring Show and pays $1M per viewer it would have scored this round, counting its attached Stars and effects.&lt;br /&gt;
* If one Show is lowest, you just confirm. If several are tied, choose which one to cancel.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=31506</id>
		<title>Gamehelpscovilleseconded</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=31506"/>
		<updated>2026-09-20T04:32:37Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: UI help&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
UI help: At the bottom of the board is a button to toggle player hand float/anchor. Beneath the trophies is a toggle for award choies. At the bottom right of the field that toggles permanent visiblity of breeding outcomes. The pepper next to the recipes toggles a mode that indicates which peppers you still need before you can fill a recipe.&lt;br /&gt;
&lt;br /&gt;
On your turn: You MUST plant a pepper. You MUST move. Turn order is 1 to 6 for planting, 6 to 1 for harvesting, 1 to 6 for fulfillment. If players tie on a bid, the player who previously planted first gets priority. If players bid nothing, they get moved to the highest (1 being highest) open slot in previous turn order (1 to 6).&lt;br /&gt;
&lt;br /&gt;
Only one of each market/recipe/planting award can be acquired each round. Similarly only one color of pepper may be sold. You may use peppers acquired from the market to fulfill recipes in the same round.&lt;br /&gt;
&lt;br /&gt;
Bonus cards are worth 4pts at game end; coins are worth 1pt/3 coins. Since player hands are hidden, neither are part of the score calculated during the game.&lt;br /&gt;
&lt;br /&gt;
Game End Conditions (checked at round end):&lt;br /&gt;
   Morning: If recipe count &amp;lt; player count, only one more round is played.&lt;br /&gt;
   Afternoon: If recipe or market count &amp;lt; player count, one more round is played. If recipe AND market count &amp;lt; player count, game ends immediately.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FYI:&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;available cards&amp;quot; button is intended as an alternative to hover-over pop-ups, which aren&#039;t as nice in mobile form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LABS Expansion adds 12 recipe and 12 market cards; players get an additional bonus planting token and no awards are removed at low player count.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=30958</id>
		<title>Gamehelpscovilleseconded</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=30958"/>
		<updated>2026-08-05T05:16:11Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
On your turn: You MUST plant a pepper. You MUST move. Turn order is 1 to 6 for planting, 6 to 1 for harvesting, 1 to 6 for fulfillment. If players tie on a bid, the player who previously planted first gets priority. If players bid nothing, they get moved to the highest (1 being highest) open slot in previous turn order (1 to 6).&lt;br /&gt;
&lt;br /&gt;
Only one of each market/recipe/planting award can be acquired each round. Similarly only one color of pepper may be sold. You may use peppers acquired from the market to fulfill recipes in the same round.&lt;br /&gt;
&lt;br /&gt;
Bonus cards are worth 4pts at game end; coins are worth 1pt/3 coins. Since player hands are hidden, neither are part of the score calculated during the game.&lt;br /&gt;
&lt;br /&gt;
Game End Conditions (checked at round end):&lt;br /&gt;
   Morning: If recipe count &amp;lt; player count, only one more round is played.&lt;br /&gt;
   Afternoon: If recipe or market count &amp;lt; player count, one more round is played. If recipe AND market count &amp;lt; player count, game ends immediately.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
UI help: There is a button on the bottom right of the field that toggles permanent visiblity of breeding outcomes. The &amp;quot;available cards&amp;quot; button is intended as an alternative to hover-over pop-ups, which aren&#039;t as nice in mobile form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LABS Expansion adds 12 recipe and 12 market cards; players get an additional bonus planting token and no awards are removed at low player count.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=30956</id>
		<title>Gamehelpscovilleseconded</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=30956"/>
		<updated>2026-08-05T04:45:09Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: added bidding logic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
On your turn: You MUST plant a pepper. You MUST move. Turn order is 1 to 6 for planting, 6 to 1 for harvesting, 1 to 6 for fulfillment. If players tie on a bid, the player who previously planted first gets priority. If players bid nothing, they get moved to the highest (1 being highest) open slot in previous turn order (1 to 6).&lt;br /&gt;
&lt;br /&gt;
Only one of each market/recipe/planting award can be acquired each round. Similarly only one color of pepper may be sold. You may use peppers acquired from the market to fulfill recipes in the same round.&lt;br /&gt;
&lt;br /&gt;
Bonus cards are worth 4pts at game end; coins are worth 1pt/3 coins. Since player hands are hidden, neither are part of the score calculated during the game.&lt;br /&gt;
&lt;br /&gt;
Game End Conditions (checked at round end):&lt;br /&gt;
   Morning: If recipe count &amp;lt; player count, only one more round is played.&lt;br /&gt;
   Afternoon: If recipe or market count &amp;lt; player count, one more round is played. If recipe AND market count &amp;lt; player count, game ends immediately.&lt;br /&gt;
&lt;br /&gt;
LABS Expansion adds 12 recipe and 12 market cards; players get an additional bonus planting token and no awards are removed at low player count.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=30955</id>
		<title>Gamehelpscovilleseconded</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpscovilleseconded&amp;diff=30955"/>
		<updated>2026-08-05T04:37:13Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: Created page with &amp;quot; On your turn: You MUST plant a pepper. You MUST move. Turn order is 1 to 6 for planting, 6 to 1 for harvesting, 1 to 6 for fulfillment.  Only one of each market/recipe/planting award can be acquired each round. Similarly only one color of pepper may be sold. You may use peppers acquired from the market to fulfill recipes in the same round.  Bonus cards are worth 4pts at game end; coins are worth 1pt/3 coins. Since player hands are hidden, neither are part of the score c...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
On your turn: You MUST plant a pepper. You MUST move. Turn order is 1 to 6 for planting, 6 to 1 for harvesting, 1 to 6 for fulfillment.&lt;br /&gt;
&lt;br /&gt;
Only one of each market/recipe/planting award can be acquired each round. Similarly only one color of pepper may be sold. You may use peppers acquired from the market to fulfill recipes in the same round.&lt;br /&gt;
&lt;br /&gt;
Bonus cards are worth 4pts at game end; coins are worth 1pt/3 coins. Since player hands are hidden, neither are part of the score calculated during the game.&lt;br /&gt;
&lt;br /&gt;
Game End Conditions (checked at round end):&lt;br /&gt;
   Morning: If recipe count &amp;lt; player count, only one more round is played.&lt;br /&gt;
   Afternoon: If recipe or market count &amp;lt; player count, one more round is played. If recipe AND market count &amp;lt; player count, game ends immediately.&lt;br /&gt;
&lt;br /&gt;
LABS Expansion adds 12 recipe and 12 market cards; players get an additional bonus planting token and no awards are removed at low player count.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpkalua&amp;diff=30601</id>
		<title>Gamehelpkalua</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpkalua&amp;diff=30601"/>
		<updated>2026-07-08T00:20:09Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Each player starts with: 10 families, 1 leader, 5 prayer and happiness at 5.&lt;br /&gt;
&lt;br /&gt;
Place 3 atheist families per player on the Kalua board and each player draws cards from either deck until they have five total.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Turn Sequence:&lt;br /&gt;
&lt;br /&gt;
1. If you&#039;re the round leader and have fewer than 5 cards, draw until you have 5. Otherwise, draw 1 card from either deck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Then, beginning with the active player, each player may (if they still have their leader) perform one action:&lt;br /&gt;
&lt;br /&gt;
Increase your Happiness by 1.&lt;br /&gt;
Convert 2 atheist families.&lt;br /&gt;
Convert 1 family from another player&#039;s religion.&lt;br /&gt;
Sacrifice your leader to immediately convert up to 5 atheist families.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. The active player may play any number of action cards. Once they decide to pass, every other player may respond with one card.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Resolve cards in the order they were played.&lt;br /&gt;
&lt;br /&gt;
Card types:&lt;br /&gt;
&lt;br /&gt;
Bonus – Helps yourself.&lt;br /&gt;
Local Disaster – Targets one religion.&lt;br /&gt;
Global Disaster – Affects everyone. Pay extra prayer to protect yourself (avoid) or amplify (double) the disaster.&lt;br /&gt;
&lt;br /&gt;
Cards can affect: Happiness, prayer, families, atheists, force players to discard, recover a sacrificed leader, or create lasting effects (Temples or Amulets)&lt;br /&gt;
&lt;br /&gt;
The cycle can repeat until the active player decides not to play any cards. They then trigger the &amp;quot;convert&amp;quot; phase.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Convert Families&lt;br /&gt;
&lt;br /&gt;
Compare each religion&#039;s Happiness.&lt;br /&gt;
&lt;br /&gt;
If everyone is equally happy, nothing happens. The unhappiest religion contributes 2 families to the conversion pool.&lt;br /&gt;
Middle religions contribute 1 family.&lt;br /&gt;
The happiest religion(s) divide the converted families (maximum 3 each).&lt;br /&gt;
Any leftovers become atheist families on the Kalua board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Gain Praying Points&lt;br /&gt;
&lt;br /&gt;
Each religion gains:&lt;br /&gt;
1 prayer per 5 families (rounded up)&lt;br /&gt;
+4 prayer if it is the unhappiest religion; +2 prayer if it is neither the happiest nor the unhappiest&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other Info:&lt;br /&gt;
&lt;br /&gt;
Temple remains in play until destroyed and grants extra prayer each turn.&lt;br /&gt;
Amulets may be discarded to prevent losing families from a single card.&lt;br /&gt;
The New Leader card replaces a sacrificed or lost leader by promoting one of your families.&lt;br /&gt;
&lt;br /&gt;
Players may purchase additional cards at any time for 5 prayer each.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Winning the Game:&lt;br /&gt;
&lt;br /&gt;
At the end of any round, if only one religion still has families, that religion wins. A religion is not eliminated while its leader survives—the leader can continue recruiting followers and potentially rebuild the religion.&lt;br /&gt;
&lt;br /&gt;
If a Global Disaster eliminates every remaining family simultaneously, the religion that had the most families immediately before the disaster wins. If tied, all tied religions share the victory.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Gamehelpkalua&amp;diff=30597</id>
		<title>Gamehelpkalua</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Gamehelpkalua&amp;diff=30597"/>
		<updated>2026-07-07T22:11:48Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: Added play sequence, win condition and general help&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Each player starts with: 10 families, 1 leader, 5 prayer and happiness at 5.&lt;br /&gt;
&lt;br /&gt;
Place 3 atheist families per player on the Kalua board and each player draws cards from either deck until they have five total.&lt;br /&gt;
&lt;br /&gt;
Turn Sequence:&lt;br /&gt;
&lt;br /&gt;
1. If you&#039;re the round leader and have fewer than 5 cards, draw until you have 5. Otherwise, draw 1 card from either deck.&lt;br /&gt;
&lt;br /&gt;
2. Then, beginning with the active player, each player may (if they still have their leader) perform one action:&lt;br /&gt;
&lt;br /&gt;
Increase your Happiness by 1.&lt;br /&gt;
Convert 2 atheist families.&lt;br /&gt;
Convert 1 family from another player&#039;s religion.&lt;br /&gt;
Sacrifice your leader to immediately convert up to 5 atheist families.&lt;br /&gt;
&lt;br /&gt;
3. The active player may play any number of action cards. Once they decide to pass, every other player may respond with one card.&lt;br /&gt;
&lt;br /&gt;
4. Resolve cards in the order they were played.&lt;br /&gt;
&lt;br /&gt;
Card types:&lt;br /&gt;
&lt;br /&gt;
Bonus – Helps yourself.&lt;br /&gt;
Local Disaster – Targets one religion.&lt;br /&gt;
Global Disaster – Affects everyone. Pay extra prayer to protect yourself (avoid) or amplify (double) the disaster.&lt;br /&gt;
&lt;br /&gt;
Cards can affect: Happiness, prayer, families, atheists, force players to discard, recover a sacrificed leader, or create lasting effects (Temples or Amulets)&lt;br /&gt;
&lt;br /&gt;
The cycle can repeat until the active player decides not to play any cards. They then trigger the &amp;quot;convert&amp;quot; phase.&lt;br /&gt;
&lt;br /&gt;
4. Convert Families&lt;br /&gt;
&lt;br /&gt;
Compare each religion&#039;s Happiness.&lt;br /&gt;
&lt;br /&gt;
If everyone is equally happy, nothing happens. The unhappiest religion contributes 2 families to the conversion pool.&lt;br /&gt;
Middle religions contribute 1 family.&lt;br /&gt;
The happiest religion(s) divide the converted families (maximum 3 each).&lt;br /&gt;
Any leftovers become atheist families on the Kalua board.&lt;br /&gt;
&lt;br /&gt;
5. Gain Praying Points&lt;br /&gt;
&lt;br /&gt;
Each religion gains:&lt;br /&gt;
1 prayer per 5 families (rounded up)&lt;br /&gt;
+4 prayer if it is the unhappiest religion; +2 prayer if it is neither the happiest nor the unhappiest&lt;br /&gt;
&lt;br /&gt;
Special Rules&lt;br /&gt;
Temple remains in play until destroyed and grants extra PP each turn.&lt;br /&gt;
Amulet may be discarded to prevent losing families from a single card.&lt;br /&gt;
New Leader replaces a sacrificed or lost leader by promoting one of your families.&lt;br /&gt;
&lt;br /&gt;
Players may purchase additional cards at any time for 5 prayer each.&lt;br /&gt;
&lt;br /&gt;
Winning the Game&lt;br /&gt;
At the end of any round, if only one religion still has families, that religion wins. A religion is not eliminated while its leader survives—the leader can continue recruiting followers and potentially rebuild the religion.&lt;br /&gt;
&lt;br /&gt;
If a Global Disaster eliminates every remaining family simultaneously, the religion that had the most families immediately before the disaster wins. If tied, all tied religions share the victory.&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
	<entry>
		<id>https://en.doc.boardgamearena.com/index.php?title=Tutorial_reversi&amp;diff=26232</id>
		<title>Tutorial reversi</title>
		<link rel="alternate" type="text/html" href="https://en.doc.boardgamearena.com/index.php?title=Tutorial_reversi&amp;diff=26232"/>
		<updated>2025-08-17T04:05:28Z</updated>

		<summary type="html">&lt;p&gt;Augment reality: animation manager needs to be called at top of .js before being used&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to use TypeScript, you can &#039;&#039;&#039;check out an updated version&#039;&#039;&#039; of the [[BGA Type Safe Template: Reversi|Reversi Tutorial]] which uses the [[BGA Type Safe Template]]. &#039;&#039;&#039;Important note: BGA Type Safe Template is a project created by a developer that is not part of the BGA team. This is currently not officially supported by BGA.&#039;&#039;&#039; {{Studio_Framework_Navigation}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Using this tutorial, you can build a complete working game on the BGA environment: Reversi.&lt;br /&gt;
&lt;br /&gt;
Before you read this tutorial, you must:&lt;br /&gt;
* Read the overall presentations of the BGA Framework ([[Studio|see here]]).&lt;br /&gt;
* Know the [http://en.wikipedia.org/wiki/Reversi#Rules rules of Reversi].&lt;br /&gt;
* Know the languages used on BGA: PHP, SQL, HTML, CSS, Javascript&lt;br /&gt;
* &#039;&#039;&#039;Setup your development environment&#039;&#039;&#039; [http://en.doc.boardgamearena.com/First_steps_with_BGA_Studio First Steps with BGA Studio]&lt;br /&gt;
&lt;br /&gt;
== Create your first game ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: you should already have created a project following instructions in [[First_steps_with_BGA_Studio#Create_a_new_game_project|Create a new game project]]. While you will find a &#039;&#039;&#039;reversi&#039;&#039;&#039; directory in your SFTP folder, do not use it for this tutorial. Instead, use the project you have created as an (empty) starting point.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With the initial skeleton of code provided in your project, you can already start a game from the BGA Studio:&lt;br /&gt;
* Go to your [https://studio.boardgamearena.com/controlpanel studio Control panel], then Manage games and select your initial project. &#039;&#039;Note: there are warnings displayed about a missing BGG_ID and presentation text. You can ignore that for now.&#039;&#039;&lt;br /&gt;
* Click the Play link next to your project name. This will open the Play page and offer to create a new table for your project. &#039;&#039;Optional: click the Heart icon to add your project to your favorite games list.&#039;&#039;&lt;br /&gt;
* On the Play page, on the top of the page, make sure that your settings are &amp;quot;Simple game&amp;quot;, &amp;quot;Real time&amp;quot; and &amp;quot;Manual&amp;quot;.&lt;br /&gt;
* Click &amp;quot;Create table&amp;quot; to create a table of your project. &lt;br /&gt;
* For now, we are going to work with one player only, so use the (-) button to set the number of players to 1. Most of the time it is simpler to proceed with only one player during the early phase of development of your game, as it&#039;s easy and fast to start/stop games. If you choose to start with 2 players, you should see two names on the right: testdude0 and testdude1. To switch between them, press the red arrow button near their names; it will open another tab. This way you don&#039;t need to login and logout from multiple accounts.) &lt;br /&gt;
* Reminder: Always use the &amp;quot;Express Start&amp;quot; button to start the game.&lt;br /&gt;
&lt;br /&gt;
Thus, you can start a &amp;quot;Reversi&amp;quot; game, and arrive on a void, empty game. Yeah.&lt;br /&gt;
&lt;br /&gt;
End the game by clicking on the game options icon on the top right, and then on &amp;quot;Express Stop&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Editing the game information (Optional) ==&lt;br /&gt;
&lt;br /&gt;
This step is optional and will fix the warnings on the project page (missing BGG_ID and presentation).&lt;br /&gt;
&lt;br /&gt;
==== Edits to fix Errors ====&lt;br /&gt;
* Edit your local copy of the &amp;lt;code&amp;gt;gameinfos.inc.php&amp;lt;/code&amp;gt; file:&lt;br /&gt;
** Change the &amp;lt;code&amp;gt;bgg_id&amp;lt;/code&amp;gt; value from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;2389&amp;lt;/code&amp;gt; - that&#039;s around line 26.&lt;br /&gt;
** Add &amp;lt;code&amp;gt;1,&amp;lt;/code&amp;gt; to the players array (so you can start 1-player games while testing) - that&#039;s around line 29.&lt;br /&gt;
* Upload the &amp;lt;code&amp;gt;gameinfos.inc.php&amp;lt;/code&amp;gt; file to the SFTP server (see [[First_steps_with_BGA_Studio#Connect_to_your_SFTP_folder|Connect to your SFTP folder]]).&lt;br /&gt;
&lt;br /&gt;
==== Test your Edits ====&lt;br /&gt;
* Go back to your project page, and in the &amp;quot;Game Information&amp;quot; section, click &amp;quot;Reload game informations&amp;quot;.&lt;br /&gt;
* Finally, refresh the project page in your browser (usually CTRL-F5).&lt;br /&gt;
&lt;br /&gt;
===== Not working? =====&lt;br /&gt;
Some changes will require bypassing the cache (adding/changing images). It is often worth doing a hard refresh to make sure the latest version is used.&lt;br /&gt;
&lt;br /&gt;
Sometimes the cache will keep your changes from showing. Since this is a possibility, it will be useful to know how to bypass the cache. To do so you may manually clear cache or use a shortcut to refresh and ignore the cached version of the page. Here&#039;s how&lt;br /&gt;
&lt;br /&gt;
====== Windows ======&lt;br /&gt;
Chrome, Firefox, or Edge: Press &amp;lt;code&amp;gt;Ctrl+F5&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Shift+F5&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Ctrl+Shift+R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Mac ======&lt;br /&gt;
Chrome or Firefox: Press &amp;lt;code&amp;gt;Shift+Command+R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Safari for Mac: Press &amp;lt;code&amp;gt;Command+Option+E&amp;lt;/code&amp;gt; to empty the cache, then hold down Shift and click Reload in the toolbar&lt;br /&gt;
&lt;br /&gt;
== Make it look like Reversi ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start with the board. This will give you a good idea of how things will look and where tokens should go.&lt;br /&gt;
&lt;br /&gt;
Be careful designing the layout of your game: you must always keep in mind that players with a 1024px screen width must be able to play. Usually, it means that the width of the play area can be 750px (in the worst case).&lt;br /&gt;
&lt;br /&gt;
For Reversi, it&#039;s useless to have a 750x750px board - much too big, so we chose this one which fit perfectly (536x528):&lt;br /&gt;
&lt;br /&gt;
[[File:Board.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note that we are using a jpg file. Jpg files are lighter than png, so they are faster to load. Later, we are going to use PNGs for tokens because they allow for transparency.&lt;br /&gt;
&lt;br /&gt;
==== Add the board ====&lt;br /&gt;
use lowercase file names&lt;br /&gt;
* upload &amp;lt;code&amp;gt;board.jpg&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;img/&amp;lt;/code&amp;gt; directory. &lt;br /&gt;
* edit &amp;lt;code&amp;gt;reversi.js&amp;lt;/code&amp;gt; to add the &amp;lt;code&amp;gt;div&amp;lt;/code&amp;gt; for your board at the beginning of the setup function.&lt;br /&gt;
&lt;br /&gt;
Note: If you are building this game by following the tutorial, you will have a different project name than &amp;lt;code&amp;gt;reversi&amp;lt;/code&amp;gt; (i.e. &amp;lt;code&amp;gt;mygame.js&amp;lt;/code&amp;gt;). The file names in your project will be different than shown in this tutorial, replacing &amp;lt;code&amp;gt;reversi&amp;lt;/code&amp;gt; with your project name. Be sure that any code (other than comments) that references &amp;lt;code&amp;gt;reversi&amp;lt;/code&amp;gt; is changed to your actual project name.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.getGameAreaElement().insertAdjacentHTML(&#039;beforeend&#039;, `&lt;br /&gt;
  &amp;lt;div id=&amp;quot;board&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
`);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: example above use backticks, aka string template literals. This technique used a lot in code of games as it allows to easily create html with strings substitutions, use quotes, doubel quotes and newlines. &lt;br /&gt;
If you don&#039;t know what it is check here&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* edit your &amp;lt;code&amp;gt;reversi.css&amp;lt;/code&amp;gt; file to transform it into a visible board:&lt;br /&gt;
&lt;br /&gt;
 #board {&lt;br /&gt;
    width: 536px;&lt;br /&gt;
    height: 528px;&lt;br /&gt;
    background-image: url(&#039;img/board.jpg&#039;);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important: refresh your page.&#039;&#039;&#039; Here&#039;s your board:[[File:reversi1.jpg]]&lt;br /&gt;
&lt;br /&gt;
If the board does not appear, refresh the page (always do this when you update the CSS file), and check the image filename. Remember file names are case sensitive!&lt;br /&gt;
&lt;br /&gt;
==== Code the Grid ====&lt;br /&gt;
Now, we need to create some invisible HTML elements where squares are. These elements will be used as position references for the white and black tokens. &lt;br /&gt;
&lt;br /&gt;
===== Build the grid of squares =====&lt;br /&gt;
The board is 8 squares by 8 squares. This means we need 64 squares. To avoid writing 64 individual &amp;lt;code&amp;gt;div&amp;lt;/code&amp;gt; elements on our template, we are going to generate the squares on JS &amp;lt;code&amp;gt;setup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll do this in our Javascript &amp;lt;code&amp;gt;setup&amp;lt;/code&amp;gt; method under &amp;lt;code&amp;gt;// TODO: Set up your game interface here, according to &amp;quot;gamedatas&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const board = document.getElementById(&#039;board&#039;);&lt;br /&gt;
const hor_scale = 64.8;&lt;br /&gt;
const ver_scale = 64.4;&lt;br /&gt;
for (let x=1; x&amp;lt;=8; x++) {&lt;br /&gt;
    for (let y=1; y&amp;lt;=8; y++) {&lt;br /&gt;
        const left = Math.round((x - 1) * hor_scale + 10);&lt;br /&gt;
        const top = Math.round((y - 1) * ver_scale + 7);&lt;br /&gt;
        // we use afterbegin to make sure squares are placed before discs&lt;br /&gt;
        board.insertAdjacentHTML(`afterbegin`, `&amp;lt;div id=&amp;quot;square_${x}_${y}&amp;quot; class=&amp;quot;square&amp;quot; style=&amp;quot;left: ${left}px; top: ${top}px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;`);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: as you can see, squares in our &amp;lt;code&amp;gt;board.jpg&amp;lt;/code&amp;gt; files do not have an exact width/height in pixels, and that&#039;s the reason we are using floating point numbers here.&lt;br /&gt;
&lt;br /&gt;
===== Style Those Squares =====&lt;br /&gt;
Now, to finish our work and check if everything works fine, we are going to style our square a little bit in our CSS stylesheet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#board {&lt;br /&gt;
    width: 536px;&lt;br /&gt;
    height: 528px;&lt;br /&gt;
    background-image: url(&#039;img/board.jpg&#039;);&lt;br /&gt;
    position: relative;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.square {&lt;br /&gt;
    width: 62px;&lt;br /&gt;
    height: 62px;&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    background-color: red;&lt;br /&gt;
    display: flex;&lt;br /&gt;
    justify-content: center;&lt;br /&gt;
    align-items: center;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
* With &amp;quot;&amp;lt;code&amp;gt;position: relative&amp;lt;/code&amp;gt;&amp;quot; on board, we ensure square elements are positioned relatively to board.&lt;br /&gt;
* &amp;lt;code&amp;gt;background-color: red;&amp;lt;/code&amp;gt; is used for testing. This allows us to see the invisible elements. (You could instead do something like &amp;lt;code&amp;gt;outline: 2px solid orange;&amp;lt;/code&amp;gt; have fun and be creative)&lt;br /&gt;
* The display flex with center will place the disc in the center of the square.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s refresh and check our (beautiful) squares:&lt;br /&gt;
&lt;br /&gt;
[[File:reversi2.jpg]]&lt;br /&gt;
&lt;br /&gt;
Now that you know the squares are there, you can remove the test line &amp;lt;code&amp;gt;background-color: red;&amp;lt;/code&amp;gt;  from your &amp;lt;code&amp;gt;.square&amp;lt;/code&amp;gt; class in the CSS stylesheet.&lt;br /&gt;
&lt;br /&gt;
===== Not Working? =====&lt;br /&gt;
If the styled squares do not appear, inspect and check your css (Chrome DevTools: Application &amp;gt; Frames &amp;gt; top &amp;gt; Stylesheets &amp;gt; reversi.css). &lt;br /&gt;
&lt;br /&gt;
== The Tokens ==&lt;br /&gt;
&lt;br /&gt;
Now, our board is ready for some tokens!&lt;br /&gt;
&lt;br /&gt;
[Note: Throughout this tutorial, sometimes &amp;quot;tokens&amp;quot; is used, and sometimes &amp;quot;discs&amp;quot; is used. They are often swapped if you&#039;re looking at code in the reversi example project.]&lt;br /&gt;
&lt;br /&gt;
=== Build the Token ===&lt;br /&gt;
There are quite a few steps before the tokens will appear. You may be used to testing after every change, but that won&#039;t work well here. The token will &#039;&#039;&#039;not&#039;&#039;&#039; show until you have add styles to the css, js template to the tpl, utility method in the js,  adjusted the php file, and added the token to the board in the js file.&lt;br /&gt;
&lt;br /&gt;
==== Add Token to img directory ====&lt;br /&gt;
Here&#039;s a new piece of art with the tokens. We need transparency here so we are using a png file:&lt;br /&gt;
&lt;br /&gt;
[[File:tokens.png]]&lt;br /&gt;
&lt;br /&gt;
Upload this image file &amp;lt;code&amp;gt;tokens.png&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;img/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Important Fun Fact: we are using ONE file for both tokens. It is really important to use a minimum number of graphic files for your game. This is called the &amp;quot;CSS sprite&amp;quot; technique, because it makes the game load faster and more reliable. [http://www.w3schools.com/css/css_image_sprites.asp Read more about CSS sprites].&lt;br /&gt;
&lt;br /&gt;
==== Style the Tokens in .css file ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.disc {&lt;br /&gt;
    position: relative;&lt;br /&gt;
    width: 54px;&lt;br /&gt;
    height: 54px;&lt;br /&gt;
    z-index: 3;&lt;br /&gt;
    transform-style: preserve-3d;&lt;br /&gt;
}&lt;br /&gt;
.disc .disc-faces { &lt;br /&gt;
    transform-style: preserve-3d;&lt;br /&gt;
}&lt;br /&gt;
.disc[data-color=&amp;quot;000000&amp;quot;] .disc-faces { &lt;br /&gt;
    transform: rotateY(180deg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.disc-face {&lt;br /&gt;
    position: absolute;&lt;br /&gt;
    width: 54px;&lt;br /&gt;
    height: 54px;&lt;br /&gt;
    background-image: url(&#039;img/tokens.png&#039;);&lt;br /&gt;
    background-size: auto 100%;&lt;br /&gt;
    backface-visibility: hidden;&lt;br /&gt;
}&lt;br /&gt;
.disc-face[data-side=&amp;quot;white&amp;quot;] { &lt;br /&gt;
    background-position-x: 0%; &lt;br /&gt;
    transform: rotateY(0deg);&lt;br /&gt;
}&lt;br /&gt;
.disc-face[data-side=&amp;quot;black&amp;quot;] { &lt;br /&gt;
    background-position-x: 100%; &lt;br /&gt;
    transform: rotateY(180deg);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this CSS code, we can set and change the token color by changing the &amp;lt;code&amp;gt;data-color&amp;lt;/code&amp;gt; attribute. Using data instead of a class ensures it can be only one of them (the disc cannot be black and white at the same time).&lt;br /&gt;
We will create a disc-faces div in the disc containing 2 disc-face divs, to represent each face of the disc. It will allow us to have a nice flip animation!&lt;br /&gt;
&lt;br /&gt;
==== Add Token Utility Method in .js file ====&lt;br /&gt;
Now, let&#039;s make the first token appear on our board. Tokens are not visible at the beginning of the game: they appear dynamically during the game. For this reason, we are going to make them appear from our Javascript code, using a template string&lt;br /&gt;
&lt;br /&gt;
Let&#039;s create a method in our Javascript code (in the &amp;lt;code&amp;gt;reversi.js&amp;lt;/code&amp;gt; file) that will make a token appear on the board, using this template. Add under the section &amp;lt;code&amp;gt;//// Utility methods&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        addDiscOnBoard: async function( x, y, playerId, animate = true )&lt;br /&gt;
        {&lt;br /&gt;
            const color = this.gamedatas.players[ playerId ].color;&lt;br /&gt;
            const discId = `disc_${x}_${y}`;&lt;br /&gt;
&lt;br /&gt;
            document.getElementById(`square_${x}_${y}`).insertAdjacentHTML(&#039;beforeend&#039;, `&lt;br /&gt;
                &amp;lt;div class=&amp;quot;disc&amp;quot; data-color=&amp;quot;${color}&amp;quot; id=&amp;quot;${discId}&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;div class=&amp;quot;disc-faces&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;disc-face&amp;quot; data-side=&amp;quot;white&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                        &amp;lt;div class=&amp;quot;disc-face&amp;quot; data-side=&amp;quot;black&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
                    &amp;lt;/div&amp;gt;&lt;br /&gt;
                &amp;lt;/div&amp;gt;&lt;br /&gt;
            `);&lt;br /&gt;
&lt;br /&gt;
            if (animate) {&lt;br /&gt;
                const element = document.getElementById(discId);&lt;br /&gt;
                await this.animationManager.fadeIn(element, document.getElementById(`overall_player_board_${playerId}`));&lt;br /&gt;
            }&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this to work, you will also need to initialize the animation manager. Include the function in your .js file by updating as outlined here: [[BgaAnimations]]. Then add this in the setup function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
            this.animationManager = new BgaAnimations.Manager({&lt;br /&gt;
                animationsActive: () =&amp;gt; this.bgaAnimationsActive(),&lt;br /&gt;
            });&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Utility Method Explanation =====&lt;br /&gt;
* with &amp;lt;code&amp;gt;element.insertAdjacentHTML&amp;lt;/code&amp;gt; method, we create a HTML piece of code and insert it as a new child of the square div element.&lt;br /&gt;
* Immediately after, using &amp;lt;code&amp;gt;this.animationManager.fadeIn&amp;lt;/code&amp;gt; BGA method, we make the disc slide in (with a fade in animation) from the player panel.&lt;br /&gt;
&lt;br /&gt;
Also note the trailing comma - this is needed because there may be other functions defined after this one, making &amp;lt;code&amp;gt;addDiscOnBoard&amp;lt;/code&amp;gt; just one element in an array of functions.&lt;br /&gt;
&lt;br /&gt;
==== Set Token Colors in setupNewGame in modules/php/Game.php file ====&lt;br /&gt;
Before we can show a token, we need to set the player colors in the &amp;lt;code&amp;gt;setupNewGame&amp;lt;/code&amp;gt; function in  &amp;lt;code&amp;gt;modules/php/Game.php&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Replace &amp;lt;code&amp;gt;$default_colors = $gameinfos[&#039;player_colors&#039;];&amp;lt;/code&amp;gt; with the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$default_colors = array( &amp;quot;ffffff&amp;quot;, &amp;quot;000000&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: A few lines below, you may have to remove the line &amp;lt;code&amp;gt;this-&amp;gt;reattributeColorsBasedOnPreferences( $players, $gameinfos[&#039;player_colors&#039;] );&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test the Token ===&lt;br /&gt;
Now, to test if everything works fine&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;addTokenOnBoard()&amp;lt;/code&amp;gt; in .js file to Test ====&lt;br /&gt;
In &amp;lt;code&amp;gt;reversi.js&amp;lt;/code&amp;gt;, in &amp;lt;code&amp;gt;setup: function&amp;lt;/code&amp;gt;, under the code we added to generate the squares. &lt;br /&gt;
 this.addDiscOnBoard(2, 2, this.player_id, false);&lt;br /&gt;
Now restart the game.&lt;br /&gt;
&lt;br /&gt;
A token should appear and slide immediately to its position, like this:&lt;br /&gt;
&lt;br /&gt;
[[File:reversi3.jpg]]&lt;br /&gt;
&lt;br /&gt;
== The database ==&lt;br /&gt;
&lt;br /&gt;
We did most of the client-side programming, so let&#039;s have a look on the other side now. To design the database model of our game, you will need to access the database. You won&#039;t need to do anything in database UI, yet.&lt;br /&gt;
&lt;br /&gt;
=== Accessing the Database ===&lt;br /&gt;
To access the database, start a game, then click &amp;quot;Go to game database&amp;quot; link at the bottom of our game, to access the database directly with a PhpMyAdmin instance.&lt;br /&gt;
&lt;br /&gt;
After the first time you&#039;ve access the database, you could skip opening a game and instead, go to https://studio.boardgamearena.com/db/ . Your PhpMyAdmin username/password is in your welcome email.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: do not remove existing tables&lt;br /&gt;
&lt;br /&gt;
=== Create Table in .sql file ===&lt;br /&gt;
Now, you are able to create the table(s) you need for your game, and report every SQL command used in your &amp;lt;code&amp;gt;dbmodel.sql&amp;lt;/code&amp;gt; file. &lt;br /&gt;
&lt;br /&gt;
The database model of Reversi is short: just one table with the squares of the board. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE TABLE IF NOT EXISTS `board` (&lt;br /&gt;
  `board_x` smallint(5) unsigned NOT NULL,&lt;br /&gt;
  `board_y` smallint(5) unsigned NOT NULL,&lt;br /&gt;
  `board_player` int(10) unsigned DEFAULT NULL,&lt;br /&gt;
  PRIMARY KEY (`board_x`,`board_y`)&lt;br /&gt;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the above SQL to &amp;lt;code&amp;gt;dbmodel.sql&amp;lt;/code&amp;gt;. Pay special attention to the backtick &amp;lt;code&amp;gt;`&amp;lt;/code&amp;gt; character vs. the single quote &amp;lt;code&amp;gt;&#039;&amp;lt;/code&amp;gt; when working with SQL. &lt;br /&gt;
&lt;br /&gt;
=== Test the Table ===&lt;br /&gt;
Now, a new database with a &amp;lt;code&amp;gt;board&amp;lt;/code&amp;gt; table will be created each time we start a Reversi game. This is why after modifying our &amp;lt;code&amp;gt;dbmodel.sql&amp;lt;/code&amp;gt; it&#039;s a good time to stop your current game &amp;amp; start a new game.&lt;br /&gt;
&lt;br /&gt;
Start a new game and verify a table is created.&lt;br /&gt;
&lt;br /&gt;
== Setup the initial game position ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: From now on, you must launch the game with &#039;&#039;&#039;two players&#039;&#039;&#039; to get two &amp;lt;code&amp;gt;player_id&amp;lt;/code&amp;gt;s within the database. Otherwise, the game will crash.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;setupNewGame&amp;lt;/code&amp;gt; method of our &amp;lt;code&amp;gt;Game.php&amp;lt;/code&amp;gt; is called during initial setup. This initializes our data and places the starting tokens on the board. At the beginning of the game, there should be 4 tokens on the board.&lt;br /&gt;
&lt;br /&gt;
=== Initialize the Board in modules/php/Game.php file ===&lt;br /&gt;
Under &amp;lt;code&amp;gt;// TODO: setup the initial game situation here&amp;lt;/code&amp;gt;, initialize the board&amp;lt;pre&amp;gt;&lt;br /&gt;
// Init the board&lt;br /&gt;
$sql = &amp;quot;INSERT INTO board (board_x,board_y,board_player) VALUES &amp;quot;;&lt;br /&gt;
$sql_values = array();&lt;br /&gt;
list( $blackplayer_id, $whiteplayer_id ) = array_keys( $players );&lt;br /&gt;
for( $x=1; $x&amp;lt;=8; $x++ )&lt;br /&gt;
{&lt;br /&gt;
	for( $y=1; $y&amp;lt;=8; $y++ )&lt;br /&gt;
	{&lt;br /&gt;
	$token_value = &amp;quot;NULL&amp;quot;;&lt;br /&gt;
	if( ($x==4 &amp;amp;&amp;amp; $y==4) || ($x==5 &amp;amp;&amp;amp; $y==5) )  // Initial positions of white player&lt;br /&gt;
	$token_value = &amp;quot;&#039;$whiteplayer_id&#039;&amp;quot;;&lt;br /&gt;
	else if( ($x==4 &amp;amp;&amp;amp; $y==5) || ($x==5 &amp;amp;&amp;amp; $y==4) )  // Initial positions of black player&lt;br /&gt;
	$token_value = &amp;quot;&#039;$blackplayer_id&#039;&amp;quot;;&lt;br /&gt;
                    &lt;br /&gt;
	$sql_values[] = &amp;quot;(&#039;$x&#039;,&#039;$y&#039;,$token_value)&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
$sql .= implode( &#039;,&#039;, $sql_values );&lt;br /&gt;
$this-&amp;gt;DbQuery( $sql );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Board Initialization Explanation ====&lt;br /&gt;
&lt;br /&gt;
* We create one table entry for each square, with a &amp;lt;code&amp;gt;NULL&amp;lt;/code&amp;gt; value which means &amp;quot;empty square&amp;quot;&lt;br /&gt;
* On 4 of the squares, we place an initial token.&lt;br /&gt;
&lt;br /&gt;
After this, we set &amp;lt;code&amp;gt;activeNextPlayer&amp;lt;/code&amp;gt; to make the first player active at the beginning of the game (this line is already present in the default code template).&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t do it earlier, you need to remove the call to &amp;lt;code&amp;gt;this-&amp;gt;reattributeColorsBasedOnPreferences()&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;SetupNewGame()&amp;lt;/code&amp;gt;. If you don&#039;t, player color preferences will try (and fail) to override the two colors supported here.&lt;br /&gt;
&lt;br /&gt;
=== Show the Initial Token Setup ===&lt;br /&gt;
Now, we need to make these tokens appear on the client side. The first step is to return the token positions with our &amp;lt;code&amp;gt;getAllDatas()&amp;lt;/code&amp;gt; PHP method. &amp;lt;code&amp;gt;getAllDatas()&amp;lt;/code&amp;gt; is called during each page reload.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;getAllDatas()&amp;lt;/code&amp;gt; method, after &amp;lt;code&amp;gt;// TODO: Gather all information about current game situation (visible by player $current_player_id)&amp;lt;/code&amp;gt;, add the following lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Get reversi board token&lt;br /&gt;
$result[&#039;board&#039;] = self::getObjectListFromDB( &amp;quot;SELECT board_x x, board_y y, board_player player&lt;br /&gt;
	FROM board&lt;br /&gt;
	WHERE board_player IS NOT NULL&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, you will modify the query that gets player information to also get the player&#039;s colors. Above the lines you just inserted in &amp;lt;code&amp;gt;getAllDatas()&amp;lt;/code&amp;gt; notice how we&#039;ve added &amp;lt;code&amp;gt;player_color color&amp;lt;/code&amp;gt; to the sql query in the code below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$result[&amp;quot;players&amp;quot;] = $this-&amp;gt;getCollectionFromDb(&lt;br /&gt;
    &amp;quot;SELECT `player_id` `id`, `player_score` `score`, `player_color` `color` FROM `player`&amp;quot;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are using the BGA framework&#039;s &amp;lt;code&amp;gt;getObjectListFromDB()&amp;lt;/code&amp;gt; that formats the result of this SQL query in a PHP array with x, y and player attributes. We add it to the result associative array with the key &amp;lt;code&amp;gt;board&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Last, we process this array client side. Let&#039;s place a token on the board for each array item. We&#039;ll do this in our Javascript &amp;lt;code&amp;gt;setup&amp;lt;/code&amp;gt; method under the code we added to generate the squares. &lt;br /&gt;
&lt;br /&gt;
This will result in a removal or edit of the previously added line &amp;lt;code&amp;gt;this.addDiscOnBoard(2, 2, this.player_id);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for( var i in gamedatas.board )&lt;br /&gt;
{&lt;br /&gt;
    var square = gamedatas.board[i];&lt;br /&gt;
    &lt;br /&gt;
    if( square.player !== null )&lt;br /&gt;
    {&lt;br /&gt;
        this.addDiscOnBoard( square.x, square.y, square.player );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;board&amp;lt;/code&amp;gt; entry created in &amp;lt;code&amp;gt;getAllDatas()&amp;lt;/code&amp;gt; is used here as &amp;lt;code&amp;gt;gamedatas.board&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test the Game Start ===&lt;br /&gt;
Reload... and here we are:&lt;br /&gt;
&lt;br /&gt;
[[File:reversi5.jpg]]&lt;br /&gt;
&lt;br /&gt;
It starts to feel like Reversi here...&lt;br /&gt;
&lt;br /&gt;
== The game state machine ==&lt;br /&gt;
&lt;br /&gt;
Stop your game, again. You&#039;re about to start the core game logic.&lt;br /&gt;
&lt;br /&gt;
You already read [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine Focus on BGA game state machine], so you know that this is the heart of your game logic. For reversi, it&#039;s relatively simple. Here&#039;s a diagram of our game state machine:&lt;br /&gt;
&lt;br /&gt;
[[File:reversi6.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Build your States ===&lt;br /&gt;
And here&#039;s our &amp;lt;code&amp;gt;states.inc.php&amp;lt;/code&amp;gt;, according to this diagram:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$machinestates = [&lt;br /&gt;
    ST_BGA_GAME_SETUP =&amp;gt; GameStateBuilder::gameSetup(ST_PLAYER_PLAY_DISC)-&amp;gt;build(),&lt;br /&gt;
    &lt;br /&gt;
    ST_PLAYER_PLAY_DISC =&amp;gt; GameStateBuilder::create()&lt;br /&gt;
        -&amp;gt;name(&#039;playerTurn&#039;)&lt;br /&gt;
        -&amp;gt;description(clienttranslate(&#039;${actplayer} must play a disc&#039;))&lt;br /&gt;
		-&amp;gt;descriptionmyturn(clienttranslate(&#039;${you} must play a disc&#039;))&lt;br /&gt;
        -&amp;gt;type(StateType::ACTIVE_PLAYER)&lt;br /&gt;
        -&amp;gt;args(&#039;argPlayerTurn&#039;)&lt;br /&gt;
        -&amp;gt;possibleactions([&lt;br /&gt;
            &#039;actPlayDisc&#039;,&lt;br /&gt;
        ])&lt;br /&gt;
        -&amp;gt;transitions([&lt;br /&gt;
            &#039;playDisc&#039; =&amp;gt; ST_NEXT_PLAYER,&lt;br /&gt;
        ])&lt;br /&gt;
        -&amp;gt;build(),&lt;br /&gt;
    &lt;br /&gt;
    ST_NEXT_PLAYER =&amp;gt; GameStateBuilder::create()&lt;br /&gt;
        -&amp;gt;name(&#039;nextPlayer&#039;)&lt;br /&gt;
        -&amp;gt;type(StateType::GAME)&lt;br /&gt;
        -&amp;gt;action(&#039;stNextPlayer&#039;)&lt;br /&gt;
        -&amp;gt;updateGameProgression(true)&lt;br /&gt;
        -&amp;gt;transitions([&lt;br /&gt;
            &#039;nextTurn&#039; =&amp;gt; ST_PLAYER_PLAY_DISC, &lt;br /&gt;
            &#039;cantPlay&#039; =&amp;gt; ST_NEXT_PLAYER,&lt;br /&gt;
            &#039;endGame&#039; =&amp;gt; ST_END_GAME,&lt;br /&gt;
        ])&lt;br /&gt;
        -&amp;gt;build(),&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We used constants to give an index to the different states. This is to avoid mistakes when we reuse these indexes on the transitions array.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s create a file you&#039;ll put in &amp;lt;code&amp;gt;modules/php/constants.inc.php&amp;lt;/code&amp;gt; :&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * State constants&lt;br /&gt;
 */&lt;br /&gt;
const ST_BGA_GAME_SETUP = 1;&lt;br /&gt;
&lt;br /&gt;
const ST_PLAYER_PLAY_DISC = 10;&lt;br /&gt;
const ST_NEXT_PLAYER = 11;&lt;br /&gt;
&lt;br /&gt;
const ST_END_GAME = 99;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will also need to add &amp;lt;code&amp;gt;require_once(&amp;quot;modules/php/constants.inc.php&amp;quot;);&amp;lt;/code&amp;gt; at the beginning of the state.inc.php to load these constants.&lt;br /&gt;
&lt;br /&gt;
=== Test Your States ===&lt;br /&gt;
... and start a new Reversi game.&lt;br /&gt;
&lt;br /&gt;
As you can see on the screen capture below, the BGA framework makes the game jump to our first game state &amp;lt;code&amp;gt;playerTurn&amp;lt;/code&amp;gt; right after the initial setup. That&#039;s why the status bar contains the description of &amp;lt;code&amp;gt;playerTurn&amp;lt;/code&amp;gt; state (&amp;quot;XXXX must play a disc&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
[[File:reversi7.jpg]]&lt;br /&gt;
&lt;br /&gt;
== The rules ==&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;lt;code&amp;gt;getPossibleMoves&amp;lt;/code&amp;gt; PHP method to:&lt;br /&gt;
* Indicate to the current player where she is allowed to play by returning a list of coordinates&lt;br /&gt;
* Check if the player has the right to play in the spot they choose&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Example of &amp;lt;code&amp;gt;getPossibleMoves&amp;lt;/code&amp;gt; here https://gist.github.com/leocaseiro/a8bc2851bd0caddd06685b5035937d15&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is pure PHP programming here, and there are no special things from the BGA framework that can be used. This is why we won&#039;t go into details here. The overall idea is:&lt;br /&gt;
* Create a &amp;lt;code&amp;gt;getTurnedOverDiscs(x,y)&amp;lt;/code&amp;gt; method that returns coordinates of discs that would be turned over if a token would be played at &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Loop through all free squares of the board and call the &amp;lt;code&amp;gt;getTurnedOverDiscs&amp;lt;/code&amp;gt; method on each of them. If at least 1 token is turned over, this is a valid move.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: Making a database query is slow! Please don&#039;t load the entire game board with a SQL query multiple times. In our implementation, we load the entire board once at the beginning of &amp;lt;code&amp;gt;getPossibleMoves&amp;lt;/code&amp;gt;, and then pass the board as an argument to all methods.&lt;br /&gt;
&lt;br /&gt;
If you want to look into details, please look at the &amp;quot;utility method&amp;quot; sections of &amp;lt;code&amp;gt;Game.php&amp;lt;/code&amp;gt;. If building the tutorial yourself, copy the functions under &amp;quot;Utility functions&amp;quot; comment from the Reversi tutorial.&lt;br /&gt;
&lt;br /&gt;
== Display allowed moves ==&lt;br /&gt;
&lt;br /&gt;
Now we want to highlight the squares where the player can place a disc.&lt;br /&gt;
&lt;br /&gt;
To do this, we add a &amp;lt;code&amp;gt;argPlayerTurn&amp;lt;/code&amp;gt; method in &amp;lt;code&amp;gt;modules/php/Game.php&amp;lt;/code&amp;gt;. This method is called on the server each time we enter into &amp;lt;code&amp;gt;playerTurn&amp;lt;/code&amp;gt; game state, and its result is transferred automatically to the client-side:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function argPlayerTurn(): array&lt;br /&gt;
{&lt;br /&gt;
    return [&lt;br /&gt;
        &#039;possibleMoves&#039; =&amp;gt; $this-&amp;gt;getPossibleMoves( intval($this-&amp;gt;getActivePlayerId()) )&lt;br /&gt;
    ];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; after this modification you will need to modify the &amp;lt;code&amp;gt;onUpdateActionButtons&amp;lt;/code&amp;gt; function in your javascript to remove the references to &amp;lt;code&amp;gt;playableCardsIds&amp;lt;/code&amp;gt; in order to launch a game, there will be javascript errors in the console as the code will blow up when it tries to loop over that array.&lt;br /&gt;
&lt;br /&gt;
We use the &amp;lt;code&amp;gt;getPossibleMoves&amp;lt;/code&amp;gt; method we just developed.&lt;br /&gt;
&lt;br /&gt;
Each time we enter into a new game state, we use the &amp;lt;code&amp;gt;onEnteringState&amp;lt;/code&amp;gt; Javascript method (in the &amp;lt;code&amp;gt;reversi.js&amp;lt;/code&amp;gt; file, under &amp;quot;Game &amp;amp; client states&amp;quot;). This lets us use the data returned by the method above on the client side.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onEnteringState: function( stateName, args )&lt;br /&gt;
        {&lt;br /&gt;
           console.log( &#039;Entering state: &#039;+stateName );&lt;br /&gt;
            &lt;br /&gt;
            switch( stateName )&lt;br /&gt;
            {&lt;br /&gt;
            case &#039;playerTurn&#039;:&lt;br /&gt;
                this.updatePossibleMoves( args.args.possibleMoves );&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, when we enter into &amp;lt;code&amp;gt;playerTurn&amp;lt;/code&amp;gt; game state, we call our &amp;lt;code&amp;gt;updatePossibleMoves&amp;lt;/code&amp;gt; method (under the &amp;quot;Utility methods&amp;quot; section). This method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
updatePossibleMoves: function( possibleMoves )&lt;br /&gt;
{&lt;br /&gt;
    // Remove current possible moves&lt;br /&gt;
    document.querySelectorAll(&#039;.possibleMove&#039;).forEach(div =&amp;gt; div.classList.remove(&#039;possibleMove&#039;));&lt;br /&gt;
&lt;br /&gt;
    for( var x in possibleMoves )&lt;br /&gt;
    {&lt;br /&gt;
        for( var y in possibleMoves[ x ] )&lt;br /&gt;
        {&lt;br /&gt;
            // x,y is a possible move&lt;br /&gt;
            document.getElementById(`square_${x}_${y}`).classList.add(&#039;possibleMove&#039;);&lt;br /&gt;
        }            &lt;br /&gt;
    }&lt;br /&gt;
                &lt;br /&gt;
    this.addTooltipToClass( &#039;possibleMove&#039;, &#039;&#039;, _(&#039;Place a disc here&#039;) );&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here&#039;s what this does. At first, it removes all &amp;lt;code&amp;gt;possibleMove&amp;lt;/code&amp;gt; classes currently applied with the very useful &amp;lt;code&amp;gt;document.querySelectorAll&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
Then it loops through all possible moves our PHP &amp;lt;code&amp;gt;updatePossibleMoves&amp;lt;/code&amp;gt; function created for us, and adds the &amp;lt;code&amp;gt;possibleMove&amp;lt;/code&amp;gt; class to each corresponding square.&lt;br /&gt;
&lt;br /&gt;
Finally, it uses the BGA framework &amp;lt;code&amp;gt;addTooltipToClass&amp;lt;/code&amp;gt; method to associate a tooltip to all those highlighted squares so that players can understand their meaning.&lt;br /&gt;
&lt;br /&gt;
To see the possible moves we need to create a CSS class (&amp;lt;code&amp;gt;possibleMove&amp;lt;/code&amp;gt;) that can be applied to a &amp;lt;code&amp;gt;square&amp;lt;/code&amp;gt; element to highlight it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
.possibleMove {&lt;br /&gt;
    background-color: white;&lt;br /&gt;
    opacity: 0.2; &lt;br /&gt;
    cursor: pointer;  &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And here we are:&lt;br /&gt;
&lt;br /&gt;
[[File:reversi8.jpg.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Let&#039;s play ==&lt;br /&gt;
&lt;br /&gt;
From now, it&#039;s better to restart a game with 2 players, because we are going to implement a complete Reversi turn. The summary of what we are going to do is:&lt;br /&gt;
* When we click on a square, check if it is a &amp;lt;code&amp;gt;possibleMove&amp;lt;/code&amp;gt; and if so, send the move to the server.&lt;br /&gt;
* Server side, check the move is correct, apply Reversi rules and jump to next player.&lt;br /&gt;
* Client side, change the token position to reflect the move.&lt;br /&gt;
&lt;br /&gt;
First we associate each click on a square to one of our methods using our Javascript &amp;lt;code&amp;gt;setup&amp;lt;/code&amp;gt; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
document.querySelectorAll(&#039;.square&#039;).forEach(square =&amp;gt; square.addEventListener(&#039;click&#039;, e =&amp;gt; this.onPlayDisc(e)));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, our &amp;quot;onPlayDisc&amp;quot; method is called each time someone clicks on a square.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our &amp;quot;onPlayDisc&amp;quot; method below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
onPlayDisc: function( evt )&lt;br /&gt;
{&lt;br /&gt;
    // Stop this event propagation&lt;br /&gt;
    evt.preventDefault();&lt;br /&gt;
    evt.stopPropagation();&lt;br /&gt;
&lt;br /&gt;
    // Get the cliqued square x and y&lt;br /&gt;
    // Note: square id format is &amp;quot;square_X_Y&amp;quot;&lt;br /&gt;
    var coords = evt.currentTarget.id.split(&#039;_&#039;);&lt;br /&gt;
    var x = coords[1];&lt;br /&gt;
    var y = coords[2];&lt;br /&gt;
&lt;br /&gt;
    if(!document.getElementById(`square_${x}_${y}`).classList.contains(&#039;possibleMove&#039;)) {&lt;br /&gt;
        // This is not a possible move =&amp;gt; the click does nothing&lt;br /&gt;
        return ;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    this.bgaPerformAction(&amp;quot;actPlayDisc&amp;quot;, {&lt;br /&gt;
        x:x,&lt;br /&gt;
        y:y&lt;br /&gt;
    });&lt;br /&gt;
},&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we do here is:&lt;br /&gt;
* We stop the propagation of the Javascript &amp;lt;code&amp;gt;onclick&amp;lt;/code&amp;gt; event. Otherwise, it can lead to random behavior so it&#039;s always a good idea.&lt;br /&gt;
* We get the x/y coordinates of the square by using &amp;lt;code&amp;gt;evt.currentTarget.id&amp;lt;/code&amp;gt;&lt;br /&gt;
* We check that clicked square has the &amp;lt;code&amp;gt;possibleMove&amp;lt;/code&amp;gt; class, otherwise we know for sure that we can&#039;t play there.&lt;br /&gt;
* Finally, we make a call to the server using BGA &amp;lt;code&amp;gt;bgaPerformAction&amp;lt;/code&amp;gt; method with argument x and y. This call will check that &amp;lt;code&amp;gt;actPlayDisc&amp;lt;/code&amp;gt; action is possible, according to current game state (see &amp;lt;code&amp;gt;possibleactions&amp;lt;/code&amp;gt; entry in our &amp;lt;code&amp;gt;playerTurn&amp;lt;/code&amp;gt; game state defined above). This check is important to avoid issues if a player double clicks on a square.&lt;br /&gt;
&lt;br /&gt;
Now, we have to manage this &amp;lt;code&amp;gt;actPlayDisc&amp;lt;/code&amp;gt; action on the server side. Add a corresponding &amp;lt;code&amp;gt;actPlayDisc&amp;lt;/code&amp;gt; method in our game logic (&amp;lt;code&amp;gt;Game.php&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function actPlayDisc( int $x, int $y )&lt;br /&gt;
{&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(The function will be called when the front-side action is triggered using the Autowire mechanism, if you want to see how it works in details check [[Main game logic: Game.php|https://en.doc.boardgamearena.com/Main_game_logic:_Game.php#Actions_%28autowired%29]] )&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $player_id = intval($this-&amp;gt;getActivePlayerId()); &lt;br /&gt;
        &lt;br /&gt;
        // Now, check if this is a possible move&lt;br /&gt;
        $board = $this-&amp;gt;getBoard();&lt;br /&gt;
        $turnedOverDiscs = $this-&amp;gt;getTurnedOverDiscs( $x, $y, $player_id, $board );&lt;br /&gt;
        &lt;br /&gt;
        if( count( $turnedOverDiscs ) &amp;gt; 0 )&lt;br /&gt;
        {&lt;br /&gt;
            // This move is possible!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...now, we are using the &amp;lt;code&amp;gt;getTurnedOverDiscs&amp;lt;/code&amp;gt; method again to check that this move is possible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Let&#039;s place a disc at x,y and return all &amp;quot;$returned&amp;quot; discs to the active player&lt;br /&gt;
            &lt;br /&gt;
            $sql = &amp;quot;UPDATE board SET board_player=&#039;$player_id&#039;&lt;br /&gt;
                    WHERE ( board_x, board_y) IN ( &amp;quot;;&lt;br /&gt;
            &lt;br /&gt;
            foreach( $turnedOverDiscs as $turnedOver )&lt;br /&gt;
            {&lt;br /&gt;
                $sql .= &amp;quot;(&#039;&amp;quot;.$turnedOver[&#039;x&#039;].&amp;quot;&#039;,&#039;&amp;quot;.$turnedOver[&#039;y&#039;].&amp;quot;&#039;),&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            $sql .= &amp;quot;(&#039;$x&#039;,&#039;$y&#039;) ) &amp;quot;;&lt;br /&gt;
                       &lt;br /&gt;
            $this-&amp;gt;DbQuery( $sql );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... we update the database to change the color of all turned over disc + the disc we just placed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Update scores according to the number of disc on board&lt;br /&gt;
            $sql = &amp;quot;UPDATE player&lt;br /&gt;
                    SET player_score = (&lt;br /&gt;
                    SELECT COUNT( board_x ) FROM board WHERE board_player=player_id&lt;br /&gt;
                    )&amp;quot;;&lt;br /&gt;
            $this-&amp;gt;DbQuery( $sql );&lt;br /&gt;
            &lt;br /&gt;
            // Statistics&lt;br /&gt;
            $this-&amp;gt;incStat( count( $turnedOverDiscs ), &amp;quot;turnedOver&amp;quot;, $player_id );&lt;br /&gt;
            if( ($x==1 &amp;amp;&amp;amp; $y==1) || ($x==8 &amp;amp;&amp;amp; $y==1) || ($x==1 &amp;amp;&amp;amp; $y==8) || ($x==8 &amp;amp;&amp;amp; $y==8) )&lt;br /&gt;
                $this-&amp;gt;incStat( 1, &#039;discPlayedOnCorner&#039;, $player_id );&lt;br /&gt;
            else if( $x==1 || $x==8 || $y==1 || $y==8 )&lt;br /&gt;
                $this-&amp;gt;incStat( 1, &#039;discPlayedOnBorder&#039;, $player_id );&lt;br /&gt;
            else if( $x&amp;gt;=3 &amp;amp;&amp;amp; $x&amp;lt;=6 &amp;amp;&amp;amp; $y&amp;gt;=3 &amp;amp;&amp;amp; $y&amp;lt;=6 )&lt;br /&gt;
                $this-&amp;gt;incStat( 1, &#039;discPlayedOnCenter&#039;, $player_id );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... now, we update both player score by counting all disc, and we manage game statistics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Notify&lt;br /&gt;
            $this-&amp;gt;notify-&amp;gt;all( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ), array(&lt;br /&gt;
                &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
                &#039;player_name&#039; =&amp;gt; $this-&amp;gt;getActivePlayerName(),&lt;br /&gt;
                &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
                &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
                &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
            ) );&lt;br /&gt;
&lt;br /&gt;
            $this-&amp;gt;notify-&amp;gt;all( &amp;quot;turnOverDiscs&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
                &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
                &#039;turnedOver&#039; =&amp;gt; $turnedOverDiscs&lt;br /&gt;
            ) );&lt;br /&gt;
            &lt;br /&gt;
            $newScores = $this-&amp;gt;getCollectionFromDb( &amp;quot;SELECT player_id, player_score FROM player&amp;quot;, true );&lt;br /&gt;
            $this-&amp;gt;notify-&amp;gt;all( &amp;quot;newScores&amp;quot;, &amp;quot;&amp;quot;, array(&lt;br /&gt;
                &amp;quot;scores&amp;quot; =&amp;gt; $newScores&lt;br /&gt;
            ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... then we notify about all these changes. We are using for that 3 notifications (&amp;lt;code&amp;gt;playDisc&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;turnOverDiscs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;newScores&amp;lt;/code&amp;gt; that we are going to implement on client side later). Note that the description of the &amp;lt;code&amp;gt;playDisc&amp;lt;/code&amp;gt; notification will be logged in the game log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Then, go to the next state&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &#039;playDisc&#039; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new \BgaSystemException( &amp;quot;Impossible move&amp;quot; );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... finally, we jump to the next game state if everything goes fine (&amp;lt;code&amp;gt;playDisc&amp;lt;/code&amp;gt; is the name of a transition in the &amp;lt;code&amp;gt;playerTurn&amp;lt;/code&amp;gt; game state description above which leads to state 11 which is &amp;lt;code&amp;gt;nextPlayer&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
To make the statistics work, we have to initialize them in &amp;lt;code&amp;gt;stats.json&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;player&amp;quot;: {&lt;br /&gt;
    &amp;quot;discPlayedOnCorner&amp;quot;: {&lt;br /&gt;
      &amp;quot;id&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;Discs played on a corner&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;int&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;discPlayedOnBorder&amp;quot;: {&lt;br /&gt;
      &amp;quot;id&amp;quot;: 11,&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;Discs played on a border&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;int&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;discPlayedOnCenter&amp;quot;: {&lt;br /&gt;
      &amp;quot;id&amp;quot;: 12,&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;Discs played on board center part&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;int&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;turnedOver&amp;quot;: {&lt;br /&gt;
      &amp;quot;id&amp;quot;: 13,&lt;br /&gt;
      &amp;quot;name&amp;quot;: &amp;quot;Number of discs turned over&amp;quot;,&lt;br /&gt;
      &amp;quot;type&amp;quot;: &amp;quot;int&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A last thing to do on the server side is to activate the next player when we enter the &amp;lt;code&amp;gt;nextPlayer&amp;lt;/code&amp;gt; game state (in the &amp;lt;code&amp;gt;modules/php/Game.php&amp;lt;/code&amp;gt; file, under &amp;quot;Game state reactions&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function stNextPlayer(): void&lt;br /&gt;
    {&lt;br /&gt;
        // Active next player&lt;br /&gt;
        $player_id = intval($this-&amp;gt;activeNextPlayer());&lt;br /&gt;
&lt;br /&gt;
        // Check if both player has at least 1 discs, and if there are free squares to play&lt;br /&gt;
        $player_to_discs = $this-&amp;gt;getCollectionFromDb( &amp;quot;SELECT board_player, COUNT( board_x )&lt;br /&gt;
                                                       FROM board&lt;br /&gt;
                                                       GROUP BY board_player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
        if( ! isset( $player_to_discs[ null ] ) )&lt;br /&gt;
        {&lt;br /&gt;
            // Index 0 has not been set =&amp;gt; there&#039;s no more free place on the board !&lt;br /&gt;
            // =&amp;gt; end of the game&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &#039;endGame&#039; );&lt;br /&gt;
            return ;&lt;br /&gt;
        }&lt;br /&gt;
        else if( ! isset( $player_to_discs[ $player_id ] ) )&lt;br /&gt;
        {&lt;br /&gt;
            // Active player has no more disc on the board =&amp;gt; he looses immediately&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &#039;endGame&#039; );&lt;br /&gt;
            return ;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // Can this player play?&lt;br /&gt;
&lt;br /&gt;
        $possibleMoves = $this-&amp;gt;getPossibleMoves( $player_id );&lt;br /&gt;
        if( count( $possibleMoves ) == 0 )&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
            // This player can&#039;t play&lt;br /&gt;
            // Can his opponent play ?&lt;br /&gt;
            $opponent_id = (int)$this-&amp;gt;getUniqueValueFromDb( &amp;quot;SELECT player_id FROM player WHERE player_id!=&#039;$player_id&#039; &amp;quot; );&lt;br /&gt;
            if( count( $this-&amp;gt;getPossibleMoves( $opponent_id ) ) == 0 )&lt;br /&gt;
            {&lt;br /&gt;
                // Nobody can move =&amp;gt; end of the game&lt;br /&gt;
                $this-&amp;gt;gamestate-&amp;gt;nextState( &#039;endGame&#039; );&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {            &lt;br /&gt;
                // =&amp;gt; pass his turn&lt;br /&gt;
                $this-&amp;gt;gamestate-&amp;gt;nextState( &#039;cantPlay&#039; );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
            // This player can play. Give him some extra time&lt;br /&gt;
            $this-&amp;gt;giveExtraTime( $player_id );&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &#039;nextTurn&#039; );&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, when we play a token, the rules are checked and the token appears in the database.&lt;br /&gt;
&lt;br /&gt;
[[File:reversi9.jpg]]&lt;br /&gt;
&lt;br /&gt;
Of course, as we don&#039;t manage notifications on client side, we need to press F5 after each move to see the changes on the board.&lt;br /&gt;
&lt;br /&gt;
== Make the move appear automatically ==&lt;br /&gt;
&lt;br /&gt;
Now, what we have to do is process the notifications sent by the server and make the move appear on the interface.&lt;br /&gt;
&lt;br /&gt;
In our &amp;lt;code&amp;gt;setupNotifications&amp;lt;/code&amp;gt; method in &amp;lt;code&amp;gt;reversi.js&amp;lt;/code&amp;gt;, we tell BGA to listen to notifications we will add later (&amp;lt;code&amp;gt;playDisc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;turnOverDiscs&amp;lt;/code&amp;gt;) using promise-based notifications:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setupNotifications: function()&lt;br /&gt;
        {&lt;br /&gt;
            console.log( &#039;notifications subscriptions setup&#039; );&lt;br /&gt;
&lt;br /&gt;
            // automatically listen to the notifications, based on the `notif_xxx` function on this class.&lt;br /&gt;
            this.bgaSetupPromiseNotifications();&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will associate each of our 3 notifications with a method prefixed with &amp;lt;code&amp;gt;notif_&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s have a look now on the &amp;lt;code&amp;gt;playDisc&amp;lt;/code&amp;gt; notification handler method:&amp;lt;pre&amp;gt;&lt;br /&gt;
notif_playDisc: async function( args )&lt;br /&gt;
        {&lt;br /&gt;
            // Remove current possible moves (makes the board more clear)&lt;br /&gt;
            document.querySelectorAll(&#039;.possibleMove&#039;).forEach(div =&amp;gt; div.classList.remove(&#039;possibleMove&#039;));&lt;br /&gt;
        &lt;br /&gt;
            await this.addDiscOnBoard( args.x, args.y, args.player_id );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No surprise here, we re-used some existing stuff to:&lt;br /&gt;
* Remove the highlighted squares.&lt;br /&gt;
* Add a new disc on board, coming from player panel. That&#039;s where the async await part of &amp;lt;code&amp;gt;addDiscOnBoard&amp;lt;/code&amp;gt; becomes useful.&lt;br /&gt;
&lt;br /&gt;
Now, here&#039;s the method that handles the &amp;lt;code&amp;gt;turnOverDiscs&amp;lt;/code&amp;gt; notification:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        animateTurnOverDisc: async function(disc, targetColor) {&lt;br /&gt;
            const squareDiv = document.getElementById(`square_${disc.x}_${disc.y}`);&lt;br /&gt;
            const discDiv = document.getElementById(`disc_${disc.x}_${disc.y}`);&lt;br /&gt;
            &lt;br /&gt;
            squareDiv.classList.add(&#039;flip-animation&#039;);&lt;br /&gt;
            await this.wait(500); // for the flip animation to finish&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            discDiv.dataset.color = targetColor;&lt;br /&gt;
&lt;br /&gt;
            const parallelAnimations = [{&lt;br /&gt;
                keyframes: [ // flip the disc&lt;br /&gt;
                    { transform: `rotateY(180deg)` },&lt;br /&gt;
                    { transform: `rotateY(0deg)` },&lt;br /&gt;
                ]&lt;br /&gt;
            }, {&lt;br /&gt;
                keyframes: [ // lift the disc&lt;br /&gt;
                    { transform: `translate(0, -12px) scale(1.2)`, offset: 0.5 },&lt;br /&gt;
                ]&lt;br /&gt;
            }];&lt;br /&gt;
&lt;br /&gt;
            await this.animationManager.slideAndAttach(discDiv, squareDiv, { duration: 1000, parallelAnimations });&lt;br /&gt;
            &lt;br /&gt;
            squareDiv.classList.remove(&#039;flip-animation&#039;);&lt;br /&gt;
            await this.wait(500); // for the flip animation removal to finish&lt;br /&gt;
        },&lt;br /&gt;
        &lt;br /&gt;
        notif_turnOverDiscs: async function( args )&lt;br /&gt;
        {&lt;br /&gt;
            // Custom sound effect&lt;br /&gt;
            if (this.getGameUserPreference(this.preference_sound) == 1 &amp;amp;&amp;amp; !g_archive_mode) {&lt;br /&gt;
                this.sounds.play(&#039;play&#039;);&lt;br /&gt;
                this.disableNextMoveSound();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // Update score&lt;br /&gt;
            Object.entries(args.scores).forEach(([playerId, newScore]) =&amp;gt; {&lt;br /&gt;
                this.scoreCtrl[playerId].toValue( newScore );&lt;br /&gt;
            });&lt;br /&gt;
&lt;br /&gt;
            // Get the color of the player who is returning the discs&lt;br /&gt;
            const targetColor = this.gamedatas.players[ args.player_id ].color;&lt;br /&gt;
&lt;br /&gt;
            // wait for the animations of all turned discs to be over before considering the notif done&lt;br /&gt;
            await Promise.all(&lt;br /&gt;
                args.turnedOver.map(disc =&amp;gt; &lt;br /&gt;
                    this.animateTurnOverDisc(disc, targetColor)&lt;br /&gt;
                )&lt;br /&gt;
            );&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list of the discs to be turned over has been made available by our server side code in &amp;lt;code&amp;gt;args.turnedOver&amp;lt;/code&amp;gt; (see previous paragraph). We loop through all these discs, and trigger a single disc animation using &amp;lt;code&amp;gt;animateTurnOverDisc&amp;lt;/code&amp;gt;. This function creates a complex animation using [[BgaAnimations]] for the disc in parameter.&lt;br /&gt;
&lt;br /&gt;
We create a chain of 3 animations using await to make the square highlight, then flip the token, then remove the square highlight.&lt;br /&gt;
&lt;br /&gt;
And Also the notification to update the scores:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
notif_newScores: async function( args )&lt;br /&gt;
        {&lt;br /&gt;
            for( var player_id in args.scores )&lt;br /&gt;
            {&lt;br /&gt;
                var newScore = args.scores[ player_id ];&lt;br /&gt;
                this.scoreCtrl[ player_id ].toValue( newScore );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add a debug function to help up test the code ==&lt;br /&gt;
Add this at the end of your Game.php file :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function debug_playToEndGame() {&lt;br /&gt;
      while (intval($this-&amp;gt;gamestate-&amp;gt;state_id()) &amp;lt; ST_END_GAME) {&lt;br /&gt;
        $state = intval($this-&amp;gt;gamestate-&amp;gt;state_id());&lt;br /&gt;
        switch ($state) {&lt;br /&gt;
          case ST_PLAYER_PLAY_DISC:&lt;br /&gt;
            $args = $this-&amp;gt;argPlayerTurn();&lt;br /&gt;
            $possibleMoves = $args[&#039;possibleMoves&#039;];&lt;br /&gt;
            $possibleXs = array_keys($possibleMoves);            &lt;br /&gt;
            $x = $possibleXs[bga_rand(0, count($possibleXs) - 1)];&lt;br /&gt;
            $possibleYs = array_keys($possibleMoves[$x]);            &lt;br /&gt;
            $y = $possibleYs[bga_rand(0, count($possibleYs) - 1)];&lt;br /&gt;
&lt;br /&gt;
            $this-&amp;gt;actPlayDisc($x, $y);&lt;br /&gt;
            break;&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This function plays automatically until we reach the end of the game. The functions starting with &amp;quot;debug_&amp;quot; can be triggered in the Studio with a special menu.&lt;br /&gt;
Start a new game, click on the Bug icon on the top left then &amp;quot;playToEndGame&amp;quot;. You should see the game randomly playing until it reaches the end game, so it helps you check the animations, and you can see if the final scoring is also working as expected.&lt;br /&gt;
You can create as many debug function as you like!&lt;br /&gt;
&lt;br /&gt;
== After the tutorial ==&lt;br /&gt;
You might want to check another tutorial, or start working on your first real project !&lt;br /&gt;
&lt;br /&gt;
[[Create a game in BGA Studio: Complete Walkthrough]]&lt;br /&gt;
[[Category:Studio]]&lt;/div&gt;</summary>
		<author><name>Augment reality</name></author>
	</entry>
</feed>