new sprites

This commit is contained in:
Page Asgardius 2022-01-02 15:40:28 -07:00
parent 99f6d4f00c
commit f50e7eeb09
3 changed files with 22 additions and 1 deletions

Binary file not shown.

23
r3.py
View file

@ -149,7 +149,20 @@ class Bus(pygame.sprite.Sprite):
#self.image = pygame.Surface((32, 32)) #self.image = pygame.Surface((32, 32))
#self.image.fill(WHITE) #self.image.fill(WHITE)
#self.rect = self.image.get_rect() # Get rect of some size as 'image'. #self.rect = self.image.get_rect() # Get rect of some size as 'image'.
self.rect = pygame.Rect(self.x,self.y,69, 120) self.rect = pygame.Rect(self.x,self.y,118, 63)
self.velocity = [0, 0]
def update(self):
self.rect.move_ip(bx, by)
class Tc(pygame.sprite.Sprite):
def __init__(self,xset,yset):
pygame.sprite.Sprite.__init__(self)
self.x = xset
self.y = yset
self.image = pygame.image.load('sprites/tc.png')
#self.image = pygame.Surface((32, 32))
#self.image.fill(WHITE)
#self.rect = self.image.get_rect() # Get rect of some size as 'image'.
self.rect = pygame.Rect(self.x,self.y,118, 63)
self.velocity = [0, 0] self.velocity = [0, 0]
def update(self): def update(self):
self.rect.move_ip(bx, by) self.rect.move_ip(bx, by)
@ -199,6 +212,7 @@ sat1 = Sat(550,-100)
sat2 = Sat(600,100) sat2 = Sat(600,100)
goal = Goal(3000,-100) goal = Goal(3000,-100)
bus1 = Bus(600,656) bus1 = Bus(600,656)
tc1 = Tc(854,472)
ast1 = Ast1(120,200) ast1 = Ast1(120,200)
ast2 = Ast2(300,100) ast2 = Ast2(300,100)
ast3 = Ast3(500,150) ast3 = Ast3(500,150)
@ -247,6 +261,7 @@ while running:
sat2 = Sat(600,100) sat2 = Sat(600,100)
goal = Goal(3000,-100) goal = Goal(3000,-100)
bus1 = Bus(600,656) bus1 = Bus(600,656)
tc1 = Tc(854,472)
ast1 = Ast1(120,200) ast1 = Ast1(120,200)
ast2 = Ast2(300,100) ast2 = Ast2(300,100)
ast3 = Ast3(500,150) ast3 = Ast3(500,150)
@ -313,6 +328,10 @@ while running:
live = False live = False
pygame.mixer.music.stop() pygame.mixer.music.stop()
csfx.play() csfx.play()
elif pygame.sprite.collide_rect(player, tc1):
live = False
pygame.mixer.music.stop()
csfx.play()
elif pygame.sprite.collide_rect(player, goal): elif pygame.sprite.collide_rect(player, goal):
live = False live = False
complete = True complete = True
@ -325,6 +344,7 @@ while running:
sat2.update() sat2.update()
goal.update() goal.update()
bus1.update() bus1.update()
tc1.update()
ast1.update() ast1.update()
ast2.update() ast2.update()
ast3.update() ast3.update()
@ -344,6 +364,7 @@ while running:
screen.blit(sat2.image, sat2.rect) screen.blit(sat2.image, sat2.rect)
screen.blit(goal.image, goal.rect) screen.blit(goal.image, goal.rect)
screen.blit(bus1.image, bus1.rect) screen.blit(bus1.image, bus1.rect)
screen.blit(tc1.image, tc1.rect)
screen.blit(wall1.image, wall1.rect) screen.blit(wall1.image, wall1.rect)
screen.blit(wall2.image, wall2.rect) screen.blit(wall2.image, wall2.rect)
screen.blit(wall3.image, wall3.rect) screen.blit(wall3.image, wall3.rect)

BIN
sprites/tc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB