I had a brainstorm about how to do the code at literally 11:55 PM last night. I ran downstairs and made a note on my ipad lol

insert coding montage

4 Likes

I can either put 130 check if else blocks inside of each other or I can use one in a repeat 130 times block with variables.

What should i do
• Check if else blocks
• Repeat

0 voters

yeah the repeat is 128 times easier

3 Likes

stop it tri dont make me do that /lh

2 Likes

check if else is actually frameless tmk so if i was you and i have the time i would definitely pick check if else
and im not kidding

2 Likes

Hmmm
Wait so repeat takes more time than check if else?

3 Likes

ofc

repeat 130 times means taking 130 frames, aka in the most ideal world 130÷60= 2.167 seconds to run which is a lot

2 Likes

Oh i didnt know that

In an ideal world everything would be instant

3 Likes

you can consider using recursions for instant code but it gets really complicated with complex code

3 Likes

Im just using my check if else blocks. Im at 43 out of 130, but only because i started it earlier and then realized that I could use repeat. But now im using this again so glad i saved it

3 Likes

Oh and I forgot to mention: this is only for the T piece. I have to do this 120 thing with every block! Maybe even the flipped ones! I am happy right now but im not allowed to lose motivation theres a deadline

2 Likes

What are you doing with it? Are you sure that this is the only way to code this?

4 Likes

Its my “collision” for tetris- its not really collision, just recognizing if theres a block beneath it by setting variables… kinda. Also a bit more complicated math with positions and stuff

Nested check if elses look weird

1 Like

help me

that’s too many

i’m scared

1 Like
it just turned into this when all the check if elses ended

2 Likes

Guess who realized he has to go through all 130 check if elses again to add a little bit of code to make it recognize any place in the block kinda i cant explain it

Thats right me, so i have to unnest everything, add a tiny bit of code in each, and nest it again.

Oh and now everything is laggy because theres so much code

2 Likes

What are the blocks that could be beneath it? Do you need multiple falling blocks at the same time?

4 Likes

…and that’s why we need Switch Case Statements, lol.

3 Likes
3...2...1...

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

I may have figured out a way to do the collision that feels 1000 times easier

2 Likes

How did you do it?

3 Likes

Its just checking to see if theres a piece underneath the falling one in a different way

4 Likes