Skip to content

Commit

Permalink
Done a load of stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanteck committed Feb 5, 2015
1 parent 015600e commit 387e522
Show file tree
Hide file tree
Showing 20 changed files with 18 additions and 17 deletions.
Binary file removed Raspberroids-V2-FInal/bg.png
Binary file not shown.
Binary file added Raspberroids-V2-FInal/bgCompress.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Raspberroids-V2-FInal/bgCompress.png
Binary file not shown.
4 changes: 2 additions & 2 deletions Raspberroids-V2-FInal/effects.py
Expand Up @@ -21,7 +21,7 @@ class Explosion():
shouldRemove = False

def __init__(self, x, y):
self.imgpaths = ["expl/expl1.png", "expl/expl2.png", "expl/expl3.png", "expl/expl4.png", "expl/expl5.png", "expl/expl6.png"]
self.imgpaths = ["expl/expl1.gif", "expl/expl2.gif", "expl/expl3.gif", "expl/expl4.gif", "expl/expl5.gif", "expl/expl6.gif"]
self.imgs = []
for i in range(len(self.imgpaths)):
self.imgs.append(pygame.image.load(self.imgpaths[i]).convert_alpha())
Expand All @@ -44,4 +44,4 @@ def update(self):
self.image = self.imgs[self.animframe]

def draw(self, surface):
surface.blit(self.image, self.position)
surface.blit(self.image, self.position)
Binary file modified Raspberroids-V2-FInal/effects.pyc
Binary file not shown.
Binary file added Raspberroids-V2-FInal/expl/expl1.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Raspberroids-V2-FInal/expl/expl2.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Raspberroids-V2-FInal/expl/expl3.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Raspberroids-V2-FInal/expl/expl4.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Raspberroids-V2-FInal/expl/expl5.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Raspberroids-V2-FInal/expl/expl6.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions Raspberroids-V2-FInal/gun.py
Expand Up @@ -17,18 +17,19 @@ def update(self, dt):

def draw(self, surface):
# pygame.draw.circle(surface, pygame.Color("red"), [self.position.x, self.position.y], 3)
self.laser = pygame.image.load("laser.png").convert_alpha()
self.laser = pygame.image.load("laser.gif").convert_alpha()
self.lasercp = self.laser.copy
surface.blit(self.laser,(self.position.x,self.position.y))
rect = [self.position.x-2,self.position.y-2,self.position.x+2,self.position.y+2]
pygame.display.update(rect)
#pygame.display.update(rect)
#print rect

class Gun(pygame.sprite.Sprite):
@profile
def __init__(self,screen):
global rect;
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load("ship.png").convert_alpha()
self.image = pygame.image.load("ship.gif").convert_alpha()
self.imagecp = self.image.copy()
self.rect = self.image.get_rect(center=(320,240))
self.startx = 320
Expand All @@ -41,25 +42,25 @@ def __init__(self,screen):
self.bulletSpeed = 500
self.moveSpeed = 250.0
self.bullettime = 0
@profile
def turnRight(self):
self.angle -= 6
self.image = pygame.transform.rotate(self.imagecp, self.angle)
self.rect = self.image.get_rect(center=self.rect.center)
#print(self.angle)
@profile
def turnLeft(self):
self.angle += 6
self.image = pygame.transform.rotate(self.imagecp, self.angle)
self.rect = self.image.get_rect(center=self.rect.center)
#print(self.angle)


@profile
def update(self, dt):

for i in range(len(self.bullets)):
self.bullets[i].update(dt)

@profile
def draw(self, surface):


Expand All @@ -76,9 +77,9 @@ def draw(self, surface):

surface.blit(self.image, self.rect)
rect = [self.rect[0]-1,self.rect[1]-1,self.rect[0]+1,self.rect[1]+1]
pygame.display.update(rect)
#pygame.display.update(rect)
#print rect

@profile
def fire(self):
if self.bullettime == 5:
dx = -math.cos(math.radians(self.angle)) * self.bulletSpeed
Expand Down
Binary file modified Raspberroids-V2-FInal/gun.pyc
Binary file not shown.
Binary file added Raspberroids-V2-FInal/laser.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Raspberroids-V2-FInal/life.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Raspberroids-V2-FInal/life.jpg
Binary file not shown.
10 changes: 5 additions & 5 deletions Raspberroids-V2-FInal/main.py
Expand Up @@ -35,7 +35,7 @@
rand = "Now with more FPS!"

#Define the game
@profile
#@profile
def startGame(screen):
#Reset all dudes
#moveable_dude.reset()
Expand All @@ -47,7 +47,7 @@ def startGame(screen):
center = [320,240]
centership = [288,226]
pygame.display.set_caption("Raspberroids | A collaborative Project | " + rand) # Divinite added randomised titles.
lifeimg = pygame.image.load("life.png").convert_alpha()
lifeimg = pygame.image.load("life.gif").convert_alpha()
pygame.display.set_icon(lifeimg)

font = pygame.font.Font(None, 32)
Expand All @@ -60,7 +60,7 @@ def startGame(screen):

background = pygame.Surface(screensize)
background = background.convert()
backgroundimg = pygame.image.load("bgCompress.jpg")
backgroundimg = pygame.image.load("bgCompress.gif")
background.blit(backgroundimg,(0,0))

logo = "rptlogo.png"
Expand Down Expand Up @@ -101,7 +101,7 @@ def startGame(screen):
print clock.get_fps()
fpsLast = clock.get_fps()
screen.blit(background,(0,0)) # comment
#pygame.display.update()
pygame.display.update()

milliseconds = clock.tick() # comment
hp = gunnew.hp
Expand All @@ -112,7 +112,7 @@ def startGame(screen):
background.blit(backgroundimg,(0,0))
background.blit(text, (10,15)) # comment
background.blit(scoretext, (240,450))
pygame.display.update([10,15,450,25])
#pygame.display.update([10,15,450,25])
moveable_dude.updateAndDrawDudes(background)

effects.update()
Expand Down
Binary file modified Raspberroids-V2-FInal/main.py.lprof
Binary file not shown.
Binary file modified Raspberroids-V2-FInal/moveable_dude.pyc
Binary file not shown.
Binary file added Raspberroids-V2-FInal/ship.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 387e522

Please sign in to comment.