Passing alot of variables to a function...

BlitzMax Forums/BlitzMax Beginners Area/Passing alot of variables to a function...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

My particle system does it slightly differently and i think it's the most efficient way to do it, when a particle is created it inherits it's properties from it's parent emmitter.

example:

Type Emitter
  Field x:float, y:float, z:float
  Field ParticleMass:Int, ParticleMassVariation:Byte
  Field ParticleAngle:Float, ParticleAngleVariation:Byte

  Method IssueProperties( Target:Particle )
    Target.Mass = ParticleMass + ParticleMassVariation
    Target.Angle = ParticleAngle + ParticleAngleVariation
    'etc etc
  End Method
End Type

Type Particle
  Field Parent:Emmitter
  Field Mass:Int
  Field Angle:Float

  Function Create:Particle( NewParent:Emmitter )
    Local NewP:Particle = new Particle
    NewP.Parent = NewParent
    NewP.Parent.IssueProperties( NewP )
  End Function
End Type