I need help with an Idea...
I want to make a blackjack application. I am trying to do it by creating all 13 cards, then having the event When button "deal" is clicked; 1 chances out of 13 at random: create object (I have 13 of these conditions, then for each respective condition, I have an action which is "create object" and one card of each 13). if this makes any sense. Could you help me make a blackjack game, and provide an example if you could? I hate to do this but I am stuck, I have beeen working on this for 2 months and haven't been able to find any help.
Re: I need help with an Idea...
What area are you stuck with. Generating a random selection of the card to create?
Re: I need help with an Idea...
Re: I need help with an Idea...
I have found the easiest way to pick a random card is to:
Put all the card objects in an off screen zone then pick a random object from that zone. If I need 5 I run the event 5 times and move the picked card out of the zone.
Its a cheap way to do it but worked good for the couple card games I have made.
Re: I need help with an Idea...
Well... Create the cards as a single active object, put the different cards in different directions...
THen use something like this to create the cards
* Condition to create a card
- Create active object card at x,y
- Card > Set alterable value a to random(13)
- Card > Set Direction to alterable value a
now you can easily check every cards value by using value a and the creation is done in a single event!
Re: I need help with an Idea...
Heh, I always found it a little odd that one of the screenshots showing MMF2 shows a card game, but that game wasn't provided in the example files. Did that game ever really exist at all? ;)
Re: I need help with an Idea...
Burfelt never got it 100% done :(
There is a card game in one of Jasons book or you can get some source files for card games at my personal website.
Link at bottom of my posts.
Re: I need help with an Idea...
There is also the twister object that can generate number I believe. Most of the time you generate a randorm number in the range of 0 to 1.0. Then each card is assigned a range like 0.0 to .19, next might be .20 to .39 etc... based on the number of cards. Then generate a number and pick the card.