On 24/11/05 12:01 pm, "PHILIP LUCAS" <[EMAIL PROTECTED]> wrote:
>> a black ball (object1) ... once set in motion will travel towards a curve
>> (object2) at a constant angle to the curve of say 50 degrees.
>> 
>> Once it reaches and passes that curve it looks for the next curve to pass it
>> also at 50 degrees and so on to another curve.
>> 
>> At any given stage a player has the option to switch say 100 degrees and
>> head this time accross the screen to the left.
>> 
>> Is there anyone who can assist with the coding of this or advise which way
>> to best approach this task ? I can send you a bmp to explain the above.

Philip's Word document is now available at:

  <http://www.openspark.com/~share/plucas/spriteassis.doc>


Philip, what exactly are you asking for?  Do you need help with:

* the mathematics of determining which straight-line path will
  form a given angle with a given curve from a given point?

* drawing an arbitrary curve on the screen?

* detecting user input?

* creating a multiuser network?

* moving a sprite along a given path using Lingo?

* working out where to start?

* ...?

The secret to solving a complex problem like this is to break it down into a
series of smaller problems that you already know how to solve.  You then
look for (or ask for) ways to fill the gaps in your knowledge.

If you are new to Lingo, then perhaps you should start by simply using code
to move a sprite.  Here's a very simple behavior:

-- MOVE SPRITE --

property pSprite
property pMoveX
property pMoveY

 
on beginSprite(me)
  -- Create a property to refer to the sprite the behavior is attached to
  pSprite = sprite(me.spriteNum)

  -- Create two property to indicate how much the sprite is to move along
  -- the x- and the y-axes
  pMoveX = 7
  pMoveY = 3
end beginSprite


on enterFrame(me)
  -- Move the sprite to a new position (loc) before the next update
  pSprite.loc = pSprite.loc + [pMoveX, pMoveY]
end enterFrame

-- ----- ----- --
  

1. In your movie, create a black ball sprite in channel 1
2. Copy the code above
3. Right-click or Ctrl-click on the black ball sprite and
   choose Script in the contextual menu which appears
4. The script window will open.  Select all the text in
   it and paste in the code above in its place
5. Launch your movie.

Result: The sprite should move down and to the left.

Next step: work out how to tell the sprite to move in a different direction.
Hint: you can change the value of sprite(1).pMoveX from the Message window

  sprite(1).pMoveX = -11

Does this get you started?

Cheers,

James

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
lingo-l@penworks.com  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to