python - Printing text - Pygame -


I'm wondering how to print text with the use of piegages, I currently have this code ( Which I thought would work but):

  for player player in list: block_hit_list = pygame.sprite.spritecollide (player, block_list, true) for block_hit_list block: health - = 25 Collision.play () if health == 0: font = pygame.font.font ("freesansbold.ttf", 30) label = font.render ("game over", 1, (255,100,0)) screen. Bluttle (label, (400, 300)) Break if health == 0: gameover.play () collision.stop () player_list.remove (player) all_sprites_list.remove (player) block_list.remove (block) all_sprites_list.remove (block )   

I'm not sure why she is not printing, if someone has any suggestions, then the ID appreciates the help!

: label = font says that below the line labelRect = label.get_rect () labelRect.center = (400, 300)

render ...

Then, Remove the code> screen. Blut with this:

  screen.blit (label, labelrect)   

I hope this is useful.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -