Another Basic Problem Door Open/Shut

Blitz3D Forums/Blitz3D Programming/Another Basic Problem Door Open/Shut

Do you loop through all the type collection, when you close/open a door ?
You have to control all the doors, not only one. If you use always the same door pointer, then you will only act on the same door.

I mean, in the section where the call to the open_door(door.t_door) function is, you should have a loop like:
For door.t_door = Each t_door
open_door(door)
.
.
next


In this way you loop through all the doors. If it works only with one door, is probably because the door pointer points always to the same type element...

More, you don't need to create a temporary mesh like you do with motellcd (and door1):
motellcd=FindChild( motel,"LCDoor" ) 
door.doorprop = New doorprop 
door\status=D_CLOSED 
door\mesh=motellcd 

You can write instead:
door.doorprop = New doorprop ;I would use t_door as type name, is more readable and mnemonic IMO.
door\mesh = FindChild( motel,"LCDoor" )
door\status = D_CLOSED 


Now open all doors !!! Then listen some song from 'The Doors' - LOL !
Sergio.