Recommendation for specific type of game

Game development with Board Game Arena Studio
Post Reply
User avatar
Dr Strangegame
Posts: 36
Joined: 08 January 2013, 04:42

Recommendation for specific type of game

Post by Dr Strangegame »

Hi, I am working on my first game.
Is there any current games that feature the following (or are similar)? If the game is very simple, that would be best.

All players can pick a card from their hand of cards that were dealt to them. Then, once all players have picked the card, they can decide where to play the card.
For example, if they want to put that card on their player board, they can do that. Or, if they want to put that card in a storage container that holds 4 card max (to use later), they can do that.
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Recommendation for specific type of game

Post by RicardoRix »

Firstly, I'd say just mess around with one of the basic tutorial projects. Probably focus on the UI to start with.
You can do stuff for the UI in the game.js file.
Add a button, click a card and perhaps add an event listener. The 'debugger' statement and F12 console is really neat for helping you debug.
After you're comfortable with all that. Start with your new blank project:

Do the setup() stuff both ends php and js to pass all the data required to the client. But in theory for now, you could skip this part. But know that this always happens at page refresh.
Now add all the UI stuff you require. It feels like you need to dynamically switch between 'card selected' and 'card not selected'. It's possible to do that with 2 different game states, but it's a bit overkill, just handle it all in the UI. (a page refresh is always going to take you back to the start).
At the end of the card selection process, you need to call bgaPerformAction() and send the choice to the server, something like

Code: Select all

this.bgaPerformAction('actPlayCard', {card_id: id});
Here is where you will go over to the game.php, and pick up the user action to save stuff to the DB on the server. This action function end with a simple notification back to the UI.
Really, really simply to get that off the ground:

in states.php - add action 'actPlayCard' to list of possible actions

Code: Select all

 'possibleactions' => ['actPlayCard', ........]
in game.php

Code: Select all

use \Bga\GameFramework\Actions\Types\IntParam;

public function actPlayCard(#[IntParam(name: 'card_id')] int $cardId)
{
	$this->notifyAllPlayers( 'log', 'just selected a card', [] ); 
}
https://en.doc.boardgamearena.com/Creat ... alkthrough
Last edited by RicardoRix on 25 May 2025, 16:18, edited 5 times in total.
User avatar
Dr Strangegame
Posts: 36
Joined: 08 January 2013, 04:42

Re: Recommendation for specific type of game

Post by Dr Strangegame »

Awesome, thanks for this info, appreciated.
I did finish the Hearts tutorial and I have been playing s little with a test game. Since I only do this on spare time, it's been very challenging.
User avatar
thunder0491
Posts: 9
Joined: 10 April 2023, 11:37

Re: Recommendation for specific type of game

Post by thunder0491 »

I think you could take a look at Hanabi. Players can play cards from their hand or they can discard them(which could be as storing them in a special place like you need) Good luck
User avatar
Dr Strangegame
Posts: 36
Joined: 08 January 2013, 04:42

Re: Recommendation for specific type of game

Post by Dr Strangegame »

Thank you, I'll check it out
Post Reply

Return to “Developers”