Skip to main content
Participant
May 5, 2006
Answered

Please help me with maths problem

Hi,

Im making a flash game at the mo & am having maths difficulty.

When i press the space button I attach a movie clip of a bullet on stage

The bullet starts moving in the direction of the the last mouse position.

I'm trying to figure out a way to remove the clip after it has moved a distance of 100 pixels

The problem is that the bullet can move in positive and negatived directions. I dont know how to test for this.
Can any body help?
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
May 5, 2006
in your loop that moves your bullet you can repeatedly check the distance the bullet moves and remove it by using distanceF(yourBullet):

3 replies

kglad
Community Expert
Community Expert
May 5, 2006
you're welcome.
Translate
d00mc0ckAuthor
Participant
May 5, 2006
You dont know how much of a headheache you've saved me.

Thankyou very much
:-)
Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 5, 2006
in your loop that moves your bullet you can repeatedly check the distance the bullet moves and remove it by using distanceF(yourBullet):

Translate