First Game on Panda3D

Hi people, this is a community, and i think the projects should be shared.

This is the my first game on Panda3D is nothing else, but only started the program in March in Panda3D, and did nothing because I had deadlines, but as I became interested in Panda3D, want to see if I improve this game, or create from scratch another better, because it still has many beginner’s mistakes.

Then here it is…For run, run the Game.py class…

dl.dropbox.com/u/1168090/Ultimat … r_v1.0.zip

Ah, and sorry for the comments on code, but i’m portuguese and has not changed the comments.

Best Regards,
André.

Didn’t look into the code yet, but the gameplay looks interesting.

I found a few things one might consider bugs:
-there are two windows on start, one with the game and another grey one
-The sounds are terrible…

Yes the windows i dont know how it appear…and i don’t have tried remove it lol…

And the sounds, its sounds familiars of portuguese football…

But just 2 things on a first game, not bad… :slight_smile:

Thanks,
André.

The double window problem is present because you import both direct.directbase.DirectStart and ShowBase right here:

from direct.showbase.ShowBase import ShowBase
from pandac.PandaModules import*
from direct.task import Task
import direct.directbase.DirectStart

Usually when structuring a big game with Panda you can choose 2 approaches:

  • the first is using directStart which gives you global scoping so you don’t need to create a class in order to call Panda’s functions such as loader.loadModel()
  • the second is subclassing ShowBase as you did, then create an instance of the class and calling run as an attribute of the object.

You mixed them :slight_smile: using sounds as globals and the other inside the class as attributes.
I also modified your code in order to work and not showing the grey window (I cut away directStart) and moved the sounds inside the class. I used builtin module in order to let you use those variables with global scoping (too lazy to change all to self.blabla).

Game.py → pastebin.com/RMJfQy20
screen.py → pastebin.com/3LvSccvq

I wish you all the luck! And nice game! (lol I scored whoaa)

Very thanks for the explanation, I’m still new to object oriented programming … And this was my first experience, I hope to contribute to future developments in this forum with the best … :wink:

And Thanks again,
André.