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.

Work in Progress / card game functions

Author
Message
Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 2nd Jul 2006 20:30
I've spent the last couple of days working on a load of card game type functions, obviously for use for people who want to make card games. at the moment im using it to write the game known as sh*thead, to check for bugs or functions i've forgotten about.

so i havent posted code/screenshots yet, im just getting a bit of early hype. i should have something for you this time tomorrow.

Chris Franklin
19
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 2nd Jul 2006 21:07
Not bad idea

Let's get the community to join here's 1 to start ya off



Untested code typed it here now lol

Stunt man 2 http://forum.thegamecreators.com/?m=forum_view&t=79827&b=8&p=0
WHITEKNUCKLE IS BACK! Check the wip boards for more info
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 2nd Jul 2006 21:34
It would be cool if someone made a program where you could write rules in a text file, and it would create a game automatically.


There are three types of people, those that can count and those that can't.
Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 3rd Jul 2006 12:55 Edited at: 3rd Jul 2006 12:55
diggsey, i was thinking just the same, but it'd actually be far more complicated that it sounds.

anyway, functions will be here in a short while, still debugging but shouldn't take that long. demo card game coming this afternoon or at worst, tomorrow.

Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 4th Jul 2006 22:11
Update: for those that actually care, im taking a little longer than planned for 2 main reasons:
1) an unforseen problem which arose just as i finished the engine meant a lot of recoding, which has all be done now, so i can resume to work with some demos.
2) i've decided to add a few more functions under the criteria of multiplayer and AI, which will obviously take time to code.

The main reason I'm doing this project is for the fact that school's all over for me now. everyone's split up and got jobs or are preparing for university, and this is an attempt at reliving the good times we had in the common room playing cards.

However, i realised that some people in this forum might like the engine once it's done, and i've seen people try to do card games in DBP in the past.

If this actually becomes something the community become interested in, then i may just aswell make this rules-scripting idea that diggsey mentioned and i also thought of.

I may even get a friend to write it up as a dll plugin for DBP.

Bmad6
19
Years of Service
User Offline
Joined: 25th Aug 2005
Location: Virginia, United States
Posted: 5th Jul 2006 02:05
I agree that making a rules script-to-game program would be neat, but it would be near impossible, because the scripting language and the rules and everything would be nearly impossible to create... good luck, though!

I think you'd be better off just making everything open source...

Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 5th Jul 2006 04:54
workign behind schedule, but here's today's set of functions:




should be pretty self explanatory for now. i'll write a full tutorial once the whole thing's done. 99% certain the code is bug free, i had a massive bug squashing spree today and i ran out of bugs, though there may be one or two lurking somewhere.

brief tutorial:
cards work numerical as 1-53. clubs are 1-13, diamonds are 14-26, hearts are 27-39 and spades 40-52. jokers are numbered 14 and are of the magical suit number 5.

also, you'll notice that decks, hands and packs all have similar codes. this is because they are handled in a very similar way, essentially, they're just named differently to make them easier to work with.

to get started; you'll need to make a pack. once you've made a pack, you put this into a deck. i adopted this system because some game require two or more packs, or a pack to be added mid-game.

by tomorrow night i should have some more basic functions, some gui functions (converting numbers in memory to cards on the screen) and also an example demo (if anyone knows of an alternative name for the game "sh*thead" please tell me)

ttfn

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 5th Jul 2006 11:36
Crikey you certainly like using Memblocks. Looks complicated the way that you program. Card games are usually simple to program. I would use Arrays and stuff.

Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 5th Jul 2006 12:58
i initially used arrays, but realised that if i wanted to write an engine i should use memblocks as a dynamic form of array, since dynamic arrays dont exist, for example you cant do:

for t=1 to players
dim t(10)
next t

anyways, it shouldnt matter, the functions handle all the memblocks for you, you shouldnt need to use the memblocks youself.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th Jul 2006 14:43 Edited at: 5th Jul 2006 14:43
Well, maybe use a function (that alot of ppl use):


Which should give less problems for people that use memblocks themselves. (I saw that you deleted them anyway, but I think memblock 1 is very often used )

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 5th Jul 2006 15:44
i thought that, but then realised, why would anyone want to make any other memblocks for a card game than the oens the functions use?

Bmad6
19
Years of Service
User Offline
Joined: 25th Aug 2005
Location: Virginia, United States
Posted: 5th Jul 2006 16:15
Why not just have the functions take an argument of which memblock to use?

Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 5th Jul 2006 16:43
could do, but i still don't see any real need to spam the functions with more parameters. i'll release the engine, once its all done and finished, and if anyone complains that they can't make a game because the memblocks arent working for them then maybe i'll consider it.

Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 6th Jul 2006 01:13
update:
functions going to be later than expected, since i wrote a few and they sorta didnt save, so need to wr-write them.

as for the gui functions, well, atm it's just one big messy function. i need to clean it up a little, divide it into smaller functions or something.

i should still post some by the time i go to bed though, or first thing in the morning.

screenshot attached:

just need to fixed the side views and it'll be pretty much done.

Attachments

Login to view attachments
Bmad6
19
Years of Service
User Offline
Joined: 25th Aug 2005
Location: Virginia, United States
Posted: 6th Jul 2006 01:16
I tried 2 make a card game a long time ago, but had a big problem:

I needed to have the cards show up in different sizes sometimes, and couldn't figure out a way to scale an image - do you not do this?

Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 6th Jul 2006 01:48 Edited at: 6th Jul 2006 05:06
i'd either write a routine with memblock images, or use sprites.

update: screenshot showing fixing of GUI functions used for displaying hands side-on, which wasnt existant in last screenshot. also fixed the function to give the deck depth... rather useless really, but still looks nice.

http://s4.photobucket.com/albums/y147/el_goorf/?action=view¤t=shead2.jpg&refPage=&imgAnch=imgAnch1

Login to post a reply

Server time is: 2024-09-29 14:23:02
Your offset time is: 2024-09-29 14:23:02