Array Generation

0 favourites
  • 5 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • 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 myself

  • Yann , R0J0hound , maybe ?

  • 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.

  • 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 ...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)