Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

pottersheep

  • 3 years ago

Java - tetris code explanation please?

  • This Question is Closed
  1. pottersheep
    • 3 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
    • 3 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

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.