Game executes on collision event on startup

Get help using Construct 2

Post » Fri Mar 29, 2013 1:55 am

My game executes the on collision with another object event upon startup in the browser. This causes the player to shoot forward. Is there anything I can do? Thanks.
B
4
Posts: 5
Reputation: 335

Post » Fri Mar 29, 2013 2:34 am

Could you post the (capx.)?
B
14
S
2
Posts: 72
Reputation: 1,224

Post » Fri Mar 29, 2013 2:52 am

sure...its pretty primitive right now...http://dl.dropbox.com/u/40563410/teleport.capx
B
4
Posts: 5
Reputation: 335

Post » Fri Mar 29, 2013 3:51 am

I'm really not sure what your desired goal is, but this is what I see:

1. You have one instance of a bullet in your layout. Since the bullet sprite has a bullet behavior, it immediately moves right (it's starting angle) as soon as the layout starts, and ultimately collides with a dest sprite.
2. When the bullet hits the dest sprite, you have the player sprite's position set to the bullet's location, which is why the player appears to "jump".

Again, I'm not sure what your goal is, but it may be simple as adding an action on the start of layout to destroy the existing bullet sprite.
B
44
S
13
G
7
Posts: 338
Reputation: 10,379

Post » Fri Mar 29, 2013 7:08 am

Or if your bullets are going to be destroyed when they leave the layout anyway, add the 'Destroy outside layout' behaviour and put the bullet on the outside of the screen in the editor.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Fri Mar 29, 2013 7:12 am

Thank you zatyka. That solved my problem. What I am trying to accomplish with it is to create a teleporation mechanic. Is there a method to set this as answered, or give credit to the person who answered it as a way to increase points?
B
4
Posts: 5
Reputation: 335


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests