Issues With Array Checking

Get help using Construct 2

Post » Sat Mar 19, 2016 5:17 pm

In what I posted above, 0 is empty and 1 is dirt. It doesn't matter what values you use, 0 can be dirt but you need a value for empty. How do you currently know a position has air?
B
92
S
32
G
109
Posts: 5,294
Reputation: 70,999

Post » Sat Mar 19, 2016 7:24 pm

@R0J0hound That was my issue,I dont understand how. How can air be 0 if my sprite value is 0 so my question would be how do i replace the value for air?

Can I? Or what trick do i have to pull off to get this to work in a way that i can understand.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Sat Mar 19, 2016 8:05 pm

Maybe -1?
B
92
S
32
G
109
Posts: 5,294
Reputation: 70,999

Post » Sat Mar 19, 2016 9:44 pm

@R0J0hound Here is my capX if you could show me what im doing wrong i would be very grateful.
I dont see where i am making a mistake, I tried using the syntax you showed but it ended up making all tiles turn to grass. I dont think my approach is the best.

https://www.dropbox.com/s/z0qvx32mtrdyd ... .capx?dl=0


The sprites inside this capX are free to use for prototyping if anyone needs it but do not use them for revenue.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Sun Mar 20, 2016 10:59 am

@R0J0hound Is the anwser really that simple or are you trolling me? I feel like you are not trolling but assume that i know the outcome,im quite sure that my post explains in detail that im no good with these arrays, -1 is not a viable anwser for me since im pretty much lost.

All i need to figure out is how to make this work with my capX or what im doing wrong so i can fix it. There is no way that many people can learn arrays without running into some issues if you are doing everything alone and not with a partner.

Im straight up confused about these arrays and im starting to lean towards different ways to get my game complete,I have spent alot of time trying to learn arrays alone in scirra construct and everytime i just feel like im a burden to the community.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Sun Mar 20, 2016 2:53 pm

What you have works. I've added event 20 that looks for every rock and checks the index above it for air, and turns the rock to grass (this is easier than converting the air above it to grass, as then you need to check for two air blocks).

http://www.blackhornettechnologies.com/ ... s_BHT.capx

I added the missing blocks, since you were still generating other types.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Sun Mar 20, 2016 3:53 pm

@blackhornet i cant thank you enough for helping me, That one line of code was exactly what i needed to be shown how to do. loopindex("y")-1 i would of never figured that out because in my mind the syntax was different
This has made my year!

You really helped me alot with just one line of code. This helps me wrap my head around what i was actually doing wrong.
and for you to confirm that i was atleast headed in the right direction gives me some hope.
Thank you @blackhornet @LaDestitute @R0J0hound
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Previous

Return to How do I....?

Who is online

Users browsing this forum: AnD4D, Euduardo, mikehive, tinhofiel and 30 guests