Question about sprite and object

Discussion and feedback on Construct 2

Post » Fri Mar 01, 2013 11:24 am

I know from when i was using live swif before constuct 2 was made. They had database system where you could copy and copy same image over n over but to allow those image to become sprite and interact you had to re name each one with a new number after the name such as Cat0 cat1 cat2 etc if you wanted them to work.

So far with seeing construct two basically do that for you problem i have is what if i have two identical image sprite from the database but i want them to not do the same thing. I really dont want to have to create sprite image over n over in database.

In other word an added plug-in that would say asked if multiple same image sprite on same layout do you want to combine their name as one so code work for all or do you want to have different instance name. so that code does not work for all only for the one.

Unless if this is already in construct two please do tell me.
B
7
S
2
G
3
Posts: 58
Reputation: 2,284

Post » Fri Mar 01, 2013 3:37 pm

I'm not quite sure about what it is you want the sprite instances to do differently, but I'll take a crack!

If you just want two or three identical sprites to behave differently, you can use their unique IDs to select them to tell them what to do.

You can use instance variables in your sprite object, so you could check that to see what the object should "do". Like:

If Cat.Sleeping, do nothing. If Cat.Meowing, meow; and so forth.

That is just for boolean instance variables you create. You can make number variables and text variables as well, so you could theoretically make:

Check out the man page here =) I'd Link it, but I'm a potential spammer, so they don't let me post links.. yet. mwahahah.

https://www.scirra.com/manual/73/instance-variables

cincipon2013-03-01 15:49:05
B
6
S
1
G
1
Posts: 70
Reputation: 702

Post » Sat Mar 02, 2013 12:35 pm

errr it doesn't really tell me too much, but you did lead me to which i now know what families are.

Do you know or can you show me some example of how to do that. Like for instance Sprite A might be like the player and Sprite A'1 might be the enemy. Is there a way to split the one sprite into two different name instances.   
B
7
S
2
G
3
Posts: 58
Reputation: 2,284

Post » Sat Mar 02, 2013 4:56 pm

Sorry, I misunderstood you.

Have you tried cloning your sprite in the project window? If you right click your sprite, select clone, and then drag the cloned sprite into your layout, that should be what you're after.
B
6
S
1
G
1
Posts: 70
Reputation: 702


Return to Construct 2 General

Who is online

Users browsing this forum: Silverforce, Zebbi and 13 guests