Forum Topic: Finding colour groups of blocks

(153 views • 5 replies)

This topic is 1 page long.

<< < > >>
Shouting

Vorlek

Reply To Post Reply & Quote

Posted at: 6/24/08 08:32 AM

Vorlek LIGHT LEVEL 17

Sign-Up: 12/26/05

Posts: 285

you know in some games where you need to make groups of colours and stuff. a game i am making, i was wondering, is there an easy way to figure out where those groups are, and then do something with it, without having to enter in every combenation.

Just to show what i am doing, i am going to have 21 variables, that can either be a number of variables, they will be set up like this:
:v01 v02 v03
:v04 v05 v06
:v07 v08 v09
:v10 v11 v12
:v13 v14 v15
:v16 v17 v18
:v19 v20 v21

so basically if there are groups of colours in those variables, i need it to do delete those colours, from the variables.

I dont need the actually code to do it. I Just need to know the METHOD of doing it, you can help me with little bits of code if you want, but i dont neccecerrely need it, i can do that my self.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

BBS Signature

Misunderstood

Vorlek

Reply To Post Reply & Quote

Posted at: 6/24/08 10:24 AM

Vorlek LIGHT LEVEL 17

Sign-Up: 12/26/05

Posts: 285

cmon people, this thread has had 5 views, 2 probably being me.
If you dont understand my question, just ask.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

BBS Signature

None

Coolio-Niato

Reply To Post Reply & Quote

Posted at: 6/24/08 10:56 AM

Coolio-Niato LIGHT LEVEL 23

Sign-Up: 06/30/05

Posts: 1,656

You should first learn to use arrays rather than variables. Arrays, in this case 2D arrays are extremely useful for block games.

http://www.newgrounds.com/bbs/topic/4778 28

=)

BBS Signature

None

Vorlek

Reply To Post Reply & Quote

Posted at: 6/24/08 12:08 PM

Vorlek LIGHT LEVEL 17

Sign-Up: 12/26/05

Posts: 285

hmmm, id never thought of that, im reading that post you sent me, then il go research it some more.
Thanks Loads

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

BBS Signature

None

Vorlek

Reply To Post Reply & Quote

Posted at: 6/24/08 02:23 PM

Vorlek LIGHT LEVEL 17

Sign-Up: 12/26/05

Posts: 285

rite, so i now have a basic idea of arrays, and i can get my game so that the blocks are in the arrays, and the actions read it and bring it up on the screen, instead of seperate variables (its pretty much the same as before but in an array), how do i get it so that it can get groups of 3 or more (up to 21)
Its still the same layout as earlier (3wide by 7high)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

BBS Signature

None

Vorlek

Reply To Post Reply & Quote

Posted at: 6/24/08 02:25 PM

Vorlek LIGHT LEVEL 17

Sign-Up: 12/26/05

Posts: 285

oh yes, i forgot to say, im using actionscript 3, i think arrays and stuff are the same as in as2 though. (Just in case though)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

BBS Signature

All times are Eastern Daylight Time (GMT -4) | Current Time: 12:31 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!