Bullet Behavior Questions

Get help using Construct 2

Post » Mon Apr 16, 2012 7:01 pm

Hey guys I just have a few questions that involves messing with the angle and angle of motion for bullet behavior thank you for taking the time to read them.

1) Is there a way to set an objects angle/angle of motion outside of using the event sheet? In other words every time I create the bullet I don't want to have to keep setting angle of motion, because several bullet objects are created at once.

I have tried setting it on Start of layout but it seems that if there is no instance present or the last instance of the sprite is destroyed it goes back to the default 0

2) Is there a consistent way to have bullet fly to a specific spot on the map without having to using the command Set Angle to Position?

The reason this doesn't work for me is because it causes the bullet object to rotate and I have an animation pinned to the bullet and this also causes the animation to rotate.

So far I have been using the Set Angle of Motion command and putting in a numeric angle by hand. Then just using another object to deflect the bullet at a different angle that is again set by hand. The major issue with this is its not consistent and eventually the bullet sprite goes off course and misses its mark.

Sorry if this was confusing, if I need to clear anything up just let me know. Thank you for taking the time to help.
B
5
Posts: 16
Reputation: 609

Post » Tue Apr 17, 2012 12:24 am

It is a bit confusing indeed.
Posting a capx would help helping you.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Tue Apr 17, 2012 6:17 pm

I apologize for the confusion. I have uploaded a CAPX that will hopefully shine some light on what I'm trying to accomplish

In the file I have uploaded the blue square start at the origin of Orange squared labeled OrangeUR. It then flies at an angle of 180, that I have set in the Event Sheet.

After this when it overlaps its target it just changes it angle of motion to point itself towards the next Orange square. The issue that I'm talking about with this method I'm using is that the blue square never actually comes near the origin of the next square. This means its never on the actual path that I was looking for.

The big issue with this, and you can see what I'm talking about if you let the blue square fly around for a while, is that its path is not consistent. Eventually the blue square starts hitting the orange squares in different spots and this changes its overall path.

I know that this example represents repeated movement and using the Sin movement function has helped me get around this issue with some stuff. My issue comes up because sometimes I don't want movement to be a cycle. Also my angles of motion aren't always nice 90 degree angles sometimes it 60 or 30 and this makes the movement even farther off.

Thank you very much for taking the time to take a look and help me.

Game File
http://dl.dropbox.com/u/64691866/BulletMovement.capx
B
5
Posts: 16
Reputation: 609


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Google [Bot] and 33 guests