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

How do I use a variable from a function of a cpp file on another function in anotehr cpp file?

I'm making a tetris game and I can't figure out how to use the variable that calculates the score in another file where it is going to print the score to the screen. Here is the code: //board.cpp //Here is the variable mScore that i want to use /*…
-1
votes
2 answers

"void is an invalid type for the variable paintSquare" error

I'm making a Tetris clone for my AP Comp Sci class properly titled 'Titris' and while going through whatever errors there were I got this one. it came from this code private void paintSquare(Graphics g1, int x, int y) { Color color =…
-1
votes
1 answer

Compiling Tetri Duel Kernel Raspberry Pi

So I#m totally stuck on compiling this kernel https://github.com/Tetris-Duel-Team/Tetris-Duel for Raspberry Pi. The Assemble Script seems not to work under Ubuntu 12.04 and I have no clue how compiling with gcc arm is working. Any Guides or Answers?
PaddyMKay
  • 3
  • 1
-1
votes
1 answer

Tetris with Custom Images

I am working out a concept for a Tetris style game with a twist. I have worked through a few tutorials for the basic logic but with the way we are wanting to do this, I am not sure if the logic is even possible in our time frame. Basically, we are…
Badge
  • 61
  • 5
-1
votes
1 answer

Tetris function move right in C

Currently i have the move left function int8_t move_piece_left(piece_type* piecePtr) { int8_t row; /* * Check if piece is all the way to the left If so, return. * (Remember, column number is based on bit position - higher * numbers to the left. …
Jim
  • 482
  • 1
  • 5
  • 20
-2
votes
1 answer

How would I add a level system for the score increasing?

I am making a slight Tetris remake and I wanted to add a leveling system for when my score reaches, for example, 100, the speed that the blocks go down will also increase. How would I go about doing this? I have the entirety of the javascript code…
Zayna
  • 11
  • 1
-2
votes
1 answer

Please help me to build Hard Drop function (Tetris) using javascript

I'm trying to make Tetris using javascript. https://github.com/meth-meth-method/tetris -- I found this on Youtube and started to add some other functions. I want to add Hard drop key in this Tetris game. function playerDrop() { player.pos.y++; …
loone96
  • 723
  • 2
  • 13
  • 21
-2
votes
1 answer

(Game bug) Tetris pieces being disappearing when colliding

I'm making a Tetris game with javascript, but there's a bug I haven't been able to fix yet. It only happens when pieces Z, S, and T collide with an object while going down. I thought the problem was with the 3rd row of 0s, but the other pieces draw…
Julk
  • 169
  • 7
-3
votes
1 answer

Characters matrix rotation in python

I wanna to make Tetris game and I need function, to rotate tetramino figure to 90 degrees. The tetramino figure is string array 4x4: figure = [ "..#.", "..#.", "..#.", "..#." ]; figure = rotateFigure(figure); After searches I…
Nikuro
  • 5
  • 2
-3
votes
1 answer

Program is drawing the same block in a tetris clone

I have wrote a small tetris clone. Blocks are random, but after 6 or 7 blocks program starts drawing the same block over and over again even when random block is passed to the paintBlock() method. Class where tetris board is drawn: import…
Vadim.D
  • 1
  • 2
-3
votes
1 answer

C# - switch array elements by 90°

I am trying to make a Tetris game. I finished everything so far, except the rotation function. So, to sum it up. The plan is to rotate the following array elements by 90°: (In this case its a bool array) . . . . . . . . . . . . x . .…
user4146732
-5
votes
1 answer

how can I set a highscore in my tetris game javascript html css

I want to set a highscore with localstorage in my tetris game that I put in my website. I want that you can set a username and show it with the amount of score. Can anyone help me please?
-6
votes
1 answer

How work this javascript arrow function and destructuring assignment code in tetris?

class Piece { constructor() { this.x = 0; this.y = 0; } move(p) { this.x = p.x; this.y = p.y; } } let piece = new Piece(); const KEY = { LEFT: 'ArrowLeft' } const moves = { [KEY.LEFT]: (p)…
-6
votes
1 answer

C# Tetris, clear the formed rectangle instead of row or line

I am developing a game with a concept of Tetris, But in my game what I want to clear is rectangle formed by the player instead of row or line. Like, for example, I instantiate that the blocks will be cleared if there are 4 rows and 5 columns filled…
JaneTho
  • 321
  • 1
  • 2
  • 13
-7
votes
1 answer

Tetris background sound

I am making a tetris game using glut libraries.I want to have sound in background. I have this code.Will it work? BOOL sndPlaySound( LPCTSTR lpszSound, UINT fuSound ); What I'm doing wrong? How can I solve it?
sadia
  • 1
  • 1
1 2 3
18
19