Having Some Trouble With Object Behavior

Get help using Construct 2

Post » Thu Mar 20, 2014 4:17 am

Message: Canada GDP can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hey folks, I'm having a bit of trouble with object angles.

Image



So I've made this "spike gun", if you will, that fires spikes (with bullet behavior) at the player (the blue box). But no matter what I tinker with in terms of angles and positioning, the spikes always fire at the player as if to hit him or her with the side of the spike, instead of the most prominent point of it (the most prominent point being the point furthest to the right in the above image).

So far, this is what I have going on in terms of events, and I'm really not sure where to go from here.

Image

Do you folks have any ideas on how to make sure the Player gets the most prominent point hitting them before any other part of the spike? I've included a link to the capx file at the bottom of this post.

Thanks so much for your time!

Hey folks, I'm having a bit of trouble with object angles.

Image



So I've made this "spike gun", if you will, that fires spikes (with bullet behavior) at the player (the blue box). But no matter what I tinker with in terms of angles and positioning, the spikes always fire at the player as if to hit him or her with the side of the spike, instead of the most prominent point of it (the most prominent point being the point furthest to the right in the above image).

So far, this is what I have going on in terms of events, and I'm really not sure where to go from here.

Image

Do you folks have any ideas on how to make sure the Player gets the most prominent point hitting them before any other part of the spike? I've included a link to the capx file at the bottom of this post.

Thanks so much for your time!

https://dl.dropboxusercontent.com/u/43214549/Tirin%20Spike%20Gun%20Problem.capx Download the capx
B
12
S
2
Posts: 23
Reputation: 738

Post » Thu Mar 20, 2014 5:18 am

For sprites that you want to rotate to various angles (like your SpikeGunSpike object), zero degrees is pointing to the right. Your object is drawn pointing straight up - so it is always 90 degrees off from where you want it to point.

All you have to do is open your object in the image editor, click the button at the top that says "Rotate 90 clockwise". Then when you rotate the sprite it will be pointing in the direction you want.

(your code works fine, it is just the image that is off)
B
94
S
33
G
20
Posts: 438
Reputation: 17,615

Post » Fri Mar 21, 2014 12:17 am

Oh wow, that fixes it perfectly. Thanks!
B
12
S
2
Posts: 23
Reputation: 738


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Sparkz and 2 guests