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
0 answers

Unity3d - Collision detection and position inaccuracy

I'm a beginner on Unity3D and I decided to create a 3D Tetris to start learning. Everything was fine so far, but I have a problem with collision detection. https://gyazo.com/49fbf5798dc67a546c5e187fde8f6096 As you can see on this screen, the blue…
RayVen
  • 1
  • 1
0
votes
2 answers

Code not running synchronized in javascript

I am kinda new in javascript programming. I've been working for years in classic languages like C++/JAVA/Python etc, and i cannot find a way to understand the way that the code is assigned to be ran in javascript. I wanted to make a tetris game in…
0
votes
1 answer

rotation with tetris in python with coordsystem

I need an alogrithm to rotate blocks in tetris, I have tried looking over stackoverflow, but all solution need some pivot point and what not, I have no clue how to find that, so I'm wondering if someone can help me I've tried basically everything…
jooshoi1
  • 25
  • 2
  • 7
0
votes
1 answer

How do I rotate a tetris block in p5.js?

I'm representing tetris pieces as: var jPiece = [ [ true, false, false ], [ true, true, true] ]; This is the L shaped piece, where false represents emptiness. Once it's rotated, it should look like var jPiece = [ [false, true], …
0
votes
0 answers

Restarting function in javascript tetris

I'm trying to write a js tetris app as my first solo app. I wrote most of it on my own, and i ran into some trouble. I had a friend take a look at it who has a lot more experience than me, but we couldn't figure out the problem. I would like the…
Samo
  • 1
  • 3
0
votes
1 answer

Unknown type name "Shape1" in C++ Builder

I'm trying to make a Tetris clone in C++ Builder. I started by making 2 classes. I have wrote them in a .h file and included it in my .cpp file: class Stage { protected: int Width; int Height; public: Stage() { Width=300; …
user7838474
0
votes
1 answer

How to check if a set of coordinates matches a tetris piece in Python

I’m working with tetris pieces. The pieces are defined with coordinates, where each piece has an origin block (0,0) So an L piece could be defined as [(0,0), (0,1), (0,2), (1,2)] as well as [(0,-1), (0,0), (0,1), (1,1)] depending on where you place…
Legatro
  • 3,692
  • 4
  • 15
  • 21
0
votes
1 answer

Can I create objects (like rectangles) with commands in Powerbuilder?

I'm trying to program Tetris with powerscript. Don't ask why, but I would know, if I could create random objects in powerbuilder.
Lemonated
  • 25
  • 3
0
votes
1 answer

Storing Piece objects on array - java Tetris Tutorial

Im just new to Java and i found this good tutorial for creating a Java Tetris Game. I dont have a mentor or a tutor to help me with this - Ive been looking for one for ages :( so currently im self learning java and PHP :) Anyways heres the website i…
VisualFire
  • 45
  • 1
  • 6
0
votes
2 answers

Function changing global variable

I have this array that I pass into a function that's suppose to rotate the array 90 deg and return the result. I then want to check whether the new array is colliding with other things on the canvas. let newArray = [ [0,0,1], [1,1,1], …
tropulus
  • 83
  • 1
  • 7
0
votes
1 answer

How to add a touch event (right, left and down at the screen) in javascript?

I'm studying js and making a Tetris game. I already made it in PC dispositives but I want to add some touch events to the game works on mobile dispositives. But I'm stuck at this: function touchEnd(e) { if (Math.abs(offset[0]) >…
Jackgba
  • 47
  • 5
0
votes
2 answers

Falling Blocks from a Grid (Tetris Style)

My grid is on an array and I iterate through each grid tile to check to see if it is null and if the one above it isn't it will drop the block to the one below. The code worked perfectly fine when I did this instantly, but once I added a coroutine…
dHantke
  • 27
  • 5
0
votes
1 answer

ti-basic tetris update list every time tetrimono lands

am making tetris in ti-basic, every time a tetrimono lands i would like to update some rows lists either from 0 to one, or whenever a line clears, the entire rows list to zero, or false an example. someone clears 4 rows with the straight tetrimono.…
0
votes
1 answer

WPF Tetris Index Out Of Range Exception

I am very new and very inexperienced. I have downloaded a WPF version of tetris from MSDN to review the code and try to see whats going on but there is an error in the program and I'm not sure what is causing it. The exception details are as…
geladekim
  • 3
  • 2
0
votes
0 answers

How to use onscreen buttons to control a random spawned object in Unity?

I am making a Tetris clone for android with Unity 2017 using C#. I followed a Youtube tutorial and have the project basically finished. I would however like to move the spawned Tetrominos with onscreen buttons instead of using touch controls. Is…