0

I am new to game development and am trying to develop a game with panda3d. Can we directly use Pygame modules along with Panda3d ones?

Akash21795
  • 61
  • 1
  • 12

2 Answers2

1

yes you can but

PyGame and Panda3D have their own main game loops its not recommended to use both loops

you can use panda3d to display 3D.

and use Pygame to do other things like play sound and handle inputs (Keyboard, mouse .... etc) Pygame easier than panda3d (from my POV)

you can't use both of them to display graphic (in real you can but its too hard and complex) instead try to use panda2d or onscreen Image, see this for more information.

E R
  • 480
  • 1
  • 8
  • 20
0

Yes. Both Panda3D and PyGame are Python modules that can be used in any (compatible) Python installation. There is (at least to my awareness) nothing about either library that prevents you from importing other Python modules.

Depending on what you're trying to do, though, the answer may be more tricky. For instance, presumably both PyGame and Panda3D have their own main game loops, and using them together would require making one game loop run as a part of the other library's game loop.

Sharing resources or graphics contexts would also be tricky, as both libraries manage their own graphics state. It would be a lot more tricky (but not necessarily impossible) if your question included, for example, drawing PyGame elements into a Panda3D window or vice versa.

rdb
  • 1,488
  • 1
  • 14
  • 24
  • I don't know about panda3d, blt one of pygames selling points is that you use your own main loop. (Point 7 [here](https://www.pygame.org/wiki/about)) – import huh Feb 26 '21 at 05:59