Y miqueas, vos querias algo sobre partìculas. Acà tenes
- Private Function Particle_Group_Next_Open() As Long
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- '
- '*****************************************************************
- On Error GoTo ErrorHandler:
- Dim loopc As Long
- If particle_group_last = 0 Then
- Particle_Group_Next_Open = 1
- Exit Function
- End If
- loopc = 1
- Do Until particle_group_list(loopc).active = False
- If loopc = particle_group_last Then
- Particle_Group_Next_Open = particle_group_last + 1
- Exit Function
- End If
- loopc = loopc + 1
- Loop
- Particle_Group_Next_Open = loopc
- Exit Function
- ErrorHandler:
- Particle_Group_Next_Open = 1
- End Function
- Private Function Particle_Group_Check(ByVal particle_group_index As Long) As Boolean
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- '
- '**************************************************************
- 'check index
- If particle_group_index > 0 And particle_group_index <= particle_group_last Then
- If particle_group_list(particle_group_index).active Then
- Particle_Group_Check = True
- End If
- End If
- End Function
- Public Function Particle_Group_Create(ByVal map_x As Integer, ByVal map_y As Integer, ByRef grh_index_list() As Long, ByRef rgb_list() As Long, _
- Optional ByVal particle_count As Long = 20, Optional ByVal stream_type As Long = 1, _
- Optional ByVal alpha_blend As Boolean, Optional ByVal alive_counter As Long = -1, _
- Optional ByVal frame_speed As Single = 0.5, Optional ByVal id As Long, _
- Optional ByVal x1 As Integer, Optional ByVal y1 As Integer, Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, Optional grav_strength As Long, _
- Optional bounce_strength As Long, Optional ByVal x2 As Integer, Optional ByVal y2 As Integer, _
- Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, _
- Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, _
- Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, _
- Optional grh_resizex As Integer, Optional grh_resizey As Integer)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Modified by: Ryan Cain (Onezero)
- 'Last Modify Date: 5/14/2003
- 'Returns the particle_group_index if successful, else 0
- 'Modified by Juan Martín Sotuyo Dodero
- 'Modified by Augusto José Rando
- '**************************************************************
- If (map_x <> -1) And (map_y <> -1) Then
- If Map_Particle_Group_Get(map_x, map_y) = 0 Then
- Particle_Group_Create = Particle_Group_Next_Open
- Particle_Group_Make Particle_Group_Create, map_x, map_y, particle_count, stream_type, grh_index_list(), rgb_list(), alpha_blend, alive_counter, frame_speed, id, x1, y1, angle, vecx1, vecx2, vecy1, vecy2, life1, life2, fric, spin_speedL, gravity, grav_strength, bounce_strength, x2, y2, XMove, move_x1, move_x2, move_y1, move_y2, YMove, spin_speedH, spin, grh_resize, grh_resizex, grh_resizey
- End If
- Else
- Particle_Group_Create = Particle_Group_Next_Open
- Particle_Group_Make Particle_Group_Create, map_x, map_y, particle_count, stream_type, grh_index_list(), rgb_list(), alpha_blend, alive_counter, frame_speed, id, x1, y1, angle, vecx1, vecx2, vecy1, vecy2, life1, life2, fric, spin_speedL, gravity, grav_strength, bounce_strength, x2, y2, XMove, move_x1, move_x2, move_y1, move_y2, YMove, spin_speedH, spin, grh_resize, grh_resizex, grh_resizey
- End If
- End Function
- Public Function Particle_Group_Remove(ByVal particle_group_index As Long) As Boolean
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- '
- '*****************************************************************
- 'Make sure it's a legal index
- If Particle_Group_Check(particle_group_index) Then
- Particle_Group_Destroy particle_group_index
- Particle_Group_Remove = True
- End If
- End Function
- Public Function Particle_Group_Remove_All() As Boolean
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- '
- '*****************************************************************
- Dim Index As Long
- For Index = 1 To particle_group_last
- 'Make sure it's a legal index
- If Particle_Group_Check(Index) Then
- Particle_Group_Destroy Index
- End If
- Next Index
- Particle_Group_Remove_All = True
- End Function
- Public Function Particle_Group_Find(ByVal id As Long) As Long
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- 'Find the index related to the handle
- '*****************************************************************
- On Error GoTo ErrorHandler:
- Dim loopc As Long
- loopc = 1
- Do Until particle_group_list(loopc).id = id
- If loopc = particle_group_last Then
- Particle_Group_Find = 0
- Exit Function
- End If
- loopc = loopc + 1
- Loop
- Particle_Group_Find = loopc
- Exit Function
- ErrorHandler:
- Particle_Group_Find = 0
- End Function
- Public Function Particle_Get_Type(ByVal particle_group_index As Long) As Byte
- On Error GoTo ErrorHandler:
- Particle_Get_Type = particle_group_list(particle_group_index).stream_type
- Exit Function
- ErrorHandler:
- Particle_Get_Type = 0
- End Function
- Private Sub Particle_Group_Destroy(ByVal particle_group_index As Long)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- '
- '**************************************************************
- On Error Resume Next
- Dim temp As particle_group
- Dim i As Integer
- If particle_group_list(particle_group_index).map_x > 0 And particle_group_list(particle_group_index).map_y > 0 Then
- MapData(particle_group_list(particle_group_index).map_x, particle_group_list(particle_group_index).map_y).particle_group_index = 0
- ElseIf particle_group_list(particle_group_index).char_index Then
- If Char_Check(particle_group_list(particle_group_index).char_index) Then
- For i = 1 To charlist(particle_group_list(particle_group_index).char_index).particle_count
- If charlist(particle_group_list(particle_group_index).char_index).particle_group(i) = particle_group_index Then
- charlist(particle_group_list(particle_group_index).char_index).particle_group(i) = 0
- 'We don't resize arrays by now, it's really a waste...
- 'If i = UBound(CharList(particle_group_list(particle_group_index).char_index).particle_group) Then
- ' CharList(particle_group_list(particle_group_index).char_index).particle_count = i - 1
- ' ReDim Preserve CharList(particle_group_list(particle_group_index).char_index).particle_group(1 To (i - 1)) As Long
- 'End If
- Exit For
- End If
- Next i
- End If
- ElseIf particle_group_index = meteo_particle Then
- meteo_particle = 0
- End If
- particle_group_list(particle_group_index) = temp
- 'Update array size
- If particle_group_index = particle_group_last Then
- Do Until particle_group_list(particle_group_last).active
- particle_group_last = particle_group_last - 1
- If particle_group_last = 0 Then
- particle_group_count = 0
- Exit Sub
- End If
- Loop
- Debug.Print particle_group_last & "," & UBound(particle_group_list)
- ReDim Preserve particle_group_list(1 To particle_group_last) As particle_group
- End If
- particle_group_count = particle_group_count - 1
- End Sub
- Private Sub Particle_Group_Render(ByVal particle_group_index As Long, ByVal screen_x As Integer, ByVal screen_y As Integer)
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Modified by: Ryan Cain (Onezero)
- 'Modified by: Juan Martín Sotuyo Dodero
- 'Last Modify Date: 5/15/2003
- 'Renders a particle stream at a paticular screen point
- '*****************************************************************
- Dim loopc As Long
- Dim temp_rgb(0 To 3) As Long
- Dim no_move As Boolean
- If GetTickCount - particle_group_list(particle_group_index).live > particle_group_list(particle_group_index).liv1 And Not particle_group_list(particle_group_index).liv1 = -1 Then
- Particle_Group_Destroy particle_group_index
- Exit Sub
- End If
- With particle_group_list(particle_group_index)
- 'Set colors
- temp_rgb(0) = .rgb_list(0)
- temp_rgb(1) = .rgb_list(1)
- temp_rgb(2) = .rgb_list(2)
- temp_rgb(3) = .rgb_list(3)
- If GetTickCount - .live > .liv1 And Not .liv1 = -1 Then
- Particle_Group_Destroy particle_group_index
- Exit Sub
- End If
- 'See if it is time to move a particle
- .frame_counter = .frame_counter + timerTicksPerFrame
- If .frame_counter > .frame_speed Then
- .frame_counter = 0
- no_move = False
- Else
- no_move = True
- End If
- 'If it's still alive render all the particles inside
- For loopc = 1 To .particle_count
- 'Render particle
- Particle_Render .particle_stream(loopc), _
- screen_x, screen_y, _
- .grh_index_list(Round(General_Random_Number(1, .grh_index_count), 0)), _
- temp_rgb(), _
- .alpha_blend, no_move, _
- .x1, .y1, .angle, _
- .vecx1, .vecx2, _
- .vecy1, .vecy2, _
- .life1, .life2, _
- .fric, .spin_speedL, _
- .gravity, .grav_strength, _
- .bounce_strength, .x2, _
- .y2, .XMove, _
- .move_x1, .move_x2, _
- .move_y1, .move_y2, _
- .YMove, .spin_speedH, _
- .spin, .grh_resize, .grh_resizex, .grh_resizey
- Next loopc
- If no_move = False Then
- 'Update the group alive counter
- If .never_die = False Then
- .alive_counter = .alive_counter - 1
- End If
- End If
- End With
- End Sub
- Private Sub Particle_Render(ByRef temp_particle As Particle, ByVal screen_x As Integer, ByVal screen_y As Integer, _
- ByVal grh_index As Long, ByRef rgb_list() As Long, _
- Optional ByVal alpha_blend As Boolean, Optional ByVal no_move As Boolean, _
- Optional ByVal x1 As Integer, Optional ByVal y1 As Integer, Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, Optional grav_strength As Long, _
- Optional ByVal bounce_strength As Long, Optional ByVal x2 As Integer, Optional ByVal y2 As Integer, _
- Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, _
- Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, _
- Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, _
- Optional grh_resizex As Integer, Optional grh_resizey As Integer)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Modified by: Ryan Cain (Onezero)
- 'Modified by: Juan Martín Sotuyo Dodero
- 'Last Modify Date: 5/15/2003
- '**************************************************************
- If no_move = False Then
- If temp_particle.alive_counter = 0 Then
- 'Start new particle
- InitGrh temp_particle.Grh, grh_index, alpha_blend
- temp_particle.x = General_Random_Number(x1, x2) - 16
- temp_particle.y = General_Random_Number(y1, y2) - 16
- temp_particle.vector_x = General_Random_Number(vecx1, vecx2)
- temp_particle.vector_y = General_Random_Number(vecy1, vecy2)
- temp_particle.angle = angle
- temp_particle.alive_counter = General_Random_Number(life1, life2)
- temp_particle.friction = fric
- Else
- 'Continue old particle
- 'Do gravity
- If gravity = True Then
- temp_particle.vector_y = temp_particle.vector_y + grav_strength
- If temp_particle.y > 0 Then
- 'bounce
- temp_particle.vector_y = bounce_strength
- End If
- End If
- 'Do rotation
- If spin = True Then temp_particle.Grh.angle = temp_particle.Grh.angle + (General_Random_Number(spin_speedL, spin_speedH) / 100)
- If temp_particle.angle >= 360 Then
- temp_particle.angle = 0
- End If
- If XMove = True Then temp_particle.vector_x = General_Random_Number(move_x1, move_x2)
- If YMove = True Then temp_particle.vector_y = General_Random_Number(move_y1, move_y2)
- End If
- 'Add in vector
- temp_particle.x = temp_particle.x + (temp_particle.vector_x \ temp_particle.friction)
- temp_particle.y = temp_particle.y + (temp_particle.vector_y \ temp_particle.friction)
- 'decrement counter
- temp_particle.alive_counter = temp_particle.alive_counter - 1
- End If
- 'Draw it
- If grh_resize = True Then
- If temp_particle.Grh.grhindex Then
- Grh_Render_Advance temp_particle.Grh, temp_particle.x + screen_x, temp_particle.y + screen_y, grh_resizex, grh_resizey, rgb_list(), True, True, alpha_blend
- Exit Sub
- End If
- End If
- If temp_particle.Grh.grhindex Then
- Grh_Render temp_particle.Grh, temp_particle.x + screen_x, temp_particle.y + screen_y, rgb_list(), True, True, alpha_blend
- End If
- End Sub
- Private Sub Particle_Group_Make(ByVal particle_group_index As Long, ByVal map_x As Integer, ByVal map_y As Integer, _
- ByVal particle_count As Long, ByVal stream_type As Long, ByRef grh_index_list() As Long, ByRef rgb_list() As Long, _
- Optional ByVal alpha_blend As Boolean, Optional ByVal alive_counter As Long = -1, _
- Optional ByVal frame_speed As Single = 0.5, Optional ByVal id As Long, _
- Optional ByVal x1 As Integer, Optional ByVal y1 As Integer, Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, Optional grav_strength As Long, _
- Optional bounce_strength As Long, Optional ByVal x2 As Integer, Optional ByVal y2 As Integer, _
- Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, _
- Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, _
- Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, _
- Optional grh_resizex As Integer, Optional grh_resizey As Integer)
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Modified by: Ryan Cain (Onezero)
- 'Last Modify Date: 5/15/2003
- 'Makes a new particle effect
- 'Modified by Juan Martín Sotuyo Dodero
- '*****************************************************************
- 'Update array size
- If particle_group_index > particle_group_last Then
- particle_group_last = particle_group_index
- ReDim Preserve particle_group_list(1 To particle_group_last)
- End If
- particle_group_count = particle_group_count + 1
- 'Make active
- particle_group_list(particle_group_index).active = True
- 'Map pos
- If (map_x <> -1) And (map_y <> -1) Then
- particle_group_list(particle_group_index).map_x = map_x
- particle_group_list(particle_group_index).map_y = map_y
- End If
- 'Grh list
- ReDim particle_group_list(particle_group_index).grh_index_list(1 To UBound(grh_index_list))
- particle_group_list(particle_group_index).grh_index_list() = grh_index_list()
- particle_group_list(particle_group_index).grh_index_count = UBound(grh_index_list)
- 'Sets alive vars
- If alive_counter = -1 Then
- particle_group_list(particle_group_index).alive_counter = -1
- particle_group_list(particle_group_index).liv1 = -1
- particle_group_list(particle_group_index).never_die = True
- Else
- particle_group_list(particle_group_index).alive_counter = alive_counter
- particle_group_list(particle_group_index).liv1 = alive_counter
- particle_group_list(particle_group_index).never_die = False
- End If
- 'alpha blending
- particle_group_list(particle_group_index).alpha_blend = alpha_blend
- 'stream type
- particle_group_list(particle_group_index).stream_type = stream_type
- 'speed
- particle_group_list(particle_group_index).frame_speed = frame_speed
- particle_group_list(particle_group_index).x1 = x1
- particle_group_list(particle_group_index).y1 = y1
- particle_group_list(particle_group_index).x2 = x2
- particle_group_list(particle_group_index).y2 = y2
- particle_group_list(particle_group_index).angle = angle
- particle_group_list(particle_group_index).vecx1 = vecx1
- particle_group_list(particle_group_index).vecx2 = vecx2
- particle_group_list(particle_group_index).vecy1 = vecy1
- particle_group_list(particle_group_index).vecy2 = vecy2
- particle_group_list(particle_group_index).life1 = life1
- particle_group_list(particle_group_index).life2 = life2
- particle_group_list(particle_group_index).fric = fric
- particle_group_list(particle_group_index).spin = spin
- particle_group_list(particle_group_index).spin_speedL = spin_speedL
- particle_group_list(particle_group_index).spin_speedH = spin_speedH
- particle_group_list(particle_group_index).gravity = gravity
- particle_group_list(particle_group_index).grav_strength = grav_strength
- particle_group_list(particle_group_index).bounce_strength = bounce_strength
- particle_group_list(particle_group_index).XMove = XMove
- particle_group_list(particle_group_index).YMove = YMove
- particle_group_list(particle_group_index).move_x1 = move_x1
- particle_group_list(particle_group_index).move_x2 = move_x2
- particle_group_list(particle_group_index).move_y1 = move_y1
- particle_group_list(particle_group_index).move_y2 = move_y2
- particle_group_list(particle_group_index).rgb_list(0) = rgb_list(0)
- particle_group_list(particle_group_index).rgb_list(1) = rgb_list(1)
- particle_group_list(particle_group_index).rgb_list(2) = rgb_list(2)
- particle_group_list(particle_group_index).rgb_list(3) = rgb_list(3)
- particle_group_list(particle_group_index).grh_resize = grh_resize
- particle_group_list(particle_group_index).grh_resizex = grh_resizex
- particle_group_list(particle_group_index).grh_resizey = grh_resizey
- 'handle
- particle_group_list(particle_group_index).id = id
- particle_group_list(particle_group_index).live = GetTickCount()
- 'create particle stream
- particle_group_list(particle_group_index).particle_count = particle_count
- ReDim particle_group_list(particle_group_index).particle_stream(1 To particle_count)
- 'plot particle group on map
- If (map_x <> -1) And (map_y <> -1) Then
- MapData(map_x, map_y).particle_group_index = particle_group_index
- End If
- End Sub
- Public Function Map_Particle_Group_Get(ByVal map_x As Integer, ByVal map_y As Integer) As Long
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 2/20/2003
- 'Checks to see if a tile position has a particle_group_index and return it
- '*****************************************************************
- If InMapBounds(map_x, map_y) Then
- Map_Particle_Group_Get = MapData(map_x, map_y).particle_group_index
- Else
- Map_Particle_Group_Get = 0
- End If
- End Function
- Public Function General_Char_Particle_Create(ByVal ParticulaInd As Long, ByVal char_index As Integer, Optional ByVal particle_life As Long = 0) As Long
- Dim rgb_list(0 To 3) As Long
- rgb_list(0) = RGB(StreamData(ParticulaInd).colortint(0).r, StreamData(ParticulaInd).colortint(0).g, StreamData(ParticulaInd).colortint(0).b)
- rgb_list(1) = RGB(StreamData(ParticulaInd).colortint(1).r, StreamData(ParticulaInd).colortint(1).g, StreamData(ParticulaInd).colortint(1).b)
- rgb_list(2) = RGB(StreamData(ParticulaInd).colortint(2).r, StreamData(ParticulaInd).colortint(2).g, StreamData(ParticulaInd).colortint(2).b)
- rgb_list(3) = RGB(StreamData(ParticulaInd).colortint(3).r, StreamData(ParticulaInd).colortint(3).g, StreamData(ParticulaInd).colortint(3).b)
- General_Char_Particle_Create = Engine.Char_Particle_Group_Create(char_index, StreamData(ParticulaInd).grh_list, rgb_list(), StreamData(ParticulaInd).NumOfParticles, ParticulaInd, _
- StreamData(ParticulaInd).AlphaBlend, IIf(particle_life = 0, StreamData(ParticulaInd).life_counter, particle_life), StreamData(ParticulaInd).speed, , StreamData(ParticulaInd).x1, StreamData(ParticulaInd).y1, StreamData(ParticulaInd).angle, _
- StreamData(ParticulaInd).vecx1, StreamData(ParticulaInd).vecx2, StreamData(ParticulaInd).vecy1, StreamData(ParticulaInd).vecy2, _
- StreamData(ParticulaInd).life1, StreamData(ParticulaInd).life2, StreamData(ParticulaInd).friction, StreamData(ParticulaInd).spin_speedL, _
- StreamData(ParticulaInd).gravity, StreamData(ParticulaInd).grav_strength, StreamData(ParticulaInd).bounce_strength, StreamData(ParticulaInd).x2, _
- StreamData(ParticulaInd).y2, StreamData(ParticulaInd).XMove, StreamData(ParticulaInd).move_x1, StreamData(ParticulaInd).move_x2, StreamData(ParticulaInd).move_y1, _
- StreamData(ParticulaInd).move_y2, StreamData(ParticulaInd).YMove, StreamData(ParticulaInd).spin_speedH, StreamData(ParticulaInd).spin, _
- StreamData(ParticulaInd).grh_resize, StreamData(ParticulaInd).grh_resizex, StreamData(ParticulaInd).grh_resizey)
- End Function
- Public Function General_Particle_Create(ByVal ParticulaInd As Long, ByVal x As Integer, ByVal y As Integer, Optional ByVal particle_life As Long = 0) As Long
- Dim rgb_list(0 To 3) As Long
- rgb_list(0) = RGB(StreamData(ParticulaInd).colortint(0).r, StreamData(ParticulaInd).colortint(0).g, StreamData(ParticulaInd).colortint(0).b)
- rgb_list(1) = RGB(StreamData(ParticulaInd).colortint(1).r, StreamData(ParticulaInd).colortint(1).g, StreamData(ParticulaInd).colortint(1).b)
- rgb_list(2) = RGB(StreamData(ParticulaInd).colortint(2).r, StreamData(ParticulaInd).colortint(2).g, StreamData(ParticulaInd).colortint(2).b)
- rgb_list(3) = RGB(StreamData(ParticulaInd).colortint(3).r, StreamData(ParticulaInd).colortint(3).g, StreamData(ParticulaInd).colortint(3).b)
- General_Particle_Create = Engine.Particle_Group_Create(x, y, StreamData(ParticulaInd).grh_list, rgb_list(), StreamData(ParticulaInd).NumOfParticles, ParticulaInd, _
- StreamData(ParticulaInd).AlphaBlend, IIf(particle_life = 0, StreamData(ParticulaInd).life_counter, particle_life), StreamData(ParticulaInd).speed, , StreamData(ParticulaInd).x1, StreamData(ParticulaInd).y1, StreamData(ParticulaInd).angle, _
- StreamData(ParticulaInd).vecx1, StreamData(ParticulaInd).vecx2, StreamData(ParticulaInd).vecy1, StreamData(ParticulaInd).vecy2, _
- StreamData(ParticulaInd).life1, StreamData(ParticulaInd).life2, StreamData(ParticulaInd).friction, StreamData(ParticulaInd).spin_speedL, _
- StreamData(ParticulaInd).gravity, StreamData(ParticulaInd).grav_strength, StreamData(ParticulaInd).bounce_strength, StreamData(ParticulaInd).x2, _
- StreamData(ParticulaInd).y2, StreamData(ParticulaInd).XMove, StreamData(ParticulaInd).move_x1, StreamData(ParticulaInd).move_x2, StreamData(ParticulaInd).move_y1, _
- StreamData(ParticulaInd).move_y2, StreamData(ParticulaInd).YMove, StreamData(ParticulaInd).spin_speedH, StreamData(ParticulaInd).spin, _
- StreamData(ParticulaInd).grh_resize, StreamData(ParticulaInd).grh_resizex, StreamData(ParticulaInd).grh_resizey)
- End Function
- Public Function Char_Particle_Group_Create(ByVal char_index As Integer, ByRef grh_index_list() As Long, ByRef rgb_list() As Long, _
- Optional ByVal particle_count As Long = 20, Optional ByVal stream_type As Long = 1, _
- Optional ByVal alpha_blend As Boolean, Optional ByVal alive_counter As Long = -1, _
- Optional ByVal frame_speed As Single = 0.5, Optional ByVal id As Long, _
- Optional ByVal x1 As Integer, Optional ByVal y1 As Integer, Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, Optional grav_strength As Long, _
- Optional bounce_strength As Long, Optional ByVal x2 As Integer, Optional ByVal y2 As Integer, _
- Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, _
- Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, _
- Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, _
- Optional grh_resizex As Integer, Optional grh_resizey As Integer)
- '**************************************************************
- 'Author: Augusto José Rando
- '**************************************************************
- Dim char_part_free_index As Integer
- 'If Char_Particle_Group_Find(char_index, stream_type) Then Exit Function ' hay que ver si dejar o sacar esto...
- If Not Char_Check(char_index) Then Exit Function
- char_part_free_index = Char_Particle_Group_Next_Open(char_index)
- If char_part_free_index > 0 Then
- Char_Particle_Group_Create = Particle_Group_Next_Open
- Char_Particle_Group_Make Char_Particle_Group_Create, char_index, char_part_free_index, particle_count, stream_type, grh_index_list(), rgb_list(), alpha_blend, alive_counter, frame_speed, id, x1, y1, angle, vecx1, vecx2, vecy1, vecy2, life1, life2, fric, spin_speedL, gravity, grav_strength, bounce_strength, x2, y2, XMove, move_x1, move_x2, move_y1, move_y2, YMove, spin_speedH, spin, grh_resize, grh_resizex, grh_resizey
- End If
- End Function
- Public Function Char_Particle_Group_Remove(ByVal char_index As Integer, ByVal stream_type As Long)
- '**************************************************************
- 'Author: Augusto José Rando
- '**************************************************************
- Dim char_part_index As Integer
- If Char_Check(char_index) Then
- char_part_index = Char_Particle_Group_Find(char_index, stream_type)
- If char_part_index = -1 Then Exit Function
- Call Particle_Group_Remove(char_part_index)
- End If
- End Function
- Public Function Char_Particle_Group_Remove_All(ByVal char_index As Integer)
- '**************************************************************
- 'Author: Augusto José Rando
- '**************************************************************
- Dim i As Integer
- If Char_Check(char_index) And Not charlist(char_index).particle_count = 0 Then
- For i = 1 To UBound(charlist(char_index).particle_group)
- If charlist(char_index).particle_group(i) <> 0 Then Call Particle_Group_Remove(charlist(char_index).particle_group(i))
- Next i
- Erase charlist(char_index).particle_group
- charlist(char_index).particle_count = 0
- End If
- End Function
- Private Function Char_Particle_Group_Find(ByVal char_index As Integer, ByVal stream_type As Long) As Integer
- '*****************************************************************
- 'Author: Augusto José Rando
- 'Modified: returns slot or -1
- '*****************************************************************
- Dim i As Integer
- For i = 1 To charlist(char_index).particle_count
- If particle_group_list(charlist(char_index).particle_group(i)).stream_type = stream_type Then
- Char_Particle_Group_Find = charlist(char_index).particle_group(i)
- Exit Function
- End If
- Next i
- Char_Particle_Group_Find = -1
- End Function
- Private Function Char_Particle_Group_Next_Open(ByVal char_index As Integer) As Integer
- '*****************************************************************
- 'Author: Augusto José Rando
- '*****************************************************************
- On Error GoTo ErrorHandler:
- Dim loopc As Long
- If charlist(char_index).particle_count = 0 Then
- Char_Particle_Group_Next_Open = charlist(char_index).particle_count + 1
- charlist(char_index).particle_count = Char_Particle_Group_Next_Open
- ReDim Preserve charlist(char_index).particle_group(1 To Char_Particle_Group_Next_Open) As Long
- Exit Function
- End If
- loopc = 1
- Do Until charlist(char_index).particle_group(loopc) = 0
- If loopc = charlist(char_index).particle_count Then
- Char_Particle_Group_Next_Open = charlist(char_index).particle_count + 1
- charlist(char_index).particle_count = Char_Particle_Group_Next_Open
- ReDim Preserve charlist(char_index).particle_group(1 To Char_Particle_Group_Next_Open) As Long
- Exit Function
- End If
- loopc = loopc + 1
- Loop
- Char_Particle_Group_Next_Open = loopc
- Exit Function
- ErrorHandler:
- charlist(char_index).particle_count = 1
- ReDim charlist(char_index).particle_group(1 To 1) As Long
- Char_Particle_Group_Next_Open = 1
- End Function






553![Destructor de Mentes [4] Destructor de Mentes [4]](./images/ranks/Rango16.gif)

![Dragon Ancestral [5] Dragon Ancestral [5]](./images/ranks/Rango34.gif)


![Dragon Ancestral [6] Dragon Ancestral [6]](./images/ranks/Rango35.gif)
