Position 1 object with another object but offset 2nd

Get help using Construct 2

Post » Fri Dec 30, 2016 10:05 pm

I have a boss ship that moves left then after say 10 HPs moves back right and a shield object comes up. I can get the shield obj to come up fine and move with original obj with "set position to (boss1.x, boss1.y)."

But with the above command the the boss and sheild just do not line up like i want(because they are different sizes and whatnot) and so I am trying to shift the shield by add/minus x/y as needed but to me it does not appear to be working.

would you guys/gals use set position to (boss1.x, boss1.y+100) to shift the shield obj down 100 pixels from the center point of the boss1 obj? Or am I not understanding something?

Thanks,
Rich
B
9
S
2
Posts: 104
Reputation: 975

Post » Fri Dec 30, 2016 10:26 pm

Is the shield pinned to the boss? If not then you'll need to make sure the boss1.y+100 part happens every tick.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Fri Dec 30, 2016 10:35 pm

Your solution works fine. If done every tick. If there is only 1 shield and 1 boss.

Other suggestions. (that work fine too)
Use imagepoints on the boss.
https://www.scirra.com/manual/63/image-points

Position the shield on an imagepoint
https://www.youtube.com/watch?v=Q8UsarmzAUM

Then keep it there by ..
or position it every tick to an imagepoint
or use Pin behavior

https://www.scirra.com/manual/99/pin
https://www.youtube.com/watch?v=on6pzNXcxKw
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Jan 02, 2017 1:19 pm

Thanks for the suggestions. I havent messed with since Friday but will look at again today. The shield moves fine with the boss fine...but I just could not get it where I wanted it to be right of the bat so it just looks weird, to me. I'll try imagepoints as well.
B
9
S
2
Posts: 104
Reputation: 975

Post » Mon Jan 02, 2017 6:02 pm

Ah yes the image point movement worked best for this. Thanks!
B
9
S
2
Posts: 104
Reputation: 975


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 39 guests