Il gioco della scopa J2ME

The story

In 2006 I joined the ArtLife team – of the InfoByte company – as a video games developer for the J2ME platform.

This represented the second project that was entrusted to me. The idea was to make one of the games that until then had few competitors into the H3G mobile phone store.

It is a well known and appreciated card game in Italy called “La Scopa”. In this game two or four players in turn – our goal was the only two-player version – try to score as many points as possible by winning the cards that are placed “on the table” with the cards they own, following simple rules.

A player can win a card on the table if he own a card of the same value, or he can take more cards whose sum equals the value of one owned. When a player cannot conquer cards he is forced to choose one of his to put on the table. If instead a player wins all the cards left at the table then he does “Scopa” and is given an extra point.

The slightly more complex part is related to the calculation of the final score and some details are outside the scope of this article, so only the most general will be exposed.

However, given my enthusiasm for this project, I was given carte blanche for its realization. Thus began an adventure lasting about a couple of months during which I realized the graphics, the music and the code.

To avoid problems with copyrights I did a complete redesign in pixel art of the card images starting from the original ones. With music, on the other hand, I needed to use the software Band in-a-box to produce an adequate soundtrack.

The game was a success that I had not expected, in fact were purchased around 3000 copies on the H3G WAP store.

The game

The main menu

The purpose of a main menu is to allow access to all the features of a game.

The main menu

At that time I was very attracted by the first versions of “handheld” devices – the predecessors of modern smartphones. So to organize the layout of informative screens, including navigation commands, I created the appearance of a handheld device with some buttons at the bottom with variable functionalities (to move forward or back between the pages, selecting options or returning to the main menu).

The “Rules” submenu

Despite the fact that in Italy the game is very well known, there is still some confusion regarding its rules, also due to the existence of numerous variants which, in some cases, even alter the mechanism of the game itself.

For this reason from the main menu, by selecting the “Regole” (Rules) item, it is possible to access an area where the “official” rules are illustrated (which are those adopted by the game).

The “Info” submenu

The “Info” submenu item also led to a series of informative screens regarding the commands to be used during the game, and the credits (where as you can see my name appears in all the areas related to the development of the game).

The “Play” submenu

By selecting “Gioca” (Play) the player could, before actually starting, select the difficulty level (determined by the strength of the artificial intelligence) and the maximum score that one of the two players had to reach in order to consider a game closed and declare the winner.

The application can also allow you to resume an interrupted game by the point where it was suspended. If this condition occurs a special item will appear in the menu.

Screen shown after selecting “Play” on main menu

Other commands of the main menu permit to turn off the background music (the game has no sound effects) and exit the application.

Gameplay

As already mentioned the game takes place between two opposing players, usually placed one in front of the other.

The cards are collected in a deck of 40 elements and are divided into four different genres: coins, cups, swords and sticks. Each of these four groups is composed of 10 cards whose value is in the scale from 1 to 10.

The Coins suit
The Cups suit
The Swords suit
The Sticks suit

By the modalities that I will explain later, the purpose of both players is to win as many cards as possible because, according to the rules adopted, some cards or combinations of them give extra points.

Initially the player who must make the first move is chosen. The program uses a draw system in which each player is given a card and the one who owns the highest one is entitled to play first. If two cards of the same value are drawn then two more cards are extracted until a winner is defined.

The selection of the player who is entitled to make the first move.

The initial phase of the game consists in shuffling the cards in the deck to get a random distribution of these. After that each player is dealt three cards starting with the one that must make the first move. Finally, four cards are placed on the table as a starting point for the game.

The arrangement of the cards at the beginning of a game.

From this moment, in turn, the players try to catch the cards on the table – if possible – or throw them on it. Remember that the basic rule for winning cards is that a player can take a card with the same value or more cards whose summed value corresponds to that of the card he own.

The player selects a card of equal value.
The player selects two cards whose summed value corresponds to that of the card he owns.

If a player can take all those remaining on the table, he is entitled to an extra point called “Scopa” (this is where the game takes its name).

The cards won are set aside in a deck owned by the player, which will be used at the end of the game to calculate the final score.

When the players finish all the cards they own, three more are dealt to each one. This process continues until the cards that make up the deck are finished.

In this phase the score obtained by each player are counted, in particular a point is assigned when each of these conditions occurs:

  • The player has won more than half of the cards in the deck (21 or more)
  • The player has won more than half of the “money” cards (6 or more)
  • The player has won the “Settebello” card (the card with value seven of the Coins suit)
  • The player has won the “Primiera” which is a bit complicated to verify and is generally simplified by counting the number of cards of value seven and six

To these points, which at most can be 4, are added the extra points represented by each “Scopa” (as mentioned, the times in which a player wins all the cards left on the table). It often happens that at the end of the game there is no advantage of one player over the other in terms of the conditions necessary for the assignment of one of these points (except for the “Settebello” which is necessarily captured by one of the two) in this case the specific point is not assigned to anyone.

Summary of points obtained by a player at the end of the game.

Now the players’ scores are compared. If one of the two exceeds the decided minimum score (usually 11 or 16) he is declared the winner. If the score of both exceeds the minimum then the player with the highest score is declared the winner.

End of the second game where the computer scored 2 points while the player scored 1 point. In this case they will proceed for another game.

In case of a draw, or if neither of the two exceeds the victory score, another game is played and the scores of this are added to those of the previous.

Commands

The controls for a player are very simple. A move takes place in two phases: selection of the card to be played among those owned and selection of the cards among those on the table.

In both phases the player can use the 4 and 6 keys to move the selector to the left and to the right respectively. Use key 5 to select the cards.

This image shows the card selector

Once the card to be played has been selected, the selector automatically switches to the selection of the cards on the table.

Here the first of the cards available to the player was selected

During this phase, if key 5 is pressed again on a selected card, it is deselected.

Now the card to be conquered has been selected

Once the player has made the selection of the move to be made he can press the 1 key to apply it or the 3 key to cancel the entire selection and return to the first phase.

Downloads

Leave a Reply

Your email address will not be published. Required fields are marked *