Types, room.chair

Blitz3D Forums/Blitz3D Beginners Area/Types, room.chair

There are simpler, less dynamic ways like using a type array within a type. For example ..

const MaxWeapons = 5

type Weapon
field Blah
field Blah2
end type

Type Ship
field Mesh
field Blah
field Weapon.Weapon[ MaxWeapons-1 ]
End type

It really depends on how complex you need your ship / weapon type structures to be. How does your game work in terms of the weapons? Is there a finite number of weapon slots? When and how do they get removed? When removed do you default to the next avalable weapon? Do you always have at least one weapon?

Etc ..