Object on object (Solved)

Started by smartastreacle, Fri 16/09/2022 12:43:18

Previous topic - Next topic

smartastreacle

Hi,

Let's see if I can explain this well:

I have a country scene object (A) bigger than the display area which I want to move around so it looks like we are flying over it. I have another object (B) which may be a windmill which I wish to animate. Object B starts out of the display area and appears when we move the scene (A). My question is - can I anchor B at coordinates on A so it moves with A and so treat A as a background? For various reasons I can't do a normal background thing. Hope this is clear? Any advice welcome. I see there are changes being made to the forum, hope this question appears.   

heltenjon

#1
Would it work if you made both objects characters and had the one follow the other, perhaps? I believe follow_exactly is what is most commonly used for shadows and the like, so it may work in this case, too.

Khris

You can keep moving the windmill object in relation to the scene one.
Example code:
Code: ags
  oWindmill.X = oGround.X + 234;
  oWindmill.Y = oGround.Y - 345;


You either call this after moving the ground or inside repeatedly_execute.

smartastreacle

Great stuff both. I will try them and update. Thank you.

smartastreacle

#4
I tried both and they both work. However, I prefer to keep moving the windmill object in relation to the scene object method because I don't want too many characters: although I have used the character idea before and it worked.  (nod)
(I have edited this because I got it the wrong way round!)

SMF spam blocked by CleanTalk