hello ramesh
thanks a lot for the script it sounds that you got a
sound knowledge in creating behaiours can i know how u
learned director programming and is it possible for
you to help me out in learning lingo i just know the
fundamentals of director and i want to learn it
indepth  but the problem is i dont have any knowledge
of programming and what all the books im having and
these lists i know are helpful but not exactly help
ful to me as i feel them to be complicated just try to
help if possible for  you
i will be verymuch thankful to you
sreedhar

--- Ramesh C T <[EMAIL PROTECTED]> wrote:
> Hi Sreedhar,
> 
> Here is a simple behavior to move a sprites randomly
> inside the stage. No
> elasticity, may be someone here can help you on that
> or else you  go through
> the articles at www.director-online.com if need to
> implement physics related
> stuff in Lingo.
> 
> Copy this into a script window and make sure script
> property is set to
> Behavior.
> 
> ------------------- drag this script to sprite on
> the
> stage------------------------------
> property pSprite
> property pSpeed
> property pDirectionH
> property pDirectionV
> property pLeft
> property pTop
> property pRight
> property pBottom
> 
> on beginSprite me
>   pSprite = me.spriteNum
> end
> 
> 
> on exitFrame me
>   if sprite(pSprite).locH <= pLeft OR
> sprite(pSprite).locH >= pRight then
>     pDirectionH = pDirectionH * -1
>   end if
> 
>   if sprite(pSprite).locV <= pTop OR
> sprite(pSprite).locV >= pBottom then
>     pDirectionV = pDirectionV * -1
>   end if
> 
>   sprite(pSprite).locH = sprite(pSprite).locH +
> random(pSpeed) * pDirectionH
>   sprite(pSprite).locV = sprite(pSprite).locV +
> random(pSpeed) * pDirectionV
> end
> 
> on getPropertyDescriptionList me
>   pdList = [:]
> 
>   pdList.addProp(#pSpeed,[#comment:"Speed of
> movement inpixels", #default:3,
> #format:#integer])
>   pdList.addProp(#pDirectionH,[#comment:"Horizontal
> direction (1 / -1)",
> #default:1, #format:#integer])
>   pdList.addProp(#pDirectionV,[#comment:"Vericalal
> direction (1 / -1)",
> #default:-1, #format:#integer])
>   pdList.addProp(#pLeft,[#comment:"Left edge in
> pixels", #default:0,
> #format:#integer])
>   pdList.addProp(#pTop,[#comment:"Top edge in
> pixels", #default:0,
> #format:#integer])
>   pdList.addProp(#pRight,[#comment:"Right edge in
> pixels", #default:640,
> #format:#integer])
>   pdList.addProp(#pBottom,[#comment:"Bottom edge in
> pixels", #default:480,
> #format:#integer])
> 
>   return pdList
> end
> --------------------------Script
> ends------------------------
> regards
> Ramesh C T
> 
> -----Original Message-----
> From: sreedhar reddy <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Friday, October 06, 2000 2:09 PM
> Subject: <lingo-l> creating behaviours
> 
> 
> >hello all
> >i just want to make a behaviour which makes the
> sprite
> >move randomly on the stage and also the restricts
> the
> >movement of the sprite to the stage only and at the
> >same time when the sprite touchec the edges of teh
> >stage it should bounce back normally with an option
> >for the use to control the elasticity as well as
> the
> >speed of the bounce
> >please help me out
> >sreedhar
> 
> 
> 
>
_________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at
> http://mail.yahoo.com
> 
> 
> [To remove yourself from this list, or to change to
> digest mode, go to
> http://www.penworks.com/LUJ/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!]
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]

Reply via email to