| 102 | return randApplex,randAppley |
| 103 | |
| 104 | def snake(block_size,snakeList): |
| 105 | |
| 106 | if direction=="right": |
| 107 | head=pygame.transform.rotate(img,270) |
| 108 | if direction=="left": |
| 109 | head=pygame.transform.rotate(img,90) |
| 110 | if direction=="up": |
| 111 | head=img |
| 112 | if direction=="down": |
| 113 | head=pygame.transform.rotate(img,180) |
| 114 | |
| 115 | gameDisplay.blit(head,(snakeList[-1][0],snakeList[-1][1])) |
| 116 | |
| 117 | for XnY in snakeList[:-1]: |
| 118 | pygame.draw.rect(gameDisplay, green, (XnY[0],XnY[1],block_size,block_size)) |
| 119 | |
| 120 | def text_objects(text,color,size): |
| 121 | |