objects interacting with object

For questions about using Classic.

Post » Fri Sep 05, 2008 2:50 am

I Feel kinda stupid but..

how do i get sprite.1 to fallow other sprite.1
or
if sprite.1 is overlapping other sprite.1 and sprite.1s y position is greater than other sprite.1 y position move sprite.1 in front of other sprite.1,
or
if sprite.1 hp <50 sprite.1 rts move to other sprite.1

basically Im not sure on how to get objects of the same type to tell the deference between themselves
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Fri Sep 05, 2008 4:00 am

The y position one is fairly easy.

+System: For each sprite ordered by sprite.y ascending
- Sprite: send to front

The other ones I'm not so sure.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Sep 05, 2008 4:19 am

thanks for that :)

yea, right now Im working on a cannon fodder remake kind of thing. And the whole units following whoever has the highest rank thing is stumping me.
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Fri Sep 05, 2008 5:09 am

[quote="Bartosh":c6idi8rq]thanks for that :)

yea, right now Im working on a cannon fodder remake kind of thing. And the whole units following whoever has the highest rank thing is stumping me.[/quote:c6idi8rq]

You could always make your higher ranks different objects.

Dunno about objects moving to protect the one with the least health though. I'm too braindead to think right now. I've got one hell of a headache.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Sep 05, 2008 2:25 pm

Following an object is easy enough - give your objects a bullet or ball movement, and always make them rotate towards the object to follow (always - rotate angle towards object). If its an object of the same object type, it might be a little trickier.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Sep 05, 2008 3:28 pm

Yeah see thats the problem. I've been able to rig it so each one is its own object. but what i really want is for the person to link together a Congo line with no cap on the number that can join in the little Congo line thing.
also want my little Ai controlled dudes to go help there little comrades when there hp gets below a certain point.
It just seam like theres no way to have an object interact on a complex level with other instances of itself.

oh and if nobody has the slightest clue what cannon fodder was.
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Fri Sep 05, 2008 5:05 pm

[url:1yjn99lp]http://www.quotecats.com/what/congaline.cap[/url:1yjn99lp]
tada! 8)

The key is the function object and forget picking, whenever you get into picking troubles this is your friend.
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Fri Sep 05, 2008 6:11 pm

That's awesome! It's a slinky!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Sep 05, 2008 9:11 pm

Hey thanks so much for the tutorial. the function object still kinda confuses me, but i think im getting the hang of it. kind of a new trick
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Fri Sep 05, 2008 9:26 pm

That's quite alright :)

Yeah the function object is a bit weird at first, but extremely useful in these situations where you need to get information on another object that you can't pick (for whatever reason) in the same event.
I mean you needed to pick instance 1, which automatically unpicks instance 2. So you call a function (forgetting objects), go to a new event where you can pick whatever you want again, then send info back to the first event.

yeah anyway you get the picture :mrgreen:
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests