Hardware Reference
In-Depth Information
raspberryPosition = [int(x*20),int(y*20)]
raspberrySpawned = 1
playSurface.fill(blackColour)
for position in snakeSegments:
pygame.draw.rect(playSurface,whiteColour,Rect Æ
(position[0], position[1], 20, 20))
pygame.draw.rect(playSurface,redColour,Rect Æ
(raspberryPosition[0], raspberryPosition[1], 20, 20))
pygame.display.flip()
if snakePosition[0] > 620 or snakePosition[0] < 0:
gameOver()
if snakePosition[1] > 460 or snakePosition[1] < 0:
for snakeBody in snakeSegments[1:]:
if snakePosition[0] == snakeBody[0] and Æ
snakePosition[1] == snakeBody[1]:
gameOver()
fpsClock.tick(30)
IRC User List (Chapter 11, Example 4)
#!/usr/bin/env python
# IRC User List
# Written by Tom Hudson for the Raspberry Pi User Guide
# http://tomhudson.co.uk/
import sys, socket, time
RPL_NAMREPLY = '353'
RPL_ENDOFNAMES = '366'
irc = {
'host': 'chat.freenode.net',
'port': 6667,
'channel': '#raspiuserguide',
'namesinterval': 5
}
user = {
'nick': 'botnick',
'username': 'botuser',
Search WWH ::




Custom Search