Skip to content
Snippets Groups Projects
Commit 0fd48be5 authored by s2032074's avatar s2032074
Browse files

id field is added to the block

parent 34828cec
No related branches found
No related tags found
No related merge requests found
......@@ -10,11 +10,13 @@ class Block:
#x and y -- coordinates of the top left corner
#length -- the length of one side of the square
#pressed -- is the boolean variable for detecting whether a user clicked on the block
def __init__(self, x, y, length, pressed):
#ID -- the id of the block
def __init__(self, x, y, length, pressed, ID):
self.x_coord = x
self.y_coord = y
self.length = length
self.pressed = pressed
self.ID = ID
def draw_block(self, screen):
'''function for drawing a block with initialized parameters'''
......@@ -52,7 +54,7 @@ def main():
#creating an object
pressed = False
block1 = Block(100, 100, 50, pressed)
block1 = Block(100, 100, 50, pressed, 1)
#drawing initial block
#block1.draw_block(screen)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment