How do I indexing same type sprites

Get help using Construct 2

Post » Sat Jan 30, 2016 8:45 am

Hello everyone. I'm newbee. And I try to do simple apps. In my last 'game' I need to do a lot of similar actions. Please, help, can I somehow optimize it (i need to hold on to 64 numberMouse)?

I'm not sure that there families can help me, because there I need a hard link between indexing and global variable.

And the second question. Can I insert on layot a lot of sprites by one click and add them behavior? Becase now i need for every sprite do several boring action like open the folder in which they are contained and add behavior(pin).

Ps Sry for my English btw.

Image
Last edited by Antora on Sat Jan 30, 2016 9:14 am, edited 1 time in total.
B
4
Posts: 3
Reputation: 206

Post » Sat Jan 30, 2016 9:00 am

Can I do construction like this?
if (numberMouse == k) {
array[k - 1] set invisible;
array[k] set visible;
}

If yes, so.. how is it possible?
B
4
Posts: 3
Reputation: 206

Post » Mon Feb 01, 2016 2:51 pm

Any ideas? Please
B
4
Posts: 3
Reputation: 206

Post » Mon Feb 01, 2016 3:01 pm

Is there a special reason why you are using seperate objects for each truck instead of using instances?

You can just copy (or clone) the object in the editor if that's what you are looking for?

I would recommend doing beginners tutorials, because they explain some of the basics of creating games with Construct2..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Feb 01, 2016 3:04 pm

Antora wrote:Any ideas? Please


You can use IID to Index them.

IID is an index identifier of a same type of sprite and it is also in chronological order. That means if I create a new sprite, the first sprite becomes IID = 0 and if I create another, the new one will have the IID = 1. IID's are zero-based, so IID's will start at 0 index.
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024

Post » Mon Feb 01, 2016 3:10 pm

Antora wrote:Hello everyone. I'm newbee. And I try to do simple apps. In my last 'game' I need to do a lot of similar actions. Please, help, can I somehow optimize it (i need to hold on to 64 numberMouse)?


I think making duplicate sprites like this is very inefficient if you can just separate each one by UID's or IID's or even Instance Variables.
Image



The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
51
S
17
G
90
Posts: 1,108
Reputation: 59,024


Return to How do I....?

Who is online

Users browsing this forum: Iftikhar555, mohamed hagras, newt, oddreal, RetroSpock and 3 guests