Python Forum
Pygame Zero - no actor image - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Game Development (https://python-forum.io/forum-11.html)
+--- Thread: Pygame Zero - no actor image (/thread-38425.html)



Pygame Zero - no actor image - toiling_away - Oct-11-2022

Hi all, I'm learning pygame zero and am trying to make a version of the gamemaker's apprentice game I've previously done. The attached code runs without any errors apart from the fact that the actor 'baby' created in the update_boss function does not have any image. I have confirmed that the image file is fine by creating the object in a separate file but when this file created, its not visible. The object does exist however, as I can see the score increasing when the object collides with the dragon. I have been looking at this for too long and can't see the error causing the actor image to not be visible. Any help appreciated.


RE: Pygame Zero - no actor image - deanhystad - Oct-13-2022

There is no problem with the actor image. You have an error in update_good_babies().
baby.colliderect(dragon) returns True or False.
demon.circle_collidepoints(50, fireballs) returns an int.
Your program treats them like they return the same kind of values.


RE: Pygame Zero - no actor image - toiling_away - Oct-14-2022

Thank you! That solved my problem!

(Oct-13-2022, 07:37 PM)deanhystad Wrote: There is no problem with the actor image. You have an error update_good_babies().
baby.colliderect(dragon) returns True or False.
demon.circle_collidepoints(50, fireballs) returns an int.
Your program treats them like they return the same kind of values.