rj
2013-11-11 20:54:00
So… I couldn't hold it any longer. The past month I have been developing a game using Simba. The name of the game: BlackJack. For those of you that don't know, BlackJack is the most popular American casino card game (http://en.wikipedia.org/wiki/Blackjack)
I was originally going to make a text base dicing game with the lape interpreter (https://github.com/officerBarbrady/Simba-BlackJack/commit/b3c8b9a360b83b889c5b5dec5ed95f5766a5ba71 aqs you can see it was called dicinggame lol). I got bored of that quick and wanted to make a more advanced gambling game. So then I thought to make a text based Blackjack game, (I wanted to Utilize Lape). I soon realised how boring, confusing and godawful the game play would be, and how annoying it would be to program it. So then I switched to pascalscript and began work on making a form based game.
Things that has been accomplished
- Card drawing. I have completed the card drawing portion, I tested it using a tlabel to draw a random card. This proved to be a challenge at first with many annoying bugs like this
[spoiler=media]
Eventually I got it
[/spoiler]
After aiming to have better graphics, and fixing a ton of range checks I added the card type:
[spoiler=media]

[/spoiler]
- Card adding, this was a challenge at first. These are the default values for cards
BUT the value of ace can also be 1. But the player would only benefit from the value of Ace being 1 if he/she goes over 21.. So I wrote up this bad boy
It gets the best value of the players cards.
- Load players, the script (or program not really a script) creates a folder called 'BlackJack'. Inside this folder it saves all of the player profiles
[spoiler=media]

[/spoiler]
it successfully loads the players information.
- Cash stacks, I decided to make the cash var int64… just for shits and giggles… you can get up to 9,223,372,036,854,775,807 coins lol. Depending on how much cash you have, the cash color changes

I plan on finish this game within the next month, the amount of time I have available has been fluctuating

Lol.
I would say that I'm about 80% done all I have to do it add actual gameplay
Commits: https://github.com/officerBarbrady/Simba-BlackJack/commits/master
Source: https://github.com/officerBarbrady/Simba-BlackJack/tree/master/src
Credits
Janilabo Ofc for Count function
I was originally going to make a text base dicing game with the lape interpreter (https://github.com/officerBarbrady/Simba-BlackJack/commit/b3c8b9a360b83b889c5b5dec5ed95f5766a5ba71 aqs you can see it was called dicinggame lol). I got bored of that quick and wanted to make a more advanced gambling game. So then I thought to make a text based Blackjack game, (I wanted to Utilize Lape). I soon realised how boring, confusing and godawful the game play would be, and how annoying it would be to program it. So then I switched to pascalscript and began work on making a form based game.
Things that has been accomplished
- Card drawing. I have completed the card drawing portion, I tested it using a tlabel to draw a random card. This proved to be a challenge at first with many annoying bugs like this
[spoiler=media]
Eventually I got it
[/spoiler]After aiming to have better graphics, and fixing a ton of range checks I added the card type:
[spoiler=media]

[/spoiler]
- Card adding, this was a challenge at first. These are the default values for cards
function getValue(card:string):Integer;
begin
case card of
'2': result := 2;
'3': result := 3;
'4': result := 4;
'5': result := 5;
'6': result := 6;
'7': result := 7;
'8': result := 8;
'9': result := 9;
'10', 'Jack', 'Queen','King': result := 10;
'Ace': result := 11;
end;
end; BUT the value of ace can also be 1. But the player would only benefit from the value of Ace being 1 if he/she goes over 21.. So I wrote up this bad boy
function cardTotal(cardArray:TIntegerArray):Integer;
var
aceCount, i:Integer;
begin
for i := 0 to high(cardArray) do
result := result + TDeck[cardArray[i]].value;
for i := 0 to high(cardArray) do
begin
if (TDeck[cardArray[i]].name = 'Ace') then
aceCount := aceCount + 1;
end;
if (result > 21) then
begin
for i := 0 to (aceCount - 1) do
begin
result := result - 10;
if (result <= 21) then
exit;
end;
end;
end; It gets the best value of the players cards.
- Load players, the script (or program not really a script) creates a folder called 'BlackJack'. Inside this folder it saves all of the player profiles
[spoiler=media]

[/spoiler]it successfully loads the players information.
- Cash stacks, I decided to make the cash var int64… just for shits and giggles… you can get up to 9,223,372,036,854,775,807 coins lol. Depending on how much cash you have, the cash color changes

I plan on finish this game within the next month, the amount of time I have available has been fluctuating

Lol.
I would say that I'm about 80% done all I have to do it add actual gameplay
Commits: https://github.com/officerBarbrady/Simba-BlackJack/commits/master
Source: https://github.com/officerBarbrady/Simba-BlackJack/tree/master/src
Credits
Janilabo Ofc for Count function


