Re: lingo-l moving a sprite from off to on stage

2002-08-16 Thread Howdy-Tzi

On Thursday, August 15, 2002, at 07:20 PM, John Hart wrote:

 I need to move a sprite from off stage to a specific location on stage, 
 pH, using Lingo.  I've tried several ideas,but can't get it.  Need some 
 ideas, please.

First idea: Don't use repeat loops.
Second idea: Set a flag.
Third idea: Query that flag on exitFrame and move the sprite.

Something like this:

   PROPERTY pyMyMotion, pnMyTargetH

   on beginSprite me
 pyMyMotion = #none
   END beginSprite

   on exitFrame me
 if pyMyMotion  #none then
   me.MoveIt()
 end if
   END exitFrame

   on Motion me, yDirection, pH
 pyMyMotion = yDirection
 pnMyTargetH = pH
   END Motion

   on MoveIt me
 if pyMyMotion = #left then
   if sprite(me.spriteNum).locH  pnMyTargetH then
 sprite(me.spriteNum).locH = sprite(me.spriteNum).locH + 1
   else
 pyMyMotion = #none
   end if
 else
   if sprite(me.spriteNum).locH  pnMyTargetH then
 sprite(me.spriteNum).locH = sprite(me.spriteNum).locH - 1
   else
 pyMyMotion = #none
   end if
 end if
   END MoveIt

You'd call it like this:

   sendSprite ( whatever, #motion, #left, 500 )

or

   sendSprite ( whatever, #motion, #right, 10 )

Should do it. It'll theoretically update as fast as your framerate.


  Warren Ockrassa | http://www.nightwares.com/
  Director help | Free files | Sample chapters | Freelance | Consulting
Author | Director 8.5 Shockwave Studio: A Beginner's Guide
Published by Osborne/McGraw-Hill
http://shop.osborne.com/cgi-bin/osborne/0072195622.html

[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 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



RE: lingo-l moving a sprite from off to on stage

2002-08-16 Thread Buzz Kettles

just being quick (10 ticks)  dirty  :)

At 10:41 AM -0700 8/16/02, you wrote:
   First idea: Don't use repeat loops.

Yeah, repeat loops can be over used. Too, Apple advises against them 
when running under OSX. The OS will pop up that cute beachball 
cursor during loops.

Kraig

[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 [EMAIL PROTECTED]  (Problems, email 
[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
programming Lingo.  Thanks!]

[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 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



lingo-l moving a sprite from off to on stage

2002-08-15 Thread John Hart

Hi All:

SYS INFO: D85, WIN98SE, 128Mbs RAM
  I need to move a sprite from off stage to a specific location on stage, pH, using 
Lingo.  I've tried several ideas,but can't get it.  Need some ideas, please.  Here's 
part of a behavior I'm calling with sendSprite, but the sprite appears to quick!

--from another script I use this: sendsprite(21,#motion, left, pH)
--and here's part of that #motion behavior:

case(whichDirection) of
left:
  repeat while sprite(21).locH  pH
  sprite(21).locH = sprite(21).locH + 1
  updateStage
  end repeat
end case

What I get is sprite 21 appearing instantly in position pH, as opposed to sliding on 
stage, or flying-in smoothly.  Can't use Score/sprite spans. Would rather use Lingo 
anywho.  Tried a couple of ideas to slow down the repeat loop, but timeout() doesn't 
do it, the timer doesn't do it.  Shirley, there is a way to make this happen in Lingo.

Thanks much for your ideas and comments,
John H...stranded on Lingo Island.

-- 
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

[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 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]



Re: lingo-l moving a sprite from off to on stage

2002-08-15 Thread Buzz Kettles

here's some stall code

   startTimer
   repeat while the timer  10
 nothing
   end repeat

hth

-Buzz

At 7:20 PM -0500 8/15/02, you wrote:
Hi All:

SYS INFO: D85, WIN98SE, 128Mbs RAM
   I need to move a sprite from off stage to a specific location on 
stage, pH, using Lingo.  I've tried several ideas,but can't get it. 
Need some ideas, please.  Here's part of a behavior I'm calling with 
sendSprite, but the sprite appears to quick!

--from another script I use this: sendsprite(21,#motion, left, pH)
--and here's part of that #motion behavior:

case(whichDirection) of
 left:
   repeat while sprite(21).locH  pH
   sprite(21).locH = sprite(21).locH + 1
   updateStage
   end repeat
end case

What I get is sprite 21 appearing instantly in position pH, as 
opposed to sliding on stage, or flying-in smoothly.  Can't use 
Score/sprite spans. Would rather use Lingo anywho.  Tried a couple 
of ideas to slow down the repeat loop, but timeout() doesn't do it, 
the timer doesn't do it.  Shirley, there is a way to make this 
happen in Lingo.

Thanks much for your ideas and comments,
John H...stranded on Lingo Island.

--
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

[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 [EMAIL PROTECTED]  (Problems, email 
[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
programming Lingo.  Thanks!]

[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 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]