change size without stopping physics

Get help using Construct 2

Post » Sun Jan 22, 2012 12:59 am

well my game is using the power shot like in this tutorial here: http://www.scirra.com/tutorials/178/bullettime-charge-shot and im trying using a physics object instead of a bullet. So when it's charging its on layer 1 and starts to change the size (bullet.Width + 0.5, bullet.Hight + 0.5) then on mouse release it moves to layer 2 and changes the size to (bullet.Width - 0.5, bullet.Hight - 0.5) but it stops in midair and decreases size. Anyone know why?
B
4
G
1
Posts: 17
Reputation: 684

Post » Sun Jan 22, 2012 1:52 am

Hard to tell without a capx.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sun Jan 22, 2012 2:22 am

http://dl.dropbox.com/u/52562580/bowlBombing%20%281%29.capx there ya go :3 thx you seem to be very helpful and active.
B
4
G
1
Posts: 17
Reputation: 684

Post » Sun Jan 22, 2012 2:53 am

Seeing your capx I don't understand what the problem is.

I don't experiment a size decrease (and nowhere in the code is there such a thing anyway).
Also it doesn't seem to stop in midair.

Tested in chrome 16 and firefox 9.0.1.

Could you please give more informations/details.
Or maybe is it not the current capx you're experiencing trouble with ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sun Jan 22, 2012 6:35 pm

well I removed the few lines where it decreased, basically the line that allows it to increase in size was reversed, so that if it was greater than 81.92 it would decrease at the same rate that it increases while being fired. Once it starts to do that it stops midair, decreased in size, then moved along its course.
B
4
G
1
Posts: 17
Reputation: 684

Post » Sun Jan 22, 2012 11:22 pm

I had the same problem earlier. I had an object shrink when overlapping another object with physics on. The object just seemed to freeze in mid-air, and then shrink indefinitely, even though the object was only meant to shrink on collision by 1 pixel.

Sorry I couldn't figure it out, but you're not alone!!!AnD4D2012-01-22 23:26:32
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Sun Jan 22, 2012 11:25 pm

http://dl.dropbox.com/u/50465867/WeirdShrink.capx

An example I quickly pulled together, just to show what I mean. Should it stop in mid-air like that?
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Post » Mon Jan 23, 2012 12:06 am

@AnD4D: yes, as the capx is setted up it's normal.

Let's "translate" your code :

Every tick, when Sprite2 is overlaping sprite, we set sprite2 width to sprite2's current width -1. Same for height.

As long as sprite2 is overlapping sprite, it will shrink.

How events work.Kyatric2012-01-23 00:07:26
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Mon Jan 23, 2012 3:59 am

We fixed a bug where Physics objects would stop if you changed their size ages ago. Are you lot not staying up to date? Does this definitely happen in r76?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Jan 23, 2012 12:42 pm

Hi Kyatric,

In my example, I wanted it to shrink whenever it collides, so it's correct the way it works. What I didn't want was the physics to stop.

I'm pretty sure I'm up to date... at work (lunch... :p) ATM, so I can't check, but I'm pretty sure it's the latest version... I recall having families.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
68
S
8
G
6
Posts: 930
Reputation: 9,358

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests