Array Generation

Get help using Construct 2

Post » Fri Dec 28, 2012 7:09 pm

Hey Guys ! Whiteclaws Here ! And today I confront my only fear ! Arrays ...
But I just get buttkicked !

I don't know what's happening , I did many tutorials on arrays but I don't understand them until now :( , If anyone could make me an example , that would be really appreciated !

Okay , I explain ... You know Probability 0 and Davioware Towerclimb , They all generate terrain randomly in a way ... I want to know how ! More Details , I have a layout ... 288, 320 . I need to make half the array indexs 1 and then create some blocks in the 0 indexs positions !


I tried my best , but my stuff always get buggy and I never get it going ...

Thanks for all !

Oh , and no need to comment your .capx , I will need to understand by myselfWhiteclaws2012-12-28 19:11:48
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Dec 28, 2012 9:06 pm

@Yann , @R0j0hound , maybe ?
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Dec 28, 2012 9:44 pm

I find your question hard to follow, could you please try to be more concise?

I don't know what "Probability 0" or "Davioware Towerclimb" is and I don't care to find out. I understand you want random numbers in an array, but "stuff gets buggy" doesn't really explain your problem well.Nimtrix2012-12-28 21:46:08
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Dec 28, 2012 10:01 pm

Don't say that ! The Two ( I think ... I know atleast that towerclimb is ... ) are made on C2 ! That would be a shame to not care about a hit game made in your favorite engine !

I didn't want to get here , but oh well ... here's the capx ...

Hope you can see the issue , now

Edit : Okay , Okay , here's the explanation , for me ... what happens is that the values always changes from 1 to 0 , and from 0 to 1 , 0.5 seconds after switching ,

0101010101
-then-
1010101010

And finally only 1 block spawns at the top left of the screen ( at the right of the borders ...

That's what I'm getting , and when I use random , it does the same thing but switches to some decimal values ...
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Fri Dec 28, 2012 10:29 pm

What I meant about the games was I don't want to have to look up other games just to be able to answer a question on the forums. I'm sure they are both great games, but I haven't played either of them, yet.

Now, on to the arrays. First of all the loop is running every tick so the values keep changing, make sure it's under a trigger like "On start of layout".

Here's an edited .capx:

ArrayLevel.capx (r114)

The area is filled with blocks from the top left corner, down to the bottom left corner. Then it moves 32px to the right and fills the next column. Feel free to ask if anything is unclear.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider] and 29 guests