Detector not keeping up

Get help using Construct 2

Post » Tue Jan 24, 2012 11:33 am

Hi
In my platform game I'm using a detector/Hitbox which is positioned to an image point every tick to as a way of determining when a enemy recieves damage from the players weapon but while jumping in the air my hitbox doesn't keep up with the players image point can anybody tell me what I'm doing wrong?

(It's the most noticable when you leap from the first ledge and have the extendable upgrade)

relevant controls are
z to jump
X to Attack
the pots are upgrades


http://dl.dropbox.com/u/56373295/Construct%202%20Files/Platform%20Game.capx

Sprites are not mine they are from a game called Goemon, I just felt like using them as placeholders while I figure out most of the programming for my own game.Vercingetorix2012-01-24 11:34:55
B
5
S
1
G
1
Posts: 52
Reputation: 1,222

Post » Tue Jan 24, 2012 12:26 pm

Probably because you only spawn it, you have to set its position to the image point as long as the attack is playing... And you should have this image point on all your attack animation frames.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Jan 24, 2012 1:39 pm

I'm not sure I follow
I was certain I had the image point on all my attack animation frames, in which frames is it missing? Also I've added the event you described to position it while attack is playing but it doesnt seem to have made any difference.

Here is he file of my attempt at following your instructions with a few of the unecessary events & animations removed as well because they were beginning to make things confusing for me.

http://dl.dropbox.com/u/56373295/Construct%202%20Files/Platform%20Game%20second%20attempt.capx

Vercingetorix2012-01-24 13:52:55
B
5
S
1
G
1
Posts: 52
Reputation: 1,222

Post » Tue Jan 24, 2012 2:49 pm

for the image point thing, I was just being cautious, I hadn't checked when I wrote that.
There's indeed a tiny offset when you fall. Offset like that often happens for very fast movement, and in your case I don't think it will really be that noticeable once you make the hitbox invisible.
It will still be accurate enough I think.
Anyway, mmmmmm

ok I found the issue. The pin behavior seems to work after the hitbox positionning event occur. So the hitbox is always one frame late.
Solution: don't use the pin behavior and make sure you position the animation sprite to the detection sprite before positionning the hitbox.Yann2012-01-24 14:51:14
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Jan 24, 2012 3:08 pm

Thanks a bunch
I really appreciate the help Yann, I'd have never figured that outVercingetorix2012-01-24 15:09:31
B
5
S
1
G
1
Posts: 52
Reputation: 1,222


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, MChiz, plinkie, Radulepy and 0 guests