Gravity Drops

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Gravity Drops

Post by Danny » Fri Dec 03, 2010 2:02 am

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!
Last edited by Danny on Fri Dec 03, 2010 3:43 am, edited 1 time in total.

Howlernator
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Wed Oct 13, 2010 4:44 am

Re: Gravity Drops

Post by Howlernator » Fri Dec 03, 2010 3:02 am

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):

Code: Select all

aeMoveTo the name of button objectNo,startLoc,1000,"bounce"
(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...

Code: Select all

set the constrainRectangular of btn "Selection1" to rect of grc "Box"
hope that helps.

Cheers,

A.

Howlernator
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Wed Oct 13, 2010 4:44 am

Re: Gravity Drops

Post by Howlernator » Fri Dec 03, 2010 3:13 am

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:

Code: Select all

if the mouseLoc is within the rect of btn circleNo then
etc..

Malte, does AE allow us to test an object for intersect with another during an aeMove command somehow?

Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Re: Gravity Drops

Post by Danny » Fri Dec 03, 2010 3:53 am

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.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Gravity Drops

Post by Dixie » Fri Dec 03, 2010 8:24 am

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

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Gravity Drops

Post by malte » Fri Dec 03, 2010 8:59 pm

> 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

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Gravity Drops

Post by malte » Fri Dec 03, 2010 9:01 pm

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. :-)

Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Re: Gravity Drops

Post by Danny » Sat Dec 04, 2010 4:30 am

Thanks to everyone! I'll try these answers and post again soon.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Gravity Drops

Post by Dixie » Sat Dec 04, 2010 9:59 pm

Danny...

look at the attached stack... your balls in a bucket ..:-)

Dixie
Attachments
BallsDropping.rev.zip
(96.13 KiB) Downloaded 431 times

Danny
Posts: 106
Joined: Tue Nov 09, 2010 1:28 am

Re: Gravity Drops

Post by Danny » Sat Dec 04, 2010 11:32 pm

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?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Gravity Drops

Post by Dixie » Sun Dec 05, 2010 12:55 am

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...
Attachments
DrunkBallsDropping.rev.zip
(96.32 KiB) Downloaded 438 times

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Gravity Drops

Post by Klaus » Sun Dec 05, 2010 7:59 pm

Hi guys,
Dixie wrote:Danny...
look at the attached stack... your balls in a bucket ..:-)
Dixie
no dirty talking, please!
There are americans who read here, too!
:lol: :lol: :lol:


Best

Klaus

Post Reply

Return to “Animation Engine”