Questions tagged [tetris]

Block matching game created by Alexey Pajitnov . Elements are 4-segmented pieces where the name of the game comes (tetra is numerical prefix in Greek used for 4).

Tiles are 4-segmented pieces which also provided the name of the game (tetra the Greek numerical prefix for the number 4). More on Wikipedia

285 questions
0
votes
1 answer

My tetris game keeps collapsing (tkinter) (python)

I'm trying to make a simple Tetris game in Tkinter but the actual window won't open. It will draw if I don't use the time() function to make the game pieces drop, but as soon as I add the time() function the window disappears. I can see that the…
Embla
  • 3
  • 3
0
votes
1 answer

Custom rect hitboxes for pygame tetris? Part 2

This is what happens in my Tetris game right now: The hitbox for the J block is 60x40, and even though there is in reality nothing there in the actual image editor, it is taken as a hitbox. Meaning, the two invisible squares at the top right of the…
0
votes
1 answer

Tetris-style divisions of Square (NxN) boards

When I was a child, I had a square board tetris puzzle, and the instruction said there are >15 thousand solutions. I've always wondered how they counted the solutions, and I'd like to replicate that. So I would like to search for divisions of NxN…
h2kyeong
  • 447
  • 3
  • 13
0
votes
2 answers

Tetris in Javascript : setInterval setTimeout behavior

I have a problem. I'm trying to do a tetris game in javascript (for learning sake). However, i can't use the setInterval (or setTimeout) function. What I want to do is changing the color of the next case every 2000ms. HTML CODE :
WaLinke
  • 726
  • 2
  • 6
  • 25
0
votes
2 answers

fillrect not working in javascript for loop

I'm trying to use a for loop to draw pieces for a tetris game. I can't find a single tutorial or explanation that uses for loops with fillrect and fill style the way I'm using it. I know how to get it to work with foreach, but for some reason it…
user4586547
0
votes
0 answers

How to make tetris blocks fall down every second?

I am making a Tetris clone and I am using a tick method for the game loop (not sure if this is necessary). I want to increase the y value of the block object by 50 pixels every second or so. Can I add some type of delay in my tick method, or is…
0
votes
2 answers

Printing a JLabel with a Transparent Background over a Game + Adding Sound using Swing

For a computer science project I am tasked with taking a completed Java game and add some parts to it. I decided to do my work on the classic game Tetris, however I am having some issues. One issue is that I am unable to print a JLabel on top of the…
0
votes
1 answer

How to stop a tetris piece in java?

I'm writing a code for Tetris game and I have a problem with pieces moves. I made them move right, left and down, I made them rotate but when the pieces reach its bottom line I couldn't make them stop and draw a new piece to the top. Here are my…
0
votes
0 answers

Java Tetris Game: Having trouble moving a block down the grid

I am making Tetris in Java. I am having difficulty having my blocks shift down, once a row has been removed (because it filled up). My code is throwing an arrayIndexOutOfBounds error. The rest of the code works, where it finds which row is full and…
sara
  • 1
0
votes
1 answer

Tetris - fix hard drop collision

I am writing a method to handle direction for Tetris and am confused about the logic to write hard drop. the move method is called whenever a key is pressed. public void move(Direction direction) { if (canMove(direction)) { switch…
user7872609
0
votes
1 answer

JAR closes before creating a new scene

My project is finished, so I created a JAR in IntelliJ. The first stage (javaFX) is showing, but when I click on the button to create a new stage nothing happens (expect the old stage closes which is expected). Why is the runtime not creating a new…
m4t5k4
  • 55
  • 9
0
votes
1 answer

Writing a custom eventhandler, how to access from a different class?

I'm trying to write a custom eventhandler based on the alert that my application creates when you press a button. This is what I'm trying to extract (see below). view.getStart().setOnAction(new EventHandler() { @Override …
m4t5k4
  • 55
  • 9
0
votes
1 answer

Tetriminos Class in UE4

I'm trying to make a Tetris game on UE4 using mostly C++ My first idea would be a Tetriminos class for the single Tetris pieces Each Tetriminos has a color and a shape Now for the hard part: technically a Tetriminos is made of 4 cubes (so I would…
someCoder
  • 185
  • 3
  • 15
0
votes
1 answer

Adding additional shapes in a tetris project. loop logic assistance

I am creating a tetris clone as a personal project to help me get better at drawing images, moving them, and to learn collision detection. Everything is going fine but I am stumped at the logic behind getting the program to add a new tetrimino shape…
Justiciar
  • 356
  • 1
  • 3
  • 20
0
votes
1 answer

NEAT Neuronal network JavaScript

I started to learn a bit about neuronal networks I wanted to create a neuronal network which learns to play tetris. So I stumbled across NEAT JS Library and hooked it up with a console tetris game in nodejs. My concern is that something is wrong…
DomHey
  • 69
  • 2
  • 9