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
2
votes
2 answers

How to approach drawing shapes in C# to make a tetris clone?

I would first like to note that I am NOT using any XNA or LINQ in this small project. Basically, I want to make a clone of Tetris using C# windows application. I have already drawn out my grid, my picturebox size 250x500, making each square block 25…
Karim O.
  • 1,325
  • 6
  • 22
  • 36
2
votes
0 answers

GridView on my GameView (SurfaceView)

I have the following problem. I am trying to code a Tetris Game for Android. Therefore I need to put a Grid on the GameView (a self coded class, which extends the SurfaceVieW). Unfortunately I do not know how to draw the Grid on the GameView. I…
Prawncitizen
  • 21
  • 1
  • 3
2
votes
3 answers

rotating string array in java

How would i rotate a string array in java for a tetris game i am making. For example, the string array [ "JJJJ", "KKKK", "UUUU" ] would become [ "UKJ", "UKJ", "UKJ", "UKJ" ] I can do it with a char matrix using this code public char[][]…
Markovian8261
  • 909
  • 4
  • 10
  • 23
1
vote
0 answers

Error in android tetris - getEntry

At the time me and a friend are programming the classic game Tetris, for a school project. I have been programming for an while now and had implemented both a rotate and a moveBlock, and newBlock, draw, etc., methods, so I thought now maybe would be…
1
vote
1 answer

Blocks stuck at top and spawn repeatedly

I have begun creating a Tetris game in Python. My problem is when I try to detect collisions with other blocks, the blocks get stuck at the top and spawn over and over again, like this: Heres the code: import pygame import random # Define…
Theo 17
  • 17
  • 3
1
vote
1 answer

having trouble iterating through a loop and drawing boxes

I'm trying to implement Tetris in Pygame. I wanted to test out an algorithm involving arrays that would in theory draw boxes in a grid. Instead, whenever I run the code, the window pops up and only one square is drawn in the corner of the window. So…
1
vote
2 answers

How can I make sure all my rows shift down after clearing in Tetris clone?

I'm making a Tetris clone in Python and am having difficulty ironing out my function to clear completed rows. While it works in most cases, when multiple, non-consecutive rows are completed by the same block, some of them will not be shifted down as…
1
vote
1 answer

How can I add a player controlled platform that catches the tetrominoes to my Tetris code?

I'm a student and I was given the task of creating a retro arcade game on Processing (pong, space invaders, breakout, tetris etc.) but with a twist. The twist I thought was to create a Tetris Tower Stacker, which is like Tetris but instead of…
cdy
  • 11
  • 3
1
vote
1 answer

Phaser 3 Tetris clone, Game freezes when trying to stack blocks

In the Tetris clone I'm making, I'm only working with single blocks right now and I have been trying to stack blocks in a few rows. Here is the code for the blocks if (this.active == false){ this.cube = Math.floor((Math.random()* 7)); …
EmptyStone
  • 235
  • 1
  • 7
1
vote
1 answer

Pygame File doesnt load

I recently finished building a Tetris game, it has no errors that I can see. When I run it in the text editor (Sublime), it runs perfectly fine and no errors populate. But if I try to run it in the file itself on my desktop, It will only load the…
SLC08
  • 11
  • 2
1
vote
0 answers

Unity Tetris Game blocks sometimes not colliding

I am creating a version of Tetris which uses pentominoes instead of tetrominoes (5 square blocks instead of 4 square blocks). Some of the blocks will sometimes not collide by falling as far as they have space to (gaps between vertically adjacent…
MilesGC
  • 11
  • 2
1
vote
1 answer

pygame tetris fever_mode adding timer

i = 1 ## fever_interval = 3 if score > i * 100: pygame.time.set_timer(pygame.USEREVENT, 5) mino = randint(1, 1) next_mino = randint(1, 1) next_fever = (i + fever_interval) * fever_score # 피버모드 점수 표시 …
user15716685
1
vote
2 answers

Python Pygame Tetris, problems with handling of keypresses. implement delayed auto shift. how long a key has to be pressed before moving

I want to code my own Tetris. The goal is to get as close as possible to this game: https://jstris.jezevec10.com/?play=1&mode=1 I don't know if I google the wrong things but I couldn't find a satisfying answer. The problem: the pieces can move left…
Rabinzel
  • 7,757
  • 3
  • 10
  • 30
1
vote
2 answers

Counting gaps for a tetris ai in python

I am trying to make a simple tetris ai in python(no genetic algorithms) I want to count the gaps in the grid and make the best choice depending on it. By gap I mean where you wont be able to place a piece without clearing some lines. My grid is…
1
vote
1 answer

Its my first python project and i have been trying to move a simple rectangle down the screen as tetris blocks fall down but failing

I have tried many other methods, including creating a rectangle and iterating the y coordinate but that creates a long line which i do not want. This is my OOB approach to it, which is not great, but please bear with me as i am a beginner. I have…
Mahasin
  • 15
  • 3