Destroy when X

Get help using Construct 2

Post » Wed Feb 01, 2012 12:41 pm

This is more of a game logic / event logic question, bear with me please :)

Window is 640x480
I have a layout, it has 1000000 width, 480 height, and there is a bullet flying through from left to right, screen is set to every tick scroll to bullet. You control the bullet up/down.
Every tick on random(10)<2 I create a target on Y random(480), X = scrollx+640 (on the right, off the screen, so it appears in a second and goes from right to left, so that you can hit it with your bullet)
easy enough, the problem starts after a few whiles, because of the targets you didn't hit stay to the left of view, right? best thing to do is destroy them, if they are on the left side of view. so, I did and this is crucial:

target: compare X < scrollX - 640

it should work right? well guess what, it doesn't :) is there something with my brain or is it a huge bug in construct?
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Wed Feb 01, 2012 12:49 pm

http://dl.dropbox.com/u/1378330/BulletDestroyEg.capx

Is that what you are trying to do? Works for me. It is usually a big help when you post capx's when asking a question like this.cow_trix2012-02-01 12:50:02
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Wed Feb 01, 2012 1:08 pm

well my capx is nearly finished game, so please do understand why I didn't post it. just when testing yesterday I noticed a huge slowdown which after investigation lead me to not destroying objects when left of layout.

also wow, now I just have to find out where is the problem on my side as it clearly works for you :) thanks. it seems in my project it destroys some of the targets, and leaves some there, as the count sometimes drops, but the general number constantly rises :/
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Wed Feb 01, 2012 1:14 pm

ok, got it, I am an idiot. thanks @cow_trix :)
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Wed Feb 01, 2012 1:21 pm

Just for future reference, ranma, what was the issue?
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Wed Feb 01, 2012 1:23 pm

I was creating bullets at scrollx + bullet.x for some reason, probably drunk coding :) , so it was created way off to the right. my mistake.
B
81
S
50
G
10
Posts: 555
Reputation: 13,009


Return to How do I....?

Who is online

Users browsing this forum: ETgirl79, Yahoo [Bot] and 20 guests