|
-
Hi!
trying to write simple bouncing ball script here...
can't get it work..
1st frame
Set Variable: "minloch" = 0
Set Variable: "maxloch" = 300
Set Variable: "minlocv" = 0
Set Variable: "maxlocv" = 70
Set Variable: "mypointh" = random(5)+1
Set Variable: "mypointv" = random(5)+1
2nd frame
Set Property ("/mytarget", X Position) = "GetProperty (/mytarget, _x )+mypointh"
// same for vloc
Go to Next Frame
Play
4th frame
If (GetProperty (mytarget, _x ) >= maxloch or GetProperty ( mytarget, _x ) <= minloch)
Set Variable: "mypointh" = -mypointh
Set Variable: "mypointv" = -mypointv
End If
Go to and Play (2)
what i am doing wrong..??
Thank you
Ilia
-
Well the first thing I see is that you have quotations around the value of your Set Property X Position...it should be an expression.
If you could give me some enlightenment as to what some of those variables do I might be able to help you out more.
-
As ahab pointed out, your set property should be equated to a expression. Also you could do away with the 4th frame that checks for direction changes by putting it in a looping movie clip which constantly checks for the maxloch and minloch. I've used it in my simple pendulum experient on my page. Also why are you using randon increments?
-
Originally posted by Nav
As ahab pointed out, your set property should be equated to a expression. Also you could do away with the 4th frame that checks for direction changes by putting it in a looping movie clip which constantly checks for the maxloch and minloch. I've used it in my simple pendulum experient on my page. Also why are you using randon increments?
Hey! Thanks guys., i just wrote it down very fast , just to show what logic is. I mean it should be very simple, just like a bouncing ball- if ball hits the ege of the stage it bounce!
Why use random increment you ask..??-- to make it move random.. i guess.
As to your question Ahab.
maxloch--maximum it can go horisontal
maxlocv--maximum it can go vertical
minloch--minimum..................
minlocv--................
mypointh-- by how many points H location will be changed
mypointv-- by how many points V location will be changed
Thank You again
Ilia
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|