Page 1 of 2

Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 12:16 am
by mist
Hi,

What is the best practice to achieve the effect of sprites and other objects falling or dropping into the layout?

Would it be to give the object a bullet behaviour and set it's gravity level to a high value?

Or is there another prefered method?

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 12:43 am
by blackhornet
Close; bullet, and set the sprite angel to 90, speed to ___.

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 12:59 am
by RandomFellow
Depending on what effect you're going for, physics behaviors work equally well. Plus, you don't have to worry about what direction it's moving to make it look like it's falling.

The only problems you might run into is their collisions with other physics objects/solids and the unpredictability once they hit things.

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 1:24 am
by mist
[QUOTE=blackhornet] Close; bullet, and set the sprite angel to 90, speed to ___.[/QUOTE [QUOTE=blackhornet] Close; bullet, and set the sprite angel to 90, speed to ___.[/QUOTE]

"Close" Where is this option and what is it's function?

Currently the sprite passes through objects on the same layer even though i have them set as "Soild" unless i set my falling sprite to "Bounce off solid objects" but then it bounces non stop.

Can i have it bounce a few times and then come to a complete stop?

Is this what the "Close" will do?]

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 1:31 am
by blackhornet
It sounds like you do want physics after all, not Bullet.

(You misunderstood what 'close' meant - ignore it).

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 1:47 am
by mist
So it's not possible to have an item fall and then just stop or bounce off a solid it encounters and stop by using the "Bullet" behaviour?

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 7:51 am
by RamPackWobble
In the past I did something like:(Put into a group so it can be turned off when no longer needed)

spritefalling is the falling boxes - set to bullet speed 0, gravity high (500 ?), bounce off solid ON, set direction ON

spriteground is the ground - set to solid

spritefallin on collision with ground : set spritefalling.bulletspeed to spritefalling.bulletspeed*0.5


and that gave an okish result...


Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 8:17 am
by mist
Not sure i understand what you mean, it bounces forever never coming to a stop.

I just want the sprite to move down the screen, bounce and then stop.

Or fail that just move down and stop.

There must be something i'm missing..

Edit: Ok i managed to make the sprite fall down by adding the "platform" behaviour and i can make it stop by hitting another sprite, now, is there a way i can make it bounce up a few times before settiling down?mist2014-02-15 09:10:04

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 9:08 am
by RamPackWobble
This is along the lines I did before - but this time I've added extra falling things.

capx

try disabling event 5 to 8 - so only one is enabled at a time for different effects.

event 5 would also need families adding to allow for collision with other boxes ?

Anyway - just an idea if you still want to go with bullet.

In the original (lost) capx it was just a single "logo" sprite so there was no need for families and I didn't think about self collision till I tried this test....

RamPackWobble2014-02-15 09:10:28

Re: Easiest method to have sprites "fall in"?

PostPosted: Sat Feb 15, 2014 9:12 am
by mist
Cool, i am using the "platform" behaviour now and it's working, as in falling down and stopping when it hits another sprite, but i can't figure out how to make it bounce up a few times before coming to rest!

Any ideas?