aboutsummaryrefslogtreecommitdiff
path: root/client/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'client/client.py')
-rw-r--r--client/client.py35
1 files changed, 4 insertions, 31 deletions
diff --git a/client/client.py b/client/client.py
index 814dac5..67cece7 100644
--- a/client/client.py
+++ b/client/client.py
@@ -10,7 +10,7 @@ LARGEUR_BLOCK = 10
NB_BLOCKS = 30
LARGEUR_ECRAN = LARGEUR_BLOCK * NB_BLOCKS
-def connect(ip_adress, port):
+def connect():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip_adress,port))
return s
@@ -37,6 +37,7 @@ def update(gameId = 1, direction = None):
received = sendData(json.dumps(data))
return json.loads(received)
+"""
def draw(up):
snake = []
for coords in up['SNAKE']:
@@ -52,41 +53,13 @@ def draw(up):
else:
s = s + ' '
-
-import pygame
-
-pygame.init()
-screen = pygame.display.set_mode((400, 300))
-done = False
-
def main():
#s = connect('192.168.1.14', 8090)
gameInit = newGame()
up = update(gameInit['ID'])
- """
while True:
direction = raw_input()
up = update(gameInit['ID'], direction)
- draw(up)"""
-
- continuer = True
- pygame.init()
- ecran = pygame.display.set_mode((LARGEUR_ECRAN,LARGEUR_ECRAN))
-
-
- while continuer:
- snakeSprite = pygame.image.load("snake-sprite.png")
- snakeSprite = snakeSprite.convert_alpha()
- pygame.draw.rect(ecran, (0,0,90), (0,0,LARGEUR_ECRAN,LARGEUR_ECRAN))
- ecran.blit(snakeSprite, (-50,0))
- for event in pygame.event.get():
- if event.type == pygame.KEYDOWN:
- continuer = False
- pygame.display.flip()
-
- pygame.quit()
-
-
-if __name__ == '__main__':
- main() \ No newline at end of file
+ draw(up)
+"""