Newbie question.

Hi I was just wondering if anything can teach me how to make a simple black jack game? cuz i want to know how the shuffle card system would work. If it requires python can you tell me what kind of script is required?? thx

a simple black jack game is not so simple, it will require alot of scripting. If your good with blender , gop ahead and attempt it. If your new or fairly new (like me) then MEYBE attempt it.
Goodluck.

The best way to learn is to just try and make what your hoping to achieve. Simulating a card deck would be hard without knowing python, and a game more suitable for pure programming. once you got a working deck though, you can use a python function to just pull out a random card. I suggest you try writing a deck simulator in pure python. no visuals just make it draw a card 52 times, and look at the random orders. I’m not going to walk you through making it because it would take me a good couple hours to make, but its a good goal to set for yourself.

Some helpful python related links:
python itself:
http://www.python.org/

A good free python book:
http://www.ibiblio.org/g2swap/byteofpython/read/

Python API references:
http://docs.python.org/library/

Very true.

I’ve made a fairly simple blackjack game, just to demonstrate one way it could be done.

Once the game is started with [P]:

[SPACE] - Hit. (when you have a fairly low value card, you should hit)
[S] - Stay. (for example, having 21 would be a good time to stay)

When you win/lose:

[N] - Starts a new game.

The .blend is attached.

Attachments

blackjack.blend (222 KB)

Social: You prove many points in the “cathedral vs bazaar” understanding of the OSS model. But that’s a good thing :smiley: BTW, fun little blackjack game you’ve got there.

NeoCloudZero: Personally, I think a blackjack game could be done in logic bricks only if one could manage to get the random numbers to be unique. That is, 1 through 52 with no repeats. And I don’t think it would take an overwhelming amount of bricks, either (though it would take a small bit of jumping through hoops to overcome the lack of global variable support).

Edit: Just to clarify, I was only saying that it might be possible to do the game in all (or mostly) logic bricks. I actually think that doing it that way would be a rather backward thing to do. In my mind, the “purely” (or mostly) Python method is the correct solution in this case.

Would ESR be proud? :smiley:

Personally, I think a blackjack game could be done in logic bricks only if one could manage to get the random numbers to be unique. That is, 1 through 52 with no repeats. And I don’t think it would take an overwhelming amount of bricks, either (though it would take a small bit of jumping through hoops to overcome the lack of global variable support).
Anything is possible, especially when working with blender.

Someone should try to make that demo - that one test would probably tell us more than any number of thought experiments.