Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

pottersheep

  • 4 years ago

Java - tetris code explanation please?

  • This Question is Closed
  1. pottersheep
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    I need a code for rotating the blocks but I have no idea how ! >.< I found this example on the internet: int items[]={ 0,0, -1,0, 0,-1, -1,-1, // cube, normal 0,0, -1,0, 0,1, -1,1, // rotated 90 degrees 0,0, 1,0, 0,1, 1,1, // rotated 180 degrees 0,0, 1,0, 0,-1, 1,-1, // rotated 270 degrees 0,0, 0,-1, 0,-2, 0,-3, // straight line 0,0, -1,0, -2,0, -3,0, 0,0, 0,1, 0,2, 0,3, 0,0, 1,0, 2,0, 3,0, 0,0, 1,0, 0,-1, -1,-1, // stupid block 0,0, 0,-1, -1,0, -1, 1, 0,0, -1,0, 0,1, 1,1, 0,0, 0,1, 1,0, 1,-1, 0,0, -1,0, 0,-1, 1,-1, // stupid block 2 0,0, 0,1, -1,0, -1,-1, 0,0, 1,0, 0,1, -1,1, 0,0, 0,-1, 1,0, 1,1, 0,0, 1,0, -1,0, 0,-1, // another one 0,0, 0,1, 0,-1, -1,0, 0,0, 0,1, -1,0, 1,0, 0,0, 1,0, 0,-1, 0,1, 0,0, 0,-1, 1,-1, 0,1, // hook one 0,0, -1,0, -1,-1, 1,0, 0,0, -1,1, 0,1, 0,-1, 0,0, -1,0, 1,0, 1,1, 0,0, 0,1, 0,-1, -1,-1, // hook two 0,0, 1,0, -1,0, -1,1, 0,0, 0,-1, 0,1, 1,1, 0,0, -1,0, 1,0, 1,-1 }; int checks[]={ -1,1, 0,1, -1,1, 0,1, // check cube, normal -1,2, 0,2, -1,2, 0,2, // check, rotated 90 degrees 0,2, 1,2, 0,2, 1,2, // check, rotated 180 degrees 0,1, 1,1, 0,1, 1,1, // check, rotated 270 degrees 0,1, 0,1, 0,1, 0,1, 0,1, -1,1, -2,1, -3,1, 0,4, 0,4, 0,4, 0,4, // straight line 0,1, 1,1, 2,1, 3,1, 0,1, -1,0, 1,1, 0,1, // stupid block one 0,1, -1,2, 0,1, -1,2, 0,2, 1,2, -1,2, 0,2, 0,2, 1,1, 0,2, 1,1, -1,1, 0,1, 1,0, 1,0, // stupid block two -1,1, 0,2, 0,2, -1,1, -1,2, 0,2, 1,1, 1,1, 0,1, 1,2, 0,1, 1,2, -1,1, 0,1, 1,1, 1,1, // block three -1,1, 0,2, 0,2, -1,1, -1,1, 0,2, 1,1, 1,1, 0,2, 1,1, 0,2, 1,1, 0,2, 1,0, 1,0, 0,2, // hook one -1,1, 0,1, 1,1, 1,1, -1,2, 0,2, 0,2, -1,2, -1,1, 0,1, 1,2, 1,2, -1,0, 0,2, 0,2, -1,0, // hook two -1,2, 0,1, 1,1, 1,1, 0,2, 1,2, 1,2, 0,2, -1,1, 0,1, 1,1, 1,1 };

  2. pottersheep
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Can someone please explain the code for me please? why is there a list of coordinates? Is that an array or something? MY TEACHERS MAKING ME DO THE IMPOSSIBLE IVE ONLY BEEN STUDYING COMPUTER SCIENCE FROM SCRATCH SINCE OCTOBER HOW THE HELL DO I PROGRAM TETRIS I BARELY CAN MAKE A CALCULATOR PANICCCCCCCCCC

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy