Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Game of 21's in Harlowe

edited March 2016 in Help! with 2.0
I am thinking of adding a mini-game to my Story, that is looped.

A,2,3,4,5,6,7,8,9,10,J,Q,K are the cards, and there are 4 sets of them, meaning you can have 4 of the same card if lucky.

If you get an A and a K, you get 21 or 11, depending on which you choose.

You can have up to 5 cards, if you go over 21, you bust, and if no-one gets 21, its the lowest of a 5 card trick that wins. You can click 'Hit' to get another card or 'Stick' to stay with the one's you have. Not sure if it is possible to do up to 4 people in the game, but you can have their numbers random each time.

Wonder if it is possible to make a mini-game like this?

Comments

  • Wonder if it is possible to make a mini-game like this?
    Yes,
    but it is going to take some effort and programming knowledge, and I am not sure if Harlowe's scripting language has all the features required or if you will need to resort to using Javascript.

    The Discussion section of page found at this link describes the logical steps involved for one possible method of implementing a BlackJack/Twenty-One game, it should give you some idea of what is involved in building your own version of the game.

    The actual solution on the linked page is implemented in Java but I believe that with some effort it could be translated into Javascript, or even into Harlowe's scripting language as long as it has the required features.
  • edited March 2016
    I have a working game of Blackjack, only problem is to import that file into Twine, is there a way to do this?

    For example, a header called blackjack and in the CSS have html.blackjack ?
    I have saved it as a JavaScript file, but how to I import it into Twine and used on a certain page?
Sign In or Register to comment.