create a fire boundary

Get help using Construct 2

Post » Mon Aug 26, 2013 9:53 am

hi

i want to create a boundary for my bullet that player can fire in the boundary lines
and when the bullet is out of the boundary it will destroy

just like this picture :

how can i do this ?

B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Mon Aug 26, 2013 10:02 am

System compare two values : distance(player.x,player.y,bullet.x,bullet.y) > 200 - bullet destroy?

BTW, I can't see your picture, so I just guessed.LittleStain2013-08-26 10:04:27
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 Aug 26, 2013 10:34 am

thanks alot

it was very easy i forgot distance expression :D
B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Mon Aug 26, 2013 10:50 am

update ...

i set that when distance between player.x , y and bullet.x,y is grater than 400 bullet destroy

but this events destroy all of bullet that create every 0.1 second

so the fire isn't smooth and it flash every 0.1 second because construct don't know every 0.1 second create or destroy bullet !?

how can i fix this problem ?
B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Mon Aug 26, 2013 12:17 pm

i update my last post ...
B
10
S
3
G
2
Posts: 46
Reputation: 2,025

Post » Mon Aug 26, 2013 12:29 pm

I think this is one of those moments you could use a for each.

for each bullet - distance(player.x,player.y,bullet.x,bullet.y) > 200 - bullet destroy

But I'm still wrapping my head around the instances and the for each stuff, so I could be wrong.LittleStain2013-08-26 12:29:25
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


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish, marc254, Mayfly, Yahoo [Bot] and 15 guests