I've always loved strategic 'battle' card games and wanted to give a shot at making my own rendition of it from scratch. Turns out that it's more difficult than I thought! I don't have much experience with programming, and I'm stuck trying to figure out two specific problems. The first problem is with dragging the cards around. I want for them to either snap to their position on the game board, or revert to their previous position in your hand. I haven't figured out how to have them revert yet. The second problem is that when I place a card on the grid, I want it to check the surrounding positions for cards, and then determine their values, at which point the 'battle' takes place and a card is flipped. I'm not quite sure how do it and would love some tips. I have a feeling I'm going to need to use a for loop for creating game cards as opposed to my simple method, but I don't have enough experience with them.
I've uploaded what I've got so far. (.gmk)
There are a lot of redundancies in the code right now since I'll think of a better way to do something and sometimes forget to remove unnecessary variables. Some of the code is in the GAME object, with just creates the board and cards, and positions them. The rest is in the CARD object itself. Most other objects just have codes with tell them where to position themselves in relation to the other game objects.
The current code is pretty simple, and most of it works so I won't upload any snippets. They mainly just create objects, position them, give them random values and face card images (Which I'll ask you to forgive me for, I just pixeled in some placeholders).
If anyone has any tips or suggestions I'd love to hear them!
Triple Triad-esque card game issues
Started by _254583, Apr 12 2012 03:13 PM
No replies to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











