Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need help with Match Cards game

Author
Message
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 3rd Jan 2006 10:06
Making a Match Cards game, hopefully everyone knows how that game goes heh. Anyway made the function to deal the cards out from the top of the deck, but when it runs, the cards don't go to their proper spots. I'm trying to set the cards down in an 8x6 grid, the last row will have 6 cards instead of 8 (52 cards in a deck). Could use some help as to why cards won't position properly. Here's the code:



Also, i wanted the movement of each card from the top of the deck to its proper space on the playing area to be animated, like a smooth movement instead of the card disappearing and reappearing. I don't know what commands to use to do that tho, the "move object" command only takes parameters for object number and speed of movement, i need something that will allow me to input a start position and end position i think. I thought of trying a method of using repeated positiob object commands in a loop but couldn't think of the math to handle the position of all 52 cards. Any ideas? Thx in advance.

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mn DDR400 system RAM. Thank you for your help.
Vlad
18
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 3rd Jan 2006 12:27 Edited at: 3rd Jan 2006 12:29
Hi mate

Not doing a card game, but a match-3 and I had a similar problem, actually bigger for a load of reasons. I didn't go through all your code to be honest, but when you are dealing the cards you did it in a completely diferent way. Bear in mind I don't code in DBP so this is just some pseudo-code to try to help out some way.

First off, every one of my objects knows it's position. I see yours knows it too. That makes it easier. The difference in what I did is that when I put my objects on the game board I do it by position, meaning:



This allows further control over the position of the cards or objects on board or anything at all since you all have to add conditions to the if statement or to the cycles.

Sorry about the pseudo-nerd code, but it's the best I can offer without writing any other weird thing.

Hope this helps.

EDIT: About the movement, I'm working on something myself, if I discover and get something working I'll give it a shout. If you feel confortable with C++ code I can send you the code I use so you give it a look.

I'm pretty sure I know everything. Doubts are something rare in me and I am never wrong, as this signature can prove.
crighton
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 3rd Jan 2006 13:50
why not make a function to move the object(card).

might be better ways, but try something like this.



hope that helps


aye!
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 4th Jan 2006 21:35
thx vlad and crighton for your help. I was able to get the cards to deal out properly

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mn DDR400 system RAM. Thank you for your help.

Login to post a reply

Server time is: 2024-09-24 13:26:31
Your offset time is: 2024-09-24 13:26:31