Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The PyWeek challenge

Name: Anonymous 2011-03-22 10:43


   1. Invites entrants to write a game in one week from scratch either as an individual or in a team,
   2. Is intended to be challenging and fun,
   3. Will hopefully increase the public body of game tools, code and expertise,
   4. Will let a lot of people actually finish a game, and
   5. May inspire new projects (with ready made teams!)

Name: Anonymous 2011-03-22 10:49

So?

Name: Anonymous 2011-03-22 10:51

What's a πweek?

Name: Anonymous 2011-03-22 11:28

>>3
a RuWeek

Name: Anonymous 2011-03-22 11:35



#!/usr/bin/python
import sys
import pygame
from pygame.locals import *

screen_size = (640, 480)
screen_rect = Rect((0, 0), screen_size)

def main():
    LEFT = False
    RIGHT = False
    UP = False
    DOWN = False
    DIRECTION = "DOWN"
    LENGHT = 8
    #init pygame and get screen object
    pygame.init()
    screen = pygame.display.set_mode(screen_rect.size)

    #bg rectangle for blitting/clearing screen
    background = pygame.Surface(screen_rect.size).convert()
    background.fill((0, 0 ,100))

    #snake block and array
    snake_rect = pygame.Surface((10, 10)).convert()
    snake_rect.fill((255, 0, 0))
    snake_array = [[20, 20], ] #initial position, div by 10

    #clear screen before anything else
    screen.blit(background, (0, 0))
    pygame.display.update()

    #get clock for FPS limit
    clock = pygame.time.Clock()

    while 1:
        #get key events and toggle booleans
        for event in pygame.event.get():
            if event.type == QUIT: return
        if (event.type == KEYUP):
            if (event.key == K_UP): UP = False
            if (event.key == K_LEFT): LEFT = False
            if (event.key == K_RIGHT): RIGHT = False
            if (event.key == K_DOWN): DOWN = False
        if (event.type == KEYDOWN):
            if (event.key == K_UP) and ( DIRECTION == "LEFT" or DIRECTION == "RIGHT" ): DIRECTION = "UP"
            if (event.key == K_LEFT) and ( DIRECTION == "UP" or DIRECTION == "DOWN" ): DIRECTION = "LEFT"
            if (event.key == K_RIGHT) and ( DIRECTION == "UP" or DIRECTION == "DOWN" ): DIRECTION = "RIGHT"
            if (event.key == K_DOWN) and ( DIRECTION == "LEFT" or DIRECTION == "RIGHT" ): DIRECTION = "DOWN"
            if (event.key == K_c): LENGHT = LENGHT + 1
        #clear screen
        screen.blit(background, (0, 0))

        #update
        if DIRECTION == "DOWN":
            last_pos = snake_array[-1] #get last position/element
            snake_array.append([last_pos[0], last_pos[1]+10]) #append new position
        if DIRECTION == "UP":
            last_pos = snake_array[-1]
            snake_array.append([last_pos[0], last_pos[1]-10])
        if DIRECTION == "LEFT":
            last_pos = snake_array[-1]
            snake_array.append([last_pos[0]-10, last_pos[1]])
        if DIRECTION == "RIGHT":
            last_pos = snake_array[-1]
            snake_array.append([last_pos[0]+10, last_pos[1]])

        #snake length logic
        if LENGHT > len(snake_array):
            #print "LENGHT:" + str(LENGHT) + " ARRAY LEN:" + str(len(snake_array))
            pass
        else:
            snake_array.pop(0) # remove first element


        #redraw
        #print snake_array
        for i in snake_array:
            screen.blit(snake_rect, i)
        pygame.display.update()

        #30 FPS
        clock.tick(30)
main()

Name: Anonymous 2011-03-22 12:05

Will hopefully increase the public body of shitty Tetяis™® clones, buggy, useless and undocumented "game libraries" and noob expertise.

Name: Anonymous 2011-03-22 12:23

import gaem
gaem.start()

omg im an phyton programer

Name: Anonymous 2011-03-22 12:28

>>7

Actually the correct English word is ``game'', not ``gaem''.

Name: Anonymous 2011-03-22 13:13

>>8
Your an phaggot

Name: Anonymous 2011-03-22 13:33

>>8
YHBT
IHBT

Name: Anonymous 2011-03-22 13:48

WAHBT

Name: Anonymous 2011-03-22 14:13


ONE
    ENTIRE
        WEEK OF
THIS?

Name: Anonymous 2011-03-22 14:29

>>12
VALID FORTH CODE ;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List