# [Fixed] Fill the Holes Gradually !

Get help using Construct 2

### » Sat Dec 29, 2012 10:23 pm

Hey Guys ! Guess What ... Another Array Issue ! Yay ... I'm so happy , I'm going to launch myself from the windows !

This one is more detailled , I want to gradually fill the holes that are inclused by 3 or more blocks ... Screenie !

Capxie ! ( Okay ... Doesn't work :( ) !

Thanks for all !
Whiteclaws2012-12-31 16:37:02
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

### » Sat Dec 29, 2012 11:45 pm

Bump it , Bump it , Bump it !
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

### » Sun Dec 30, 2012 1:45 pm

Come on , People ! Is this too hard ?
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

### » Sun Dec 30, 2012 2:03 pm

Alright, say you go over all the xy elements (for each xy element), and check what the value was (current value), and suppose we say if that value was one then there should be a wall there.... easy right?

Now what if you do compare at xy, and compare what the value was for the next xy, or cell? Say for example current x +1, and current y.
What cell would that be?
What would current x, and current y+1 be?
Current x-1, and current y?
Current x, and current y-1?

Wouldn't that essentially check all 4 cells around the current cell?
And say what if one of those cells returned the value of zero instead of 1.
Would that give you any ideas as far as what to do?
B
173
S
50
G
194
Posts: 8,561
Reputation: 121,358

### » Sun Dec 30, 2012 2:05 pm

@newt , I did indeed think of that a while ago !
The only thing that I can't do is to implement it to C2 , I'm new to arrays and I did my best , but I simply can't do it ...
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

### » Sun Dec 30, 2012 2:13 pm

Well first of all, you have to define what you really want to do.

Like define a hole first.
What is a hole?
B
173
S
50
G
194
Posts: 8,561
Reputation: 121,358

### » Sun Dec 30, 2012 2:27 pm

Hole | an opening through something; gap; aperture: a hole in the roof; a hole in my sock.

[Quote] the holes that are inclused by 3 or more blocks [/Quote]

@Newt , Now , what do I do ?Whiteclaws2012-12-30 14:27:59
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

### » Sun Dec 30, 2012 2:40 pm

Don't get snippy, besides I think the word you are looking for is enclosed,or included not inclused.

A hole would be defined as a current value of zero, and current x+1, current y with a value of 1, and current x, current y-1 with a value of 1, and current x-1, current y with a value of 1, and current x, currenty-1 with a value of 1.

That's my definition of a hole with all 4 side with a wall.

You want that definition and what other definitions?newt2012-12-30 14:45:17
B
173
S
50
G
194
Posts: 8,561
Reputation: 121,358

### » Sun Dec 30, 2012 2:42 pm

If you want ... I made an algorithm that I can't get going on C2

For Each Elements (X,Y)
- Compare : CurrValue < 8.25
-- ( I'm stuck after dat >.< )

I could make another array and do that all round but I don't know how to do it efficiently ...Whiteclaws2012-12-30 14:43:45
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

### » Sun Dec 30, 2012 2:44 pm

The definition that I would prefer is enclosed by 3 or more walls
B
43
S
18
G
17
Posts: 2,247
Reputation: 17,556

Next