Game: 5 in a row

Preview Link:

Link to Game Editor

A simple turn based game of getting 5 in a row on a board of 9 x 9 (81) boxes. Each player play on her own device. One person start of the game by inviting, the other then join. Then it’s on the way.

Basic Tech

  • The board is a Repeating Group fixed with 9 by 9 cells of thing Box. A box holds only an ID (to get sorted correctly) and which player is owning the box. Each Box thing is pre-created and only changed in the game.
  • The hidden group Game holds the thing Game with all game settings (it also shows some data used to debug).
  • Both player’s clients share the same Boxes and Game things.
  • There is (deliberately) no logging in. Still I use the User to store user data during the game.
  • Since the players are on different clients there is a small special handling when the game is over (won, not canceled).

The Fun Tech
There are two slightly more interesting concepts in the game:

  • Highlighting the boxes the user is allowed to choose. See workflow folder Highlight. Data is stored in states in element Board. First the x and y position of the box is calculated. Then each of the 8 boxes surrounding the selected box is checked if it should be highlighted for next selection (by the other player). If the box is empty then it’s Owner is changed to 0 indicating getting highlighted.
  • Checking if the current selected box gave the current player 5 in a row (winning). See workflow folder InRow. The workflow structure is based on setting delta values to work from the selected box’s x and y position. This makes the workflows reusable as they are parameterised. They are numbered; 0 = master workflow, 1-4 = one for each direction to check in, 9 = commonly used by the in 1-4. The real fun happens in 9.InRowDoCheck and 9.InRowGetNextID.

Thoughts of extensions

  • Many games to be live at the same time. Select opponent by random or a friend list. Save scores (shortest time, fewest markers placed…)
  • More than 2 players per game.
  • Allow dynamic number of tiles in a row.
3 Likes

Great UI, @philledille! I like the simple lobby of Invite / Join.

I was surprised at how many workflows are needed.

Thanks @mishav. I didn’t optimise on workflow number. I bet there could be improvements.

It goes straight to the homepage

For me too. I don’t understand why. The link is to the app editor index page (I checked to see the content). @mishav, how did you get it right?

If you click on the preview button we able to see your game.

Can you see it in the editor as well - this was my intention.

Nop, it just goes straight to the bubble.is home page

I set the app to Everyone can edit. Maybe now you can see it in the editor? (please don’t modify it :slight_smile:)

It not working for me, I think it might work for others.

Its the forum turning the ampersands & into & in the link.
One way around it is to use the hyperlink button, but then I think you miss out on the preview.

Thnx @mishav. I’ve added a link in the original post that seems to work. Please try @wfarrell73.

It working now, thank you for fixing it.

There is a challenge I have not solved. When a player clicks Invite there is some time before the second player’s client gets the updated data that will hide the Invite button and show the Join button. So, there is a chance that both players click Invite and therefore are locked in waiting for the other player to join.

Impressive!
Gratulerar! philledille! Jag gillade allt! färgerna, typsnittet, stilrent. Du gjorde ett riktigt bra jobb.
Jag bor i Göteborg, var bor du någonstans, ifall vi kunde bedriva någon sorts samarbete inom andra områden (men bubblebaserat iofs)
Gino

Tack @gino! Såg att mina sista inlägg i din “svensk-tråd” försvann. Bubble hade lite teknikproblem med forumet. Såg du mitt tips om Lounge Hackers? Jag tänkte gå på det någon gång - kan vara ett bra ställe att hooka upp.

1 Like

Started to add options that let the players tweak the game. First out is:

  • Play 4 in a row.
  • Must place brick within 30 seconds.
  • Free placing.