Question
I'm developing some poker software ~ purely for fun.
Now when it comes to the chips, I'm having a nightmare. One positioning them, two the denominations and THREE Selecting the ones I'll need! This seems almost impossible with my current design.
Basically, I draw an skshapenode give it the name of the denomination and the player name. However, this chip can be drawn 50 times with the same name.
When I come to animating these chips, I can only see a wall of impossibility..
once I've made a function to choose the right denominations of chips to use for a call or raise etc, how will I even begin to write this pseudo code?
I require 2 large chips, 1 small chip and 2 medium chips {
SKNode *node = [self childnodewithname:denomination, playername];
runaction..
}
Baring in mind, I'll only need to take 2 of the 20 that are there in the chip stack.. As well as change the ownership of the chip..
is this possible? or am I seriously overcomplicating the issue..?
You need to rework your solution a little bit. I would do something like this:
First, subclass a SKSpriteNode (or SK whatever node you like) to make a chip:
Chip.h
Chip.m
Now you've got something you can reasonably enumerate and inspect.
Add a bunch of chips to your game scene:
GameScene.m
Then when it's time to pop off a certain number of the chips:
Call the method: