Just a quick look.
I agree with superflip.
What are the controls and what should happen?
I see you are checking A,B,C and <down>. What should they do?
[edit] already answered [/edit]
Should this logic deal with exactly one ship or a ship (design question)?
The first thing is there are 3 modules: MOD.py, MOD2.py MOD3.py
Why three of them?
What means MOD?
You set up sce (Sony Computer Entertainment ;)), cn (CN-tower of Toronto? :D) and ow (owls in space? :P) at the module level.
That is in general not a good idea. It means you can use this module for exactly one object.
Better update these references as soon as the code enters an entry point:
def Make(cont): #make what?
owner = cont.owner
scene = bge.logic.getCurrentScene()
allObjects = scene.objects
It seems you have a very strong dependency on object names in your code. That makes it very inflexible.
To make your code re-usable you should avoid hard-coded object names.
There are better ways:
- object name in a string property (n:1 relations)
- objects with a specific property (1:n relations)
- object parent (1:1)
- object children (1:n)
- logic brick owner (1:1)
- object in logic brick parameter e.g. the object of an TrackTo actuator (1:1)
- objects in logic brick arguments e.g. objectList of a Near sensor (1:n)
1:1 -> one object relates to exactly one other (e.g. one ship has one FPV-camera)
1:n -> one object relates to multiple others (e.g. one ship has multiple guns)
n:1 -> multiple objects relate to one object (e.g. multiple guns belong to one ship)
If you use hard-coded names you get n:1 but it is exactly one (singleton). e.g. You can’t have multiple ships each with multiple guns. it would make sense for a single player ship (if it never changes).
In you situation I think the best option is to use a property to define the player’s ship and the payload.
Hint: I define property names at the top of the module. This makes it much easier to change it later (if needed) at on central place. And it shows which properties are used within this module. It is not the best place as each entry point uses different properties.
This is my convention:
- Properties start with Upper case ‘P’ + camel case name starting with lower case letter. example: PpropertyName
- Variable names to be camel case name starting with lower case letter .Example: propertyName
PplayerShipName = "playerShip"
PpayloadType = "payload"
...
playerShipName = owner.get(PplayerShipName )
playerShip = scene.eddObjet(playerShipName, emitter)
...
payloadType = owner.get(PpayloadType )
payload = scene.addobject(payloadType, mountPount)
...
Your mount point is a singleton too. You can have only one in the whole scene. I do not know if that is what you want.
If you could describe the structure of your/a ship I think it would be easier to verify the design (of the game, the ship and the logic).
NEVER use except without a specific error!
Except should check for expected errors only (e.g. KeyError, AttributeError).
Otherwise you hide unexpected errors. This makes it nearly impossible to identify problems at the caught code.
The try block should be as small as possible. If possible with just one statement.
With multiple statements you can’t determine which one got the error. And the preceding statements are executed while the succeeding statements are skipped. This can easily lead to unwanted side effects.
In Release_payload() the code checks for the keyboard input.
This is not necessary as the keyboard sensor does this already for you. You just need to check if all sensors are positive (AND) or at least one (OR).
In Release_payload() the code checks for the keyboard input.