Python Forum
Pygame Zero - no actor image
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame Zero - no actor image
#1
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.
Larz60+ write Oct-11-2022, 10:58 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Attached Files

.py   game1.py (Size: 4.01 KB / Downloads: 112)
Reply
#2
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.
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to make an image move in relation to another in PYGAME CompleteNewb 1 2,280 Nov-10-2021, 03:38 PM
Last Post: metulburr
  open cv ->pygame: turn image into location Gamedeveloper 1 2,030 Jan-20-2020, 05:00 PM
Last Post: michael1789
  [PyGame] pygame image loading error BlueClaw 6 6,324 Dec-10-2019, 08:50 PM
Last Post: BlueClaw
  pygame uploading image from opengameart fatimabttt 3 2,950 Apr-16-2019, 08:50 PM
Last Post: nilamo
  Finding the brightness of an image using pygame Zman350x 2 3,378 Feb-21-2019, 12:20 PM
Last Post: Zman350x
  Sprites and Actor error ajlconsulting 6 9,203 Jan-30-2019, 12:50 AM
Last Post: metulburr
  [pyGame] Load Image, Problem Found ! JamieVanCadsand 2 8,687 Sep-29-2017, 06:26 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020