Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

My Code wont run tetris properly?

Can anyone help me with this, its due tomorrow. I've been working on it all day, or at least give me a hint whats wrong with it please!

https://pastebin.com/25dquBga
I didn't know Python could get so intense. I'm also learning it
I'm busy but posting to check it later. From fast skim I've noticed
Code
fallingPiece = nextPiece
nextPiece = getNewPiece()

Are you sure this is in good order

not going to bother to note the obvious wrongs here and the amount of autism in the beginning part because i'm sure you had a fun time writing it.

[looks at rest of code]

no im sure you've totally debugged the rest of this shit, the fact you couldn't even add syntax highlighting makes me squirt vomit.

ill just paste the obviously stupid shit

Code
newPiece = {'shape': shape,
                'rotation': random.randint(0, len(PIECES[shape]) - 1),
                'x': int(BOARDWIDTH / 2) - int(TEMPLATEWIDTH / 2),
                'y': -2, # start it above the board (i.e. less than 0)
                'color': random.randint(0, len(COLORS)-1)}
                              
    return newPiece

Code
if PIECES[piece['shape']][piece['rotation']][y][x] != BLANK:
                board[x + piece['x']][y+ piece['y']] = [piece['color']]

Code
LIGHTCOLORS = (LIGHTBLUE, LIGHTGREEN, LIGHTRED, LIGHTYELLOW)

Code
BLANK="."

Code
from pygame.locals import *

look i like dynamic code as much as the next person but this is OvK af.

also the fact you're not even utilizing the BLANK variable in the templates = kek
Mon affection- pour toi, toujours


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by lilhackingMay 15, 2020 09:58 AM 2 102 May 15, 2020 09:58 AM
Last Post: lilhacking
[C#] by SIM-888979Jul 27, 2017 08:40 PM 10 291 Jul 27, 2017 08:40 PM
Last Post: Ninja
[Python] by 41phafr34kMar 20, 2017 11:50 PM 11 383 Mar 20, 2017 11:50 PM
Last Post: obby