Gravity Drops
Moderators: heatherlaine, kevinmiller, robinmiller, malte
Gravity Drops
Hi, I have a few questions; please keep in mind these are directed toward App development. Documentation is good, examples are best
1. If I want to make an ball drop from the top of the (iPod) screen can I do it with Animation Engine or can I do just a good of job in LiveCode 4.5? Is it relatively easy?
(Optional) 2. I want to catch the ball and make it count for points. Would you have/type code to show if it's not to much trouble?
If you are able to answer any of the following questions thank you very much!
1. If I want to make an ball drop from the top of the (iPod) screen can I do it with Animation Engine or can I do just a good of job in LiveCode 4.5? Is it relatively easy?
(Optional) 2. I want to catch the ball and make it count for points. Would you have/type code to show if it's not to much trouble?
If you are able to answer any of the following questions thank you very much!
Last edited by Danny on Fri Dec 03, 2010 3:43 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 18
- Joined: Wed Oct 13, 2010 4:44 am
Re: Gravity Drops
Hiya Danny,
I can definitely vouch for AnimationEngine to do exactly that. Malte can advise on the level of customisation available on the bounce action, but I've been 'bouncing' things around my screen all week using one simple command (after injesting AE into my mainstack):
(where 'startLoc' is the position i wanted my object to bounce back to after being moved, and '1000' is the milliseconds that the move should take to complete)
...works a treat. There are many other enhanced 'move' actions as well (ease in/out etc...)
Also, i've found the constrain functions pretty time saving as well, for setting the area that objects are allowed to move around in on drag and release actions...
hope that helps.
Cheers,
A.
I can definitely vouch for AnimationEngine to do exactly that. Malte can advise on the level of customisation available on the bounce action, but I've been 'bouncing' things around my screen all week using one simple command (after injesting AE into my mainstack):
Code: Select all
aeMoveTo the name of button objectNo,startLoc,1000,"bounce"
...works a treat. There are many other enhanced 'move' actions as well (ease in/out etc...)
Also, i've found the constrain functions pretty time saving as well, for setting the area that objects are allowed to move around in on drag and release actions...
Code: Select all
set the constrainRectangular of btn "Selection1" to rect of grc "Box"
Cheers,
A.
-
- VIP Livecode Opensource Backer
- Posts: 18
- Joined: Wed Oct 13, 2010 4:44 am
Re: Gravity Drops
Oh... and on your second question, i've also been doing something similar based on the intersect of two objects at any time.
I'm not sure that what I'm doing will help you thought as it seems like you want to catch the balls when they are freely moving, as opposed to what I've been doing which is dragging objects and simply testing for intersect of the mouseLoc:
etc..
Malte, does AE allow us to test an object for intersect with another during an aeMove command somehow?
I'm not sure that what I'm doing will help you thought as it seems like you want to catch the balls when they are freely moving, as opposed to what I've been doing which is dragging objects and simply testing for intersect of the mouseLoc:
Code: Select all
if the mouseLoc is within the rect of btn circleNo then
Malte, does AE allow us to test an object for intersect with another during an aeMove command somehow?
Re: Gravity Drops
Thanks for the advice and help! Well the main object is to drop a ball straight down and catch it in a bucket and have it count for points. I just want it to drop, not bounce so I guess i'm looking for the intersection points as well. Is there a way to try a basic version in LiveCode because i'm not yet sure I can pay $80.
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Gravity Drops
Hi Danny...
To see balls dropping have a look at :-
http://www.gemetest.ihouse.on-rev.com/
You can download the stack from the web page and look at the scripts..
be well
Dixie
To see balls dropping have a look at :-
http://www.gemetest.ihouse.on-rev.com/
You can download the stack from the web page and look at the scripts..
be well
Dixie
Re: Gravity Drops
> does AE allow us to test an object for intersect with another during an aeMove command somehow?
While an object is moved there are callback messages sent, so yesyou can
The messages you want to handle are aeEnterFrame (before the location is updated) and/or aeExitFrame (after the update)
Hope that helps,
Malte
While an object is moved there are callback messages sent, so yesyou can
The messages you want to handle are aeEnterFrame (before the location is updated) and/or aeExitFrame (after the update)
Hope that helps,
Malte
Re: Gravity Drops
Danny,
dixies stack is a good example. You will want to look at move and intersect in the dictionary if you want to try with plain livecode first.
dixies stack is a good example. You will want to look at move and intersect in the dictionary if you want to try with plain livecode first.
Re: Gravity Drops
Thanks to everyone! I'll try these answers and post again soon.
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Gravity Drops
Danny...
look at the attached stack... your balls in a bucket ..
Dixie
look at the attached stack... your balls in a bucket ..
Dixie
- Attachments
-
- BallsDropping.rev.zip
- (96.13 KiB) Downloaded 431 times
Re: Gravity Drops
Dixie - haha thanks I will definitely have to consider Animation Engine
But one of the things i've been trying to get to work is having the bucket follow a set line I looked in the dictionary and found move. It says
"Tip: To easily move an object along a curved path, create a curvegraphic using the freehand Curve tool, then use a statement like the following to move the object:
move button "My Button" to the points of graphic "My Curve"
So i filled "My Button" in and "My Curve" to their respective names but it didn't lock on to the line. Help?
But one of the things i've been trying to get to work is having the bucket follow a set line I looked in the dictionary and found move. It says
"Tip: To easily move an object along a curved path, create a curvegraphic using the freehand Curve tool, then use a statement like the following to move the object:
move button "My Button" to the points of graphic "My Curve"
So i filled "My Button" in and "My Curve" to their respective names but it didn't lock on to the line. Help?
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Gravity Drops
Danny....
Another example... I've modified the previous stack, it is the same as the one before except that now the ball follows the path of the graphic 'drunk'. The graphic drunk is set to invisible, so if you wish to see its path then 'View --> Show Invisible Objects' in the revolution IDE...
Look at the script to see how the ball graphic follows the path of the 'drunk' graphic...
You are able to accomplish a lot with the LiveCode commands, but if your really want some power and to move things around in a really nifty manner then look at Malte Brill's Animation Engine...
Another example... I've modified the previous stack, it is the same as the one before except that now the ball follows the path of the graphic 'drunk'. The graphic drunk is set to invisible, so if you wish to see its path then 'View --> Show Invisible Objects' in the revolution IDE...
Look at the script to see how the ball graphic follows the path of the 'drunk' graphic...
You are able to accomplish a lot with the LiveCode commands, but if your really want some power and to move things around in a really nifty manner then look at Malte Brill's Animation Engine...
- Attachments
-
- DrunkBallsDropping.rev.zip
- (96.32 KiB) Downloaded 438 times
Re: Gravity Drops
Hi guys,
There are americans who read here, too!
Best
Klaus
no dirty talking, please!Dixie wrote:Danny...
look at the attached stack... your balls in a bucket ..
Dixie
There are americans who read here, too!
Best
Klaus