Executive Summary

Abstract of Game Story

The game is a strategy card game called, Basra, which is based on an actual card game. This game is usually played by adults but it can be played by kids or teenagers who have interest in strategy card games. Some memory skills are required, since the player needs to recall if certain cards are still in the deck, or not, before making decisions on what cards to throw during the course of the game.

The object of this card game is to get a score of 151 before the opponent does. If both players reach that score, then the player with the highest score wins.
To get 151 points faster, any card can be turned into a Basra which if successful, that card will have double the score of the face value.

Game play and appearance

This is a strategy card game. The object of the game is to score more points than the opponent. The one who get a score of 151 points first wins the game. If both opponents get over 151 points then the one with the most scores win. The game is played with 44 cards, discarding queens and kings

Only certain cards have score points, shown below. To get those score points, the player has to play a card, that matches the one on the table, and take both cards. Matched cards are discarded until the next card deck is reshuffled. Only one card is thrown down at a time, but a player can take more than one two cards by matching cards that “add up” to a played card. For an example, if the table has an Ace and a Deuce, the next player in line can take those cards with a Five. Card suits don’t matter unless they have score values.

The game starts with the dealer dealing 5 cards to each player, there are two players, the computer and the user. The computer cards are dealt face down and the user cards are dealt face up. Four cards are dealt on the table face up during the first deal of each card deck. The table will not get another 4 cards until the card deck is re-shuffled again. Players take turn dealing after each card deck is played. The dealer plays last.
Scores are as follows:

PointsFace ValueSuit

2 points Deuce Club

3 points 10 Diamond

2 points Jack all four

1 point Ace all four
The player earns those scores if the played card matches cards on the table. Matching can be done by one to one or many to one matches. Many to one matches are done if more than one card add up to a played card. Identical cards on the table can be considered one to one, or many to one. For an example, two deuces on the table can be taken with one Four or one Deuce face cards. Another example, four deuces, very unlikely, on the table can be taken with one Four, or one Deuce, or an Eight face cards.
The player can earn extra points, that is what make the game exciting, by turning a card into a Basra card.double face value Basra. double face value (aces count as 1, 2’s count as 4, 3’s count as 6, and so on. Jack basra’s are 25 points
To get a Basra, first, get all the cards on the table with an Ashoush (the Jack) And if a player, whose turn is next, throws a card, and the next player, whose turn is next, has that card, then that card is a Basra. It counts as double.

Game Genre

The Basra game is a strategy card game that is usually played by adult males, or females. Playing the game relies on good card counting skills. A successful player will memorize what cards left the game and hence which ones the opponents might have.

Product Specification

Target Audience

The Basra game is created for adults who like strategy card games. The main target audience for this game is late 20’s and older, males or females. This target age decision is made because of the actual age group that usually play the actual game.

Game play time

Each game takes about 15 – 60 minutes. Some games will take longer, depending on how the cards fall and how much thought is put into the game by the player. Randomly generating a card deck offers the player a different game, just like other card games.

Production tools

Adobe Photoshop and Jasc Paintshop Pro, version 7.0 were used to create or edit existing images. All cards 44 playing cards were found on the internet and are in separate bitmap files.

Having separate bitmap image files was a concern at first as far as game play speed was concerned, but that it turned out a none issue.
CodeWright, version 6.5, was used for source code file editor, in addition to Visual Basic, because it is a more powerful editing tool
Winzip, version 6.0 was used to compress all the files into one for installation.

User Guide

How to Install The Game

All Files are zipped up in a basra.zip. Unzip this file using Winzip Application.

You can unzip the files in any directory but the sub-directory structure has to remain the same. The following are the subdirectories that are created by the WinZip application after unzipping the files:

. \Your Directory

Holds the main application Basra.exe, background.bmp for main interface bcackground image and tigerback.bmp for the card deck back image. Table.txt is loaded at run time to check for different combinations of number. This file should not be modified.

. \Your Directory\sound

Holds the *.wav sound files that are played during the game, shown below

. \Your Directory\images

Holds all the artwork and card images in bitmap format

The following shows the entire file needed to display all the game cards

2c.bmp

2d.bmp

2h.bmp

2s.bmp

3c.bmp

3d.bmp

jc.bmp

3h.bmp

3s.bmp

4c.bmp

4d.bmp

4h.bmp

4s.bmp

jc.bmp

5c.bmp

5d.bmp

5h.bmp

5s.bmp

6c.bmp

6d.bmp

jd.bmp

6h.bmp

6s.bmp

7c.bmp

7d.bmp

7h.bmp

7s.bmp

jh.bmp

8c.bmp

8d.bmp

8h.bmp

8s.bmp

9c.bmp

9d.bmp

js.bmp

9h.bmp

9s.bmp

ac.bmp

ad.bmp

ah.bmp

as.bmp

tc.bmp

td.bmp

th.bmp

ts.bmp

Bitmap Image Files

How To Play The Game

Menus

There are four main buttons:

Exit To exit the game

Deal New Hand To deal the next hand after all the cards for the present hand are played
Note: Only four cards are dealt open faced on the table in the first hand and only in that hand of every card deck shuffle, after the first deal only 5 cards are dealt to the computer, and 5 cards for the userNew Game To start a new Game

Help To get instructions on how to play the game
computer and user Score are shown on the left hand side. see Main Interface below

Exit Deal Next Hand New Game

Scoring

The player who gets a score of 151 points or more wins the game

The following are the cards that have scores, the player who end up with them will get those scores:

PointsFace ValueSuit

2 points Deuce Club

3 points 10 Diamond

2 points Jack all four

1 point Ace all four
Those are the natural score points of the game, 13 total, the player can get additional scores by making his/her card a Basra card which will earn double the face value in points, for an example, if the ten is made into a Basra, then the player that made it earns 20 points.
A Basra is attained by cleaning out the table cards by throwing down one card that is the sum of all the face values on the table, for an example, if the table has Ace and a Nine of any suit and no other cards, then if the player whose turn is next has a Ten of any suit takes all the cards and earn a Basra of Ten, That will earn the 20 points, plus the ace has 1 point, for a total of 21 points.

Another example , if there are 1 or 2 Five ‘s left on the table, then they can be taken by either a Five or a Ten cards, whichever the player has, preferably a Ten because it is more.

The Jack can not make a Basra but it is the best card to have because when it is thrown down by a player, he or she take all the cards on the table, and whatever the opponents throws down, unless it is a Jack, is potentially a Basra card.
In addition to a single card, two or more cards that will add up to a single card value can also add up to a Basra, for an example, the Ace, Deuce, and Four cards add up to the Seven card.
More than one set of combinations can add up to a single card, for an example

ACE, Deuce, Four, and Three cards can sum up to a Ten Card (20 points), or can be 2 different sums of Five Card, one Five card will make a Basra with those cards (10 points)

ACE, Four, ACE, and Deuce can sum up to an Eight Card (16 points,) or a Four Card (8 points)

Rules

There are only 44 cards in the card deck. Kings and Queens cards are thrown out.
The dealer will give each player 5 cards in each deal , or hand, and 4 cards are opened on the table in the first hand only. So if two players are in the game, in the first hand, 14 cards are dealt, in the second hand, only 10 cards are dealt, and so on until all the cards are dealt.
The players take turns dealing after no more cards are left in the card deck.
Jacks take all the cards from the table but cannot make a Basra card.
A card is only played once and at the end of the dealt card deck the score is counted and recorded, but in the computer game the score will be calculated instantly.
A player , in turn, takes any card from the table that he or she can match. Matching is done by matching one or more cards. For an example, a Five card can take another one or more Five cards, or it can take a one Deuce and one Three cards, or it can take two Deuce and two Three cards

Game Specification

What is it like to play the game?

The user interface for the game will be very simple with File, Options, Help, Quit options. Save game option can be offered in the File menu. User options can be added, namely, different card skins and character faces. Sounds and graphics will be implemented. Wav files are used to make the sound of shuffling or throwing cards. When Basra is won by the user, sounds will be played. Some character animation might be added, for an exaple, blinking of the eyes of the player to give the game a more realistic look.

Interface mockup

The main interface is shown below. Sounds are be played at certain parts of the game. For an example, a .wav file is played Basra is won by the player. Below is a mockup of the main game interface. Notice that the Eight card is lifted when the mouse goes over the card to give visual feed back to the user.

Summary of story line

The object of this card game is to win by earning a total score of 151, or more points. Only certain cards have a natural score points. Those points are called natural game points and are earned by the player who can match cards on the table. In addition to the natural points, extra point can be earned by turning a card into a Basra card.

The Basra card is what make the game exciting. Any card, except Jacks, can be made into a Basra card. A Basra card is a played card that take all the cards on the table by matching them. Matching is done by having a played card identical to one or more single value face card. Matching is also done by matching cards that add up to a single played card value. The player who get a Basra card get double the face value in points.

Storyboards

Below is examples of what is on the table and

= if the only 2 cards on the table is 2 and 4 as shown on the left and the player, whose turn is next has a 6 of any suite in hand (6 of hearts is shown, then that player has just won a basra, that is 12 points
= . if 9 of diamond is the only card left on the table and the next player in line has a 9 of hearts, then that player won a Basra

Character Bibles

The main character in the game is the user player, the computer is the other. If playing cards are considered characters, there are two main ones: the Jack and the Basra cards, which are descrived below.

Basra Card: Any card, except the jack, can be made into a basra card. To qualify for a Basra card, the card, when it is played, has to match all the existing cards on the table. Matching is done by having the face value match one or more other face values, or by having the face value as the sum of all the other face values.
Jack: A jack, of any suit, will take all the cards on the table. This forces the opponent to throw a card which potentially can be a Basra, if the player has that card
There are two characters, the player and the computer, if the game is played with only two players or four characters if the game is played with four players. The player can choose from four different character images to assume that charactersrole.

Level of Scene Outlines

There is only one difficulty level. The card deck is shuffled and new cards are played each time until the winner get 151 points. Then the game is over. But dealing new shuffled deck is not fixed.

Design Specification

Implementation Details

Visual Basic was used to produce the game. Sound and card animation was used.

Since Visual Basic is event driven, the player action were processed when a card image or a command button was pressed. Timer delay was used everytime the software changed images, like throwing down a card and removing it, to give the user enough time to see and absorb what just happened instead.
The player actions also generated the computer player turn procedure but after 2 seconds.

The main challenge in the game design was the algorithm to find what combination of values added up to a single card face value, after considerable considerations, it was implemented using a look up table, some of the combinations are shown below and are in file ‘table.txt'. This table was loaded into a 200 X 10 array at runtime from the text file. Shown below are three columns of combinations. The first number on the left is the face card value that can be made into a basra if the combinations on its right match, for an example,

2 1 1 0 0 0 0 0 0 0 0, means a Deuce will make a basra if there are only two Aces on the table, the zero indicate that there is no card in that table slot.

2 1 1 0 0 0 0 0 0 0 0

3 1 1 1 0 0 0 0 0 0 0

3 1 1 1 2 2 2 0 0 0 0

3 1 1 2 2 0 0 0 0 0 0

3 1 2 0 0 0 0 0 0 0 0

4 1 1 1 3 3 3 0 0 0 0

4 1 1 3 3 0 0 0 0 0 0

4 1 3 0 0 0 0 0 0 0 0

4 1 1 1 2 3 0 0 0 0 0

4 1 1 2 2 2 0 0 0 0 0

4 1 1 2 2 0 0 0 0 0 0

5 2 3 0 0 0 0 0 0 0 0

5 2 2 3 3 0 0 0 0 0 0

5 2 2 2 3 3 3 0 0 0 0

6 1 1 2 2 0 0 0 0 0 0

6 1 1 1 5 5 5 0 0 0 0

6 1 1 5 5 0 0 0 0 0 0

6 1 5 0 0 0 0 0 0 0 0

7 1 2 4 0 0 0 0 0 0 0

7 1 6 0 0 0 0 0 0 0 0

7 1 1 6 6 0 0 0 0 0 0

7 1 1 1 6 6 6 0 0 0 0

8 2 3 3 0 0 0 0 0 0 0

8 2 2 3 3 6 0 0 0 0 0

8 2 6 0 0 0 0 0 0 0 0

8 2 2 6 6 0 0 0 0 0 0

8 2 2 2 6 6 6 0 0 0 0

8 1 2 2 2 6 6 7 0 0 0

8 1 2 6 7 0 0 0 0 0 0

8 1 3 5 7 0 0 0 0 0 0

8 1 4 4 7 0 0 0 0 0 0

10 1 1 2 2 7 7 0 0 0 0

10 1 1 1 2 2 2 7 7 7 0

10 1 3 6 0 0 0 0 0 0 0

10 1 1 3 3 6 6 0 0 0 0

10 1 1 1 3 3 3 6 6 6 0

10 1 4 5 0 0 0 0 0 0 0

10 1 1 4 4 5 5 0 0 0 0

Notice that there are no number on the right hand match the first one on the left. Although a Deuce on the table with any of two Aces will still make a Basra, It can’t be entered into the table because it would make it very large. It was decided to check for the presence of a Deuce in the software, while checking combinations in this look up table.

To get a Basra in the game, the player has to match all existing cards on the table with the card in hand, for an example, the cards Ace, Deuce, Four, and Five on the table, can all add up to a Six (Five and Ace) and (Four and Deuce), all those cards can make a basra of Six.
Even if there is no Basra match, a sub match can also played but with no Basra, for an example, if the table cards are Ace, Deuce, Four, and Five and a Seven and the a played card of Eight, the Ace, Deuce, and Five add up to Eight, and so does the Ace, and Seven. In this case, either of the combination are valid plays and all the cards involved in either one of those matches, but not both, have to be remove from the table and given to the player that threw down the Eight.

This structure holds all information pertaining to all the table cards.

Private Type tableCardType

card(1 To 20) As Integer

numberOfCards As Integer

pictureIndex(1 To 20) As Integer

End Type

tableHandType Members

data type

Description

card (1 to 20)

Integer

all the cards on the table. table is not expected to have more than 20 cards

numberOfCards

Integer

indicates number of cards on the table

pictureIndex(1 To 20)

integer

array to indicate what Visual Basic image control is showing the table card

Card Deck Table

The idea for this table and its code were copied from the book Visual Basic 6, How To Program, By Deitel & Deitel, T.R. Nieto. The code was modified to start from 1 instead of 4.

the following definitions are related to generating the card deck:
sSuit(1 To 4)

A string array that holds the four card suits names as shown in the table below

sFace(1 To 11)

A string array that holds the ard values 1 to 11 as shown in the table below

aDeck(1 To 4, 1 To 11)

An integer 2-dimentional array that will hold a unique integer number from 1 to 44, this unique number is the for loop index at the time a random row, 1 to 11, and a random column, 1 to 4, were generated. See subroutine shuffleCards source code for insight on how this was done.

Ace

Deuce

Three

Four

Five

Six

Seven

Eight

Nine

Ten

Jack

1

2

3

4

5

6

7

8

9

10

11

Hearts

1

Diamonds

2

Clubs

3

Spade

4

aDeck (2, 4) represents Four of Diamonds

Pseudocode and algorithms

When the game starts, this is the first function that Visual Basic calls

Private Sub Form_Load()

Load all the images and initialize veriables

End Sub
When the user clicks on New Game the following subroutine is executed

Private Sub newGameCmd_Click()

Initialize variables

clear score

shuffle card

deal computer cards

deal user cards

deal table cards

End Sub

The user is given the chance to deal the cards when a button is pressed

This function determines if a play ends up in a basra this happens if card thrown has the same face value as all the cards on the table, or, all the cards on the table add up to the played card face value for and example: 2, 2, 3, 3 add up to one five, or one 10. 1, 1 add up to Deuce or can be one ACE

Public Sub processMatchedAdditiveCards(card As Integer, tempArray() As Integer, numberOfMatches As Integer)

This function finds if 2 or 3 cards add up to the played card

start out with no matched cards

store all card values in a temporary array and sort them

to make it easier to find additive combinations of

a card face value

copy the table cards and their location to a

temporary array

copyTableCardsValues(sorted(), indexes())

sort the table card values in ascending order

zeros are put on the end. zeros indicate a missing card

SortTableCardsFaceValues(sorted(), indexes())

now search for 2 cards that add up to one card

since the array is sorted, only cards smaller than

the played card should be check

For i = 1 To 10

If current value is not zero Then

If current value is greater than or equal played card value Then

larger number can't add up to smaller ones

Exit For

End If

check all the combinations

if we have a, b, c, d, e and we want to check if any 2 add up

combinations are :

a + b + c

a + b + d

a + b + e

b + c + d

b + d + e

c + d + e

now search for 3 cards that add up to one card

since the sorted array is sorted, only cards smaller than

the played card should be check

This is done similiarly to the above procedure

End Sub

Development environment

The game was be developed on Windows 98 using Microsoft Visual Basic, version 6.0. I originally spent time trying to develop it using DirectX and Visual C++, but too much time was being spent on learning how to use those tools instead of concentrating on producing the game itself.