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.

Dark GDK / 2d Match Game

Author
Message
iammfa
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 22nd Nov 2009 15:59
Hi,
If we want develop matching game like "Diamond Mine"

with DarkGDK, I want to know the start..! which the easy way to start making this matching game..? Is it arrays..?

I need starting guide, please
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 22nd Nov 2009 18:01
I'd use a two dimensional array in order to make it easier to scan the neighboring elements.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 23rd Nov 2009 01:58
First, forget all the fancy gui and start with basic different colored boxes(just to make things simple) get the basics of the engine done first then work on graphics and menus.

So to do this here is a kinda step by step approach

1 figure out your tile size. above it looks around 32x32 tiles
2. figure out your map width and height in tiles. in the screen above it's 8x8
3. create a array to store what type of diamond it is. you could make a struct like this:

4. Create a 2d array of either an integer(just to store diamond type) or of your MAP_TILE structure.
5. find which tile the mouse is in. this is simple. just take it like this:

mx = mouse x - map screen offset x
my = mouse y - map screen offset y
tilex = mx / tile size
tiley = my / tile size

6. check surrounding tiles and do your stuff from there!

New Site! Check it out \/
iammfa
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 23rd Nov 2009 11:17
Quote: "figure out your map width and height in tiles. in the screen above it's 8x8"


Caleb1994, what is this refer to ..?
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 25th Nov 2009 21:59
I think it means that there are 8 diamonds in a row and 8 in a column.
Snowyowl
14
Years of Service
User Offline
Joined: 30th Nov 2009
Location:
Posted: 30th Nov 2009 19:00
Yes, it means you'll need an 8x8 array.

Login to post a reply

Server time is: 2024-10-01 18:39:54
Your offset time is: 2024-10-01 18:39:54