Create Trail for Moving Object

02-18-2005, 05:11 PM
hey everybody. Im looking for help on a prject of mine. I have made a graphics display program that has a skull bouncing around. What I would like to do is to creae a trail of flames behind him, but could somebody help me on how to do this. It is very puzzling to me. Any help would be much appreciated!

02-22-2005, 02:47 AM
It really depends on how you are moving the skull. If you are using a loop or timer, then you could just save the last couple places the skull has been, and put flames there, maybe with a little bit of randomness (moved around a random pixel or two).

If you posted some code, and/or asked specific help I'm sure we'd be more helpful.

02-24-2005, 09:26 AM
Here, this is what I have so far:

Option Explicit
Dim y As Integer
Dim x As Integer
Dim yDirection As Boolean
Dim xDirection As Boolean

Private Sub Form_Load()
End Sub

Private Sub Form_Resize()
Picture1.Left = 0
Picture1.Top = 0
Picture1.Width = ScaleWidth
Picture1.Height = ScaleHeight
xDirection = True And False
yDirection = True And False
x = Rnd * Picture1.Width - ImageList1.ImageWidth
y = Rnd * Picture1.Height - ImageList1.ImageHeight

End Sub

Private Sub Picture1_Click()
Unload Me
End Sub

Private Sub Picture1_KeyPress(KeyAscii As Integer)
Unload Me

End Sub

Private Sub Timer1_Timer()


If xDirection = True Then
x = x + 1
x = x - 1
End If

If x >= Picture1.ScaleWidth - ImageList1.ImageWidth Then
xDirection = False
End If

If x <= Picture1.Left Then
xDirection = True
End If

If yDirection = True Then
y = y + 1
y = y - 1
End If

If y >= Picture1.ScaleHeight - ImageList1.ImageHeight Then
yDirection = False
End If

If y <= Picture1.Top Then
yDirection = True
End If

If x < 0 Then
x = 0
End If
If y < 0 Then
y = 0
End If
ImageList1.ListImages(1).Draw Picture1.hDC, x, y, 1

End Sub

And I believe it is set up on a timer and a loop.

02-25-2005, 05:11 PM

02-27-2005, 07:14 AM
You pasted some code and placed a "bump".
What do you expect from people reading this thread so far??

02-27-2005, 05:15 PM
wow, never mind then. ill just take it somewhere else. cya.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum