Loading and using modules [SOLVED]

Here I am again frustrated with a language that I’m unfamiliar with. So here goes.

Seeing that I’m coming up with a demo game, I need help separating all of the various classes, variables etc. into individual modules.

I’ll start with a simple example.

I want to create a Camera class in a file camera.py. Alright, simple. When the class initiallizes, it should set the camera to a default position. The Camera class contains functions to move the camera, let’s say moveCameraLeft and moveCameraRight. Exactly what these funtions do is not important.

No I go to my main module.

  1. How do I ‘import’ the camera object so that I canm use it?
  2. What information do I need to supply the Camera class in order to use the same camera that seems to be created upon startup of the main class? (let’s call it class World(DirectObject)).
  3. How do I use the functions moveCameraRight & moveCameraLeft and have it move the same camera that’s been created in World()?

I hope my question makes sense. Thanks!

Leeor

=============================================

Update: I figured out my problem… grr… silly me. I forgot to use base.disableMouse().

So problem is solved? In that case, maybe you want to edit your post and add “solved” to the headline?

Thanks :slight_smile:

Regards, Bigfoot29

Actually, that’s a good idea. I’ll do that now.

ah. thanks. That adds more readability to the forums. ppl can make sure to find an answer here - and ppl looking if they can help can spread topics marked as “solved” :slight_smile:

Regards, Bigfoot29