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
1
vote
1 answer

TETRIS html5 GAME code check

Im working on a tetris project for uni. I have got most of the function to work except one. The intended flow is as follows: Index page with a button to load the game On clicking the button the game starts with a background audio(sample audio for…
1
vote
1 answer

Pygame Tetris Issue

I've been writing a very rudimentary version of Tetris for Pygame in python 3.6. The only features so far are the blocks falling, making them fall faster, moving left and right, and when a block hits the ground, a new one spawns. However, there is…
paper man
  • 488
  • 5
  • 19
1
vote
2 answers

Best way to update Android-UI in while loop

I'm working on a Tetris-app and I have a Thread.sleep command to animate the falling of the tetriminos. But that creates a conflict with the UI. So I tried runOnUiThread() like this: while (gameover == false) { tetriminoSettled = false; try…
1
vote
1 answer

Relative path does not work

I'm trying to reconstruct Tetris in JavaFX. My project is called TetrisProject (C:\Users\Matthias\IdeaProjects\OOPROG\TetrisProject) Inside Main there is a problem with getting resources.…
m4t5k4
  • 55
  • 9
1
vote
1 answer

Stop objects from going out of bounds in Tetris game

I'd like to stop my shapes from being able to move so far left or right that they go off the screen, but my outOfBounds method which I've implemented in my KeyHandler is receiving this error: 1 error found: File: .../Tetris.java [line: 46] Error:…
Isaac
  • 11
  • 2
1
vote
1 answer

Creating Specific Class Instances Through a Subclass in C#

I will use my specific use-case to describe my question, but it should be more broadly applicable considering there may be other applications where one would want to create a subclass based on some defaults. This isn't meant to be a "do my homework…
1
vote
0 answers

How do I find a tetris shape from a bitmask value over a matrix

I have a 7x5 matrix with several bitmask values, each corresponding to a particular Tetris piece uniquely colored and positioned over the 7x5 array. I need to get the position shape & name(1 out of 19 basic named Tetris shapes) of the Tetris piece…
Arvind_R
  • 59
  • 6
1
vote
1 answer

Tetris game crashes after so many lines

I am trying to program a tetris game. So far so good, however, the game keeps crashing after about playing/removing 15 lines of blocks. I have been unable to trace down where it goes wrong. The code can be found here:…
vaultboy
  • 173
  • 1
  • 1
  • 12
1
vote
3 answers

C# List 90 degree turn

I'm working on a C# tetris game, in my code i got a List<> of Rectangle Objects private List lstBlocks = new List(); This list can contain a several types of rectangle collections, based on a random number (by generating a new…
Ferry Jongmans
  • 625
  • 2
  • 12
  • 22
1
vote
1 answer

Setting color of individual cells in a GridPane (JavaFX)

I'm making tetris for a class project, and I had the idea to utilize gridpane to divide the stage into evenly spaced rows and columns. I was going to change the color of each cell individually to simulate actual pieces, but I have no idea where to…
1
vote
1 answer

how to use gotoxy function instead of clrscr

Doing first project and it's tetris; Now I'm doing the animation part, but I have a problem with clearing the screen, I've tried : void clrscr() { system("cls"); } It worked but it kept flashing the screen, is there a way using gotoxy function…
1
vote
1 answer

2D Array copy (JAVA)

First post ever here. Short story, I had to make a tetris game in Java, it was working fine but it had some problems in the optimization aspect (I only started programming this semester). When I was discussing the game with the teacher he pointed at…
Pedro David
  • 377
  • 3
  • 11
1
vote
1 answer

(C#) Errors when Tetris blocks are moving

Just a note to everyone beforehands. This is my first ever programming class so do bear with me when I don't understand everything. Basically, for my class final project I decided to recreate Tetris in c# (visual studio). Sounds easy right?…
zergboy03
  • 21
  • 2
1
vote
1 answer

Pinvoke. Speed up Console.Write();

I am writing a c# console tetris game. Once I got to the part that the application was ready. I got to the part where I had to solve lagging. I am writing out like this: static void writeCol(string a, ConsoleColor b) { …
1
vote
0 answers

How to calculate maximum coverage of a matrix by tetris tiles?

I am building a recursive function that will be given a size of a matrix (Rows and Cols). The function will print the first optimal cover it encountered. What I am looking for is the a way to calculate what will the optimal cover be, numerically.…
asafi
  • 11
  • 1