Better to use different instances of one object ?

Discussion and feedback on Construct 2

Post » Mon Sep 30, 2013 3:23 am

Hello,

Just wondering... i was currently (probably making a mistake) cloning objects.. such txtUsername or txtPassword for my textfields.. but i think it doesn't work that way.. i could just make Textfield and use different instances.

So it is better to use different instances of one object or use many objects of the same kind ?

What the kind of impact on performance for the both methods ?

Thanks!Rushino2013-09-30 03:26:51
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Mon Sep 30, 2013 3:28 am

Doesn't matter, whatever is best for your code.
B
147
S
74
G
20
Posts: 1,786
Reputation: 22,527

Post » Tue Oct 01, 2013 12:32 am

Alright! Thanks!
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Tue Oct 01, 2013 12:57 am

Performance doesn't change, but generally you'll find that your life is much easier using different instances for anything that has the same or a very close function.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679


Return to Construct 2 General

Who is online

Users browsing this forum: gamecorpstudio and 7 guests