The Instance variable for Enemy sprite with EnemyBox

Just started using Construct 2? Post your questions here

Post » Wed Jul 27, 2016 9:47 am

Message: BlackyDragon can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
It is a platform game. I am following this tutorial https://www.scirra.com/tutorials/253/how-to-make-a-platform-game/page-7#h2a18
I am using an invisible rectangle sprite to move the enemy sprite so that the platform behavior won't confuse when the sprite animation changes. Multiple enemies are needed to be copied in the layout. However, I am confused what should I do with the instance variable so that each enemy can mirror on their own when they face left. Here is my project file: https://www.dropbox.com/s/bwt8nj6z12mauon/Adventurer%20Dog.capx?dl=0
I tested with 2 enemies in the project. However, both of them faced left even though only one of them walking to the left. Please check the .capx file first. Thank you
Last edited by BlackyDragon on Thu Jul 28, 2016 6:48 am, edited 3 times in total.
B
10
S
3
G
1
Posts: 12
Reputation: 1,008

Post » Wed Jul 27, 2016 12:26 pm

Howdy, I would like to see if I can help you, but the capx download link you sent is modified in your message. PM me the link?
B
5
Posts: 8
Reputation: 241

Post » Thu Jul 28, 2016 6:02 am

Message: BlackyDragon can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
dewetberg wrote:Howdy, I would like to see if I can help you, but the capx download link you sent is modified in your message. PM me the link?


I'm sorry I can't PM you since my rep point is below 500. Here is the link
https://www.dropbox.com/s/bwt8nj6z12mauon/Adventurer%20Dog.capx?dl=0
I really hope someone can help a beginner like me :)
B
10
S
3
G
1
Posts: 12
Reputation: 1,008

Post » Mon Aug 01, 2016 12:10 pm

Hi, sorry, I haven't had a chance to have a look at this, hope you figured it out =)
B
5
Posts: 8
Reputation: 241

Post » Mon Aug 01, 2016 3:00 pm

Have to pick spider that goes with the box. 1 way to do this is use containers. But that means also that you have to create spider & box during runtime.

Another way is to just give spider & box a identification number (or string). Those with the same identification number are a pair.

Like this:
https://www.dropbox.com/s/wod7r8c939bta ... .capx?dl=0

I gave spider & box an instance variable 'ID'. In the layout editor i gave them matching numbers.
Now, if you pick one, you also pick the other.

As in event 3, where i pick each box, and at the same time the spider with the same ID as the box. Now the right spider gets set to the position of the right box.

As in event 20. Where the 'on collision' auto picks a box. And i pick the spider with the same ID. The action of the box is updated, and the mirroring of the spider with the same ID is updated.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Aug 02, 2016 5:44 am

99Instances2Go Thank you very much for your help. It is really an valuable information for me. Thanks a lot :)
B
10
S
3
G
1
Posts: 12
Reputation: 1,008


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests