How do I exactly stop the bullet at position ?

Get help using Construct 2

Post » Fri Jun 26, 2015 8:25 am

matrixreal wrote:
R0J0hound wrote:looking at it again you'll probably want width>400 since by subtracting from the width it should be shrinking.

here is what i want exactly
but as i told you always stop at different value
https://www.dropbox.com/s/vrc769cjw12pm ... .capx?dl=0



One way of solving it:

https://dl.dropboxusercontent.com/u/485 ... egrow.capx
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 » Fri Jun 26, 2015 9:14 am

Or simpler based on @LittleStain answer :
Image

This is a question of comparison sign.
As long as the object is less (and ONLY less) than the desired size, you make it bigger.
Once it is bigger (and ONLY bigger) than the desired size, you set it at the desired size.

Without the "or equal" in your comparison, you're making sure the logic works as intended.
You are also making sure that as long as the size is less than the desired size, the object will get bigger. The moment the size is reached, it won't grow anymore.
And you are also making sure that it will be bigger than the desired size only once, since the moment it happens, you set it to the desired size which no event/condition actually acts on anymore.

Replace 80 with any value, and it will work, as long as it is consistent in both events.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Fri Jun 26, 2015 9:24 am

Kyatric wrote:Or simpler based on @LittleStain answer :
Image

This is a question of comparison sign.
As long as the object is less (and ONLY less) than the desired size, you make it bigger.
Once it is bigger (and ONLY bigger) than the desired size, you set it at the desired size.

Without the "or equal" in your comparison, you're making sure the logic works as intended.
You are also making sure that as long as the size is less than the desired size, the object will get bigger. The moment the size is reached, it won't grow anymore.
And you are also making sure that it will be bigger than the desired size only once, since the moment it happens, you set it to the desired size which no event/condition actually acts on anymore.

Replace 80 with any value, and it will work, as long as it is consistent in both events.


Yeah, that's better.. :)
Sometimes I just want it to work and don't bother finding the easiest way, haha..
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 » Fri Jun 26, 2015 1:58 pm

yes thats awesome
thanks
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests