Spiders are not cooperating

Post your own tutorials, guides and demos.

Post » Sun May 10, 2009 2:21 pm

Hi all,
I recently (kind of) finished an enemy for a game i'm working on. All worked well and good until i added another one to the layout for testing. Now all enemies seem to react to events that are only supposed to affect one of them.

At first i thought the problem was in the comparing of X position relative to the main character sprite, but i think i fixed that and the problem remains.

What is supposed to happen is that when MC comes close to a spider, the spider will move towards the MC and bungee down when the MC is directly below it. If the MC is far away, the spider should return to its original X position. This works when there's only one spider.

I would be very grateful if someone could tell me what i'm doing wrong and how to fix it.
B
5
S
1
G
3
Posts: 24
Reputation: 1,123

Post » Sun May 10, 2009 2:28 pm

You need some persuading power. Here, take this:


:D

Okay, sorry, currently I am unable to look at your cap, however I can tell that you're having issues with picking. You have to be aware which instances are being selected. I'm sure someone else can shed more light onto this while I wrestle with Windows 7 here...
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun May 10, 2009 2:29 pm

[quote="gugugu":3tbxcvss]Hi all,
I recently (kind of) finished an enemy for a game i'm working on. All worked well and good until i added another one to the layout for testing. Now all enemies seem to react to events that are only supposed to affect one of them.

At first i thought the problem was in the comparing of X position relative to the main character sprite, but i think i fixed that and the problem remains.

What is supposed to happen is that when MC comes close to a spider, the spider will move towards the MC and bungee down when the MC is directly below it. If the MC is far away, the spider should return to its original X position. This works when there's only one spider.

I would be very grateful if someone could tell me what i'm doing wrong and how to fix it.[/quote:3tbxcvss]

That's quite common. I don't remeber but i think you have to put them all in to one family and then in the events call that family insted of one object. Or you can try addin 'for each' ... not sure.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Sun May 10, 2009 5:50 pm

Just insert spider into family and then use family for everything. Like enemy(family's name) is over MC -> jump and NOT spider is over MC - > jump

EDIT You have to insert enemy family into sprite 33 and then replace all sprite 33 conditions and actions with enemy group. Well the group can be any but enemy should fit this case.
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Mon May 11, 2009 1:19 pm

Hmm, I did as you say and replaced all the conditions and actions, but the problem still remains :?

Maybe i did something wrong, i'm confused to how putting things in a family would solve the problems.
B
5
S
1
G
3
Posts: 24
Reputation: 1,123

Post » Mon May 11, 2009 5:26 pm

in family it wont just test all for that specific spider but checks spider that meets conditions and well when i tried that cap I didnt see any problems though I didnt test much cuz I had to go
B
11
S
3
G
4
Posts: 622
Reputation: 3,186


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest