|
pygame is
pygame.org is
|
NanoBomber
NanoBomber - 694BHewitt Squared Labs (hewitt2labs)Tags:DescriptionA game inspired by a couple of snake games being made as byte compact as possible. Press space to drop a bomb, the squares to the right are worth more points. (the ones that turn black anyways)
Code
Warning! code is currently broken! see below for details
from pygame import *
D=display;L=D.set_mode((640,224)).fill;P=B=F=C=E=0;M=32;H=D.set_caption;
def I():
for e in event.get():
if e.type==12:z
if e.type==2:
if e.key==27:z
if e.key==32:return 1
while 1:
time.Clock().tick(10)
if E>0:
P-=32
if P<0:P=639
if F:B+=32
else:F=I()
if B>223:F=0;B=0
if B>64:C+=T[B/M][P/M][0];T[B/M][P/M][0]=0
E-=0.1;H("Score:%s Time:%s"%(C,E))
else:
H("Game Over Score:%s (space to start)"%(C));F=I()
if F:E=60;P=F=B=C=0;T=[[[x+1,x,y]for x in range(20)]for y in range(7)]
L(0)
for t in T:
for s in t:
g,x,y=s
if g:
j=255-x*12;L((j,255,j),((x*M,y*M),(M,M)))
L(255,((P+8,B+8),(2,2)));L(16711680,((P,0),(M*2,M)));D.flip()
Seriously considering a easier to read dev version!
Notes
- Byte count is using LF (linefeed) endings NOT CRLF(cairrage-return/linefeed) since gedit won't use CRLF.
- There is probably many things that could be done to make it shorter(much shorter) but it's working! (sort of :))
Agenda
(Numbered in order of pseudo-importance)
- Make "plane" fly all the time and only activate "bombs" when timer is going down.(It might make the code smaller)
- Make the top two rows of "blocks" black. They're not because
T[:2][:]=[0,0,0] won't make the first 40 sub-sub lists of T = [0,0,0]! (thinking about it, it should actually be: T[:2][:][0]=0 to change the color...)
- Move "plane" in pixel increments instead of 32p blocks
- Make "bomb" bigger. (Hard to see right now)
LinksScreenshot click to view original size
Releases| NanoBomber - 694B | - Apr 18, 2010 |
Pygame.org account CommentsIf you wish to leave a comment with your pygame.org account, please sign in first.
|
| spotlight |
|
|
|
| our projects |
|
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
|
|
|
| recent releases |
|
May 21, 2013
May 19, 2013
May 18, 2013
May 17, 2013
May 16, 2013
May 15, 2013
May 11, 2013
May 8, 2013
Apr 26, 2013
Apr 24, 2013
... more!
|
|