Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sprites and Actor error
#5
The book has a glossary at the back (thank you Amazon preview), and the code is as you describe. No imports, Actor without being imported/defined, etc. So I looked at the introduction.

It uses Pygame Zero, which is apparently a wrapper around python/pygame that adds a few things auto-magically for you to make building games faster.

https://pygame-zero.readthedocs.io/en/st...ction.html

You need to run your program through pygame zero, since it adds a few magic things for you (like opening a window, handling OS events, defining what an Actor or a Sprite are, etc). So running like python my_file.py won't work, but pgzrun my_file.py should work.

If you haven't already installed pygame zero, you'll need to do so before that command will work, though. If python is already installed, installing pygame zero should be as easy as pip install pgzero.

Interestingly, it's installed by default on Raspbian, which is an OS for RaspberryPis, which explains (at least to me) why it's called pygameZERO, as the Zero is a relatively new version of the raspberry pi that's super inexpensive (I picked up 3 of them at $5 each).
Reply


Messages In This Thread
Sprites and Actor error - by ajlconsulting - Nov-07-2018, 12:41 AM
RE: Sprites and Actor error - by nilamo - Nov-07-2018, 01:04 AM
RE: Sprites and Actor error - by ajlconsulting - Nov-07-2018, 08:46 AM
RE: Sprites and Actor error - by metulburr - Nov-07-2018, 01:02 PM
RE: Sprites and Actor error - by nilamo - Nov-07-2018, 04:25 PM
RE: Sprites and Actor error - by nitin - Jan-30-2019, 12:00 AM
RE: Sprites and Actor error - by metulburr - Jan-30-2019, 12:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pygame, sprites, and rects menator01 12 1,929 Dec-07-2023, 02:37 AM
Last Post: Benixon
  [PyGame] Sprites just randomly appear and dissapear in my pygame.sprite.GoupeSingle trueShadoWrr 2 1,995 Feb-13-2023, 09:34 AM
Last Post: Vadanane
  Pygame Zero - no actor image toiling_away 2 1,803 Oct-14-2022, 12:16 AM
Last Post: toiling_away
  [PyGame] I found a way to generate sprites without .blit. Is it effecient? xBlackHeartx 19 8,468 Dec-07-2019, 01:06 PM
Last Post: metulburr
  [PyGame] Having 4 players(Sprites) all being able to jump ElijahCastle 5 4,019 May-07-2019, 05:04 PM
Last Post: SheeppOSU
  draw not showing all sprites ethanstrominger 0 2,591 Jan-25-2019, 10:10 PM
Last Post: ethanstrominger
  [PyGame] move randomly sprites reutB 4 8,245 Mar-29-2017, 01:12 PM
Last Post: metulburr
  How can I get rid of the line following the sprites? Houston11 1 3,745 Jan-06-2017, 10:14 PM
Last Post: Mekire

Forum Jump:

User Panel Messages

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