User Tag List

Results 1 to 3 of 3

Thread: iOS Blackjack Extension

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    506
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iOS Blackjack Extension

    This extension is provided as-is without warranty. You are free to use it to your heart's content at your own risk.

    First of all, download the Zip file from here:

    http://dl.dropbox.com/u/32296241/Bla...for%20MMF2.zip

    Once downloaded extract the zip file and follow these instructions:

    1. Copy Blackjack.mfx into your MMF2 Program folder under Extensions
    2. Copy Blackjack.ext to your MMF2 Program folder under Data\Runtime\iPhone
    3. If you plan to create a PC version of your App copy Blackjack.mfx into your MMF2 Program folder under Data\Runtime.

    Basically it assumes that you load your cards into an active with 53 frames: 0 frame is the card back and then the rest are 1-13, 14-26, 27-39,40-52 A-K in the order Clubs, Diamonds, Hearts, Spades. You don't have to load them like this, but just make sure whatever you're doing you represent cards with a value 1-52 in that suit order. Once you do that you can use the following expressions:

    GetCardValue( [Pass in the Current Frame/Alterable Value/etc. of the card you want the value for ] ) and it returns a value 1-13 which is A-K without accounting for suit.

    CanSplitHand( Card # Value, Card # Value ) is a quick way to test if the player has a pair.

    DealerHas17OrBetter( [String of dealer cards separated by commas] ) returns 1 if the cards total 17 or more. e.g. "1,51,27" 1 (Ac), 51 (Qs), 27 (Ah) returns 0 because the total is 12.

    CanHit( [Pass it a string which is a comma separated list of animation frames for cards that you want to see if they total 20 or less e.g. "1,51,27" 1 (Ac), 51 (Qs), 27 (Ah)] ) and it returns 1 if you can hit (you have 20 or less) or 0 if you cannot. It treats Aces as 1s so AAQ = 12 so it returns 1. A46 = 21 so it would return 0.

    Has21( [Pass it a string which is a comma separated list of animation frames for cards that you want to see if they total 21 e.g. "51,27" 51 (Qs), 27 (Ah)] ) and it returns 1 if you have 21 or 0 if you do not. It handles Aces as 11 if it makes it 21.

    IsBusted takes a string like Has21 and returns 1 if > 21 else 0. It treats Aces as 1s.

    GetHandValue takes a string like CanHit and returns the optimal hand value (e.g. Treats one ace as an 11 as long as it doesn't push the hand over 21)

    If you can follow my pattern for representing cards as values of 1 - 52 in the suit order you should be able to use this extension without a problem.

    There are no actions or conditions. This is all about expressions to test conditions.

    I've used it on my War 2012 game as well. It's a good way to convert card values to face numeric values though in War I change any 1 to 14 since Ace trumps a King in that game. It may not help many people, but if it helps one of you it is worth sharing. If you use it for a blackjack game please make one better than my Blackjack Smack app. I wish you all the best.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This is very nice... I'm probably not doing another Blackjack type game for a while, but it quite cool!

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    mikec's Avatar
    Join Date
    Dec 2006
    Location
    UK
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Keith these extensions are fantastic.

Similar Threads

  1. MMF2 Extension Request : OE-Cake Fluid extension
    By pyromane in forum Extension Development
    Replies: 5
    Last Post: 1st July 2013, 03:51 AM
  2. Blackjack Smack
    By Jeff in forum iOS Released Games & Apps
    Replies: 0
    Last Post: 11th November 2011, 01:31 PM
  3. Replies: 0
    Last Post: 11th November 2011, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •