Building "Monopoly" in Shortcuts - Update #1: The Beginning of Something Terrible
As it had been a few months since my last post on building un-productive things in iOS Shortcuts, I felt like it was time to get back in the game and build something new. I knew that I wanted to create a game of some sort, though I didn’t feel quite up to perfecting the roguelite engine that I had painstakingly laid out previously— largely because, let’s face it, it’s a pain in the ass.
What I settled on was that I should use Shortcuts to build a local multiplayer game; something that used the phone and the power of Shortcuts, but still relied on good old-fashioned human interaction. Examples like Spaceteam and the Exploding Kittens apps were two of the big inspirations. Rather than starting from scratch, I wanted to emulate an existing game that most people would at least sort of know the rules of, saving me the burden of explanation.
The result, I’m sorry to say, is that I’ve started building Monopoly in Shortcuts.
If you are reading this on an iOS device with Shortcuts installed, you can run the current version of the game using this link:
It’s important to note that the current version is just barely playable, and well below the minimum viable product for a Monopoly clone, but it’s been about a week since I’ve had time to work on it, so I wanted to share where it was at right now.
What it has:
Support for 2-6 local players
Emojis instead of token pieces
Full Monopoly board
Roll dice for movement
Purchase properties, stations, and utilities. Each space keeps track of its owner, so you can’t buy another player’s property.
Each player gets their own money to spend
Players get $200 each time they pass Go
All of the Chance and Community Chest cards from the U.S. version of the game
Income Tax/Luxury Tax spaces
What it does not yet have:
The Community Chest cards don’t do anything yet
The Chance cards have minimal functionality, certain cards don’t do what they say they do
Landing in/getting out of Jail
An end state
What it will probably never have:
Roughly How It Works:
Lists. I’ve used Lists for basically everything here.
The board is a list, where each item contains the space’s name, colour, purchase cost, rental cost, and owner, as an array separated by forward slashes (“/”). I use the slashes a lot here to spoof a two-dimensional array, so if I need a particular part of the space’s information (like the name), I grab the list variable, “get item in list” based on which item I need, “split text” by “/”, and “get item in list” to grab the specific item I need.
The players’ cash-on-hand, token, and board position are all separate lists, where the index matches the player’s spot in the turn order. When I need a bit of player info, I just grab the relevant list variable, and “get item in list” by the current player’s number (1 through 6). If I ever get around to figuring out monopolies, I’ll probably have a list to catalogue how many spaces of each colour each player owns.
Repeats. There are two sort of “core” repeat functions.
The big loop: After the more universal variables and lists have been set, I wrap the whole of the “gameplay” in one big loop, set to repeat an insane number of times. Because Shortcuts doesn’t give us custom functions or “loop forever” support, I get around this by taking a number function, and mashing the 9 key until my thumb gets tired (there is a max value for the number, but it’s something like 1^10*25). Passing this value to the repeat lets it loop until the heat death of the universe, or at least until someone accidentally hits “cancel”. This means that the game won’t end after the first round.
The turn loop: Immediately inside the #BigLoop is another repeat function that loops a number of times equal to the number of players (which is the first question asked of the user). This benefits us in two ways:
When all of the players have taken a turn, we can perform “end of round” actions, like ranking charts or special events.
“Repeat Index 2” == the current player, so we have an easy way of finding the information pertinent to the person whose turn it is, and no one else.
Even smaller loops: There are a few places where I need to update a player’s information inside of one of the lists. Because Shortcut’s doesn’t really let us update items in the middle of lists, we use short loops to achieve this. Each one looks roughly like this:
Define which list we’re updating data in
Repeat for “number of players”
If “repeat index 3” (because we’re in the big and turn loops) equals “current player”
Get whatever relevant variable
Add it to a temporary variable
Get item from the list we’re updating, at the “repeat index 3” index
Add it to a temporary variable
Get that temporary variable
Split text by new lines
Set variable so that it overrides the original list
It’s a bulkier workaround than I would like, however it lets us reliably update things as needed. We used this to update the player’s money and positions at the end of each turn, plus it’s how we handle payments in the middle of each turn.
Add in paying rent to a player when you land on a space they own. (I know how I want to do this, I just need to make the time for it.)
Add alerts and rules for bankruptcy.
Add an endgame event, and win conditions.
I genuinely don’t know if I want to bother adding houses/hotels. I might rather adjust the dollar values and some minor rules to make this more of a “Speed Monopoly” so that it’s more tenable for a mobile experience.
I would add “make it fun” as a next step here, but, come on. It’s Monopoly.