best way to make a simple gravity object

Get help using Construct 2

Post » Mon Oct 07, 2013 3:56 pm

What i want to achieve is a bullet shell coming out of your gun when you shoot. I would do this by making the sprite having a random velocity and direction on it's creation and having some basic gravity so it falls to the floor.

Which is the best way to do this? I applied the phisycs behavior but it's too complex for my understanding. Making it plataform and avoiding the collision with the floor?

Is there a way to add it some simple gravity behavior and velocity?
B
5
S
1
Posts: 92
Reputation: 609

Post » Mon Oct 07, 2013 3:59 pm

The way I would do this is with the physics behaviour. Gravity drop stuff is all within that. I think it's fairly basic, just adjust the settings and have a play around : D
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Mon Oct 07, 2013 4:10 pm

The bullet behaviour itself has gravity.. Why use another way to make a bullet?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 07, 2013 5:31 pm

it worked with the bullet behavior (it wasn't a bullet! It was a bullet SHELL), but it worked perfectly :D

I made it bounce of solids and it gives a nice effect. But is it possible to decrease the bounce so every time it bounces it does it a little less like real life physics? or is it too complex?
B
5
S
1
Posts: 92
Reputation: 609

Post » Mon Oct 07, 2013 5:50 pm

Something like on collision with another object, increase friction
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Mon Oct 07, 2013 6:09 pm

you could either set a negative value for acceleration or decrease speed on collision.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Oct 08, 2013 6:27 pm

I can't find the way to decrease speed on collision. I only can "set" the speed I want. I guess an expression is needed to compare the actual speed of the sprite and multiply it by 0.5 or something. But I don't know how that's formed...
B
5
S
1
Posts: 92
Reputation: 609

Post » Tue Oct 08, 2013 6:55 pm

on collision -set speed: self.bullet.speed - 10

or any other number
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Oct 09, 2013 5:55 am

greatttttt
B
5
S
1
Posts: 92
Reputation: 609


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948, Matei511 and 53 guests