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.

DarkBASIC Discussion / Help with making a lines-like game

Author
Message
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 19th Feb 2006 02:46
I want to make a board game with balls , there will be balls in different colours , and the point is to match 3 balls THE SAME COLOR in any direction , what i`m wondering is HOW to make it detect if 3 balls are alligned in any direction ?

Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 19th Feb 2006 13:08 Edited at: 19th Feb 2006 13:09
It's a DIM.

Dim Map(50,50)...50 across, 50 down. This is a square of holes.

These are all filled with zero until you place a ball. Then you make them the number that represents a colour.

Red = 1
Blue = 2
Green = 3...etc.

Then when you put a ball down, you change the number in the DIM to that colour.

Then you can look in all the DIMs near to the ball to see if you have made a row.

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 19th Feb 2006 19:15
Could you please explain a bit more ?

I understood it , but not fully , just partially ,

Thanks.

UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 19th Feb 2006 19:40
I think he means how to detect things like:



The * is any kind of tile and the / is, like, a blue tile. How would you decect the / tiles if they are like that? I have been wondering the same thing.

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 19th Feb 2006 20:06
Yes , how to detect the tiles in vertical , horisontal , and/or :

****/**
***/***
**/****
*******

Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th Feb 2006 11:22 Edited at: 21st Feb 2006 00:35
It's not so complicated once you try it.

Map(1,1) is the top/left corner

Map(1,2) is the second left corner.

Map(1,3) these three Dims would create a row if they contained the same number.

When you paste a coloured ball, you put a number in the right Row/column. You look to see if the dims next to it are the same number.


Edit: My example above works in the Y not the X as I accidentally portrayed.

Chilled Programmer 420
19
Years of Service
User Offline
Joined: 24th Nov 2005
Location: NOT SAYING!, i dont wanna get kidnapped!
Posted: 22nd Feb 2006 14:51 Edited at: 22nd Feb 2006 14:54
youd have summit like

for diagnols.

i havnt tried this since im at collage, but it shuld work, though it may not be the best way, naybe there a better way involving vectors

[url=www.freewebs.com/tyhrfg][img]bruce.bmp[/img][/url]

Login to post a reply

Server time is: 2025-05-23 15:01:59
Your offset time is: 2025-05-23 15:01:59