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

Tetris function for checking if piece fits doesn't work right

Im practicing C++, and been working on tetris clone. I have tried to figure out my own solutions with help of few tutorials to learn to code with this language. Im having almost everything else working, but this function is giving me some problems: …
-1
votes
1 answer

Tetris piece rotates off the grid

I'm making tetris game using javascript and html, my board is made up of a grid of divs. When I rotate my tetris piece, I can rotate it into other pieces, additionally I can rotate them off the grid and onto the other side. Please help me fix this…
-1
votes
1 answer

Unity (Tetris game): Object falls in the wrong direction every time it rotate

I have the following code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Tetris : MonoBehaviour { void Update() { transform.Translate(new Vector3(0, -3 *…
Chau Ngoc
  • 11
  • 2
-1
votes
1 answer

Tetris pygame falling issues

I am a beginner programmer trying to build tetris in Python using Pygame. The problem is that I am unable to make my test shape fall. Only go up. When I attempt to make the shape fall, the program gives me an IndexError: list assignment index out…
BookBot
  • 17
  • 2
-1
votes
1 answer

What cause this weird bug in my selfplaying tetris written in Python 3?

What happen is that at certain point when a piece is put to its place suddenly the a whole column became solid. Putting breakpoint on line 236 one can debug this and see that in the value assignment: gameSpace[current_y + x][current_x + y] =…
Eraklon
  • 4,206
  • 2
  • 13
  • 29
-1
votes
1 answer

Java Tetris - cannot set up saving key settings into the config file

I cannot get through one function I recently added to my Tetris game. Basically I am working on the key settings allowing user to change the controls for example to WASD instead of arrows etc. I think I have everything set up but my config is not…
-1
votes
1 answer

Need help implementing graphics to a tetris grid

For our Tetris project we have a 10x20 grid nested inside a 400x800 JPanel. A Tetromino class is created that has a private int[] coordinate that sets coordinates when a piece is spawned public void spawnTetromino() { ... int[]…
Nathan Natindim
  • 147
  • 2
  • 5
-1
votes
1 answer

How do i create a Random Number Generator Function for haskell tetris game

my question is very straight forward, i want to have a function in my haskell code that works as following: i invoke it and it returns me a random Integer. I use it to generate my tetrominoes based on the generated numbers, any ideas? EDIT, here's…
-1
votes
1 answer

How to draw blocks in Tetris with less code?

Is there a way to do the print "0" part with less code? I tried various things, but I just crazy random prints. If I try a for loop with a variable that lets the BlockX array move up every time it prints a "0" it just flips out. even if I cap that…
TheProgramMAN123
  • 487
  • 1
  • 5
  • 13
-1
votes
1 answer

c++ changing local variable in method

Hi i'm writing a basic tetris with ascii output and I have a Block Object that I want to move around How would I change the Character at a certain Position in my Field from my method? but VisualStudio tells me 1>------ Build started: Project:…
majorTom
  • 57
  • 6
-1
votes
2 answers

How to rotate a piece in Tetris?

Do you know any way/algorithm to rotate a piece in Tetris? The programming language is Jess... Thank you for any helpful suggestion. pieces
-1
votes
2 answers

JavaFX EventHandler - new Alert if boolean equals true

When the user has reached the end of this Tetris game I want a new alert to be opened. In the model class I have a boolean that will switch to true if a new Tetris block cannot be spawned. I'm working with model view presenter, so in the model is…
m4t5k4
  • 55
  • 9
-1
votes
2 answers

Creating a loop for column & row constraints with JavaFX

For my highscore window I have 20 nodes inside a gridpane (20 labels). Now I want the gridpane to be as big as the window itself which is 450 x 450, and I was planning to do this by adding column & row constraints. This is what I tried, but got a…
m4t5k4
  • 55
  • 9
-1
votes
1 answer

JavaScript not working correctly for my game

I'm working on a Tetris game but whenever I open it in the browser it doesn't work. So I opened the JavaScript console. and it said Uncaught SyntaxError: missing ) after argument list Tetris.html:229. Then I obviously went to look at it and…
Adam Oates
  • 193
  • 3
  • 12
-1
votes
1 answer

Why is my 3d array reversed?

I have a 3d array of ints stored in a struct which represents a tetris block: typedef struct { int orientations[4][4][4]; dimension dimensions[4]; int i; int x; int y; }block; orientations is filled with every possible position for the…
Barry
  • 13
  • 2
1 2 3
18
19