How do I exactly stop the bullet at position ?

Get help using Construct 2

» 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

» Fri Jun 26, 2015 9:14 am

Or simpler based on @LittleStain answer :

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

Please attach a capx to any help request or bug report !
Moderator
B
311
S
128
G
101
Posts: 7,413
Reputation: 75,222

» Fri Jun 26, 2015 9:24 am

Kyatric wrote:Or simpler based on @LittleStain answer :

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

» Fri Jun 26, 2015 1:58 pm

yes thats awesome
thanks
B
54
S
21
G
8
Posts: 872
Reputation: 9,191

Previous