Physic Behavior Basics

For questions about using Classic.

Post » Wed Dec 01, 2010 9:35 pm

Hello,

I want make this:

When i Click, then a sprite spawns (changes position to mouse). [DONE]
That sprite is solid. [DONE]
That sprite have physics behavior and gravity checked. [DONE]
There is ground sprite (platform) which is solid. [DONE]

When I run the game, spawned sprite will appear, then falls down, but not stops at the ground.
Just falls down & down & down.....

Why?
That Collision Mask or whatever is that, is set to Box thing.
B
2
G
2
Posts: 35
Reputation: 720

Post » Wed Dec 01, 2010 9:41 pm

Tried this too:
viewtopic.php?f=4&t=7074&start=10 (That last cap file)
Same thing happens :( :(
B
2
G
2
Posts: 35
Reputation: 720

Post » Wed Dec 01, 2010 10:02 pm

I think you have to add physics behaviour to the ground object and select 'immovable'.
B
4
S
1
G
2
Posts: 91
Reputation: 1,057

Post » Thu Dec 02, 2010 7:05 am

Thanks! It works correctly!

Now I Got next problem:

When I move object with mouse (left click moves the object to MOUSE X & Y) and
my character is on it (used default movement behavior) it will trasnfer the object AND the character.

I need only to move the object, not the character.

So if I click, object moves & the character will fall down.
B
2
G
2
Posts: 35
Reputation: 720

Post » Thu Dec 02, 2010 8:57 am

Do you use drag and drop behavior?

Can you post a cap? Its kinda hard to figure what you mean :\

My guess is the charracter needs physics behavior too...
B
4
S
1
G
2
Posts: 91
Reputation: 1,057

Post » Thu Dec 02, 2010 10:28 am

Here you go:

Just click and wait till the purple object falls down. Then jump with green box on it. Now click somewhere.. Box purple with box green teleported together... i just want make the green box fall down

http://www24.zippyshare.com/v/19678254/file.html
B
2
G
2
Posts: 35
Reputation: 720

Post » Thu Dec 02, 2010 10:44 am

Ok i see :)

I don't know if it's the best way, but i'd do it like this :



[code:pzg7w1fp]+ MouseKeyboard: On Left mouse button Clicked
-> Sprite3: Destroy
-> System: Create object Sprite3 on layer 1 at (MouseX, MouseY)[/code:pzg7w1fp]

You can check the attribute "destroy at startup" on Sprite3.

If you want to spawn multiple objects, just remove the destroy line.
B
4
S
1
G
2
Posts: 91
Reputation: 1,057

Post » Thu Dec 02, 2010 11:56 am

Thanks, it works! I like you, sir!
This forum is so good!
B
2
G
2
Posts: 35
Reputation: 720

Post » Thu Dec 02, 2010 2:53 pm

Next problem here :/ (wish to be last):

I want to make my ball character (like that box green, but a green ball) to push the box which i spawn.
It is possible to make it?
B
2
G
2
Posts: 35
Reputation: 720


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests