Added image for fruits
TODO: Optimize GameObjects class for images and sprites
This commit is contained in:
@@ -93,6 +93,8 @@ def spawn_entities(x:int, list_of_objects:list):
|
||||
|
||||
background = pygame.surface.Surface((640,480))
|
||||
|
||||
imageobj = GOIMAGE("TEST", PLAYGROUND, PLAYGROUND.get_size(), 50, 50, image="data/models/fruit1.jpeg", rect_size=(15,50))
|
||||
|
||||
x = 3600
|
||||
invert = False
|
||||
|
||||
@@ -135,6 +137,8 @@ while active == True:
|
||||
MAINSCREEN.blit(text_surface_score, (MAINSCREEN_SIZE[0]/2-text_surface_score.get_size()[0]/2,0)) #Paints the Scoreboard in Top/Center
|
||||
MAINSCREEN.blit(text_surface_player, (10, 0))
|
||||
|
||||
imageobj.draw()
|
||||
|
||||
if(spawn_fruit == True):
|
||||
fruit = Fruit("Fruit", PLAYGROUND, PLAYGROUND.get_size(), init_pos_x=rand.randint(0, PLAYGROUND.get_size()[0]-40), init_pos_y=rand.randint(0, PLAYGROUND.get_size()[1]-40), color=ROT, rect_size=40, score_points=10)
|
||||
spawn_fruit = False
|
||||
|
||||
Reference in New Issue
Block a user