Events vs. custom Behavior, what should I do

Get help using Construct 2

Post » Fri Apr 27, 2012 10:57 am

As I am tossing ideas at construct when they strike me, I end up recreating the same event chains over and over again (adjusting old prototypes and rebuilding them). At this point I think it might be better to have a custom behavior to implement this movement to
a) save time
b) save events
c) keep the event code clean

I had a look at @rexrainbow 's 8wayMP Behavior to see if I was able to build a custom version of his custom version to support the grid movement I want for some of my games / prototypes. I was about to jump into randomly changing parts of the js code when a thought struck me...

What about performance?
I know that in web development implementing the wrong js plugin, carelessly using jquery selectors (in loops) and stuff happen to have a large impact of performance. On the other hand, all events generate js code anyway (optimized, I am shure. Thanks @Ashley).

What are your experiences when working with custom behaviors vs. events. I plan to switch to the paid version soon so the number of events isn't a factor for me (or won't be soon). Should I wait and stick to events or would it be better to try and build a movement behavior (or hope that someone else creates one)?


MC
B
4
Posts: 19
Reputation: 363

Post » Fri Apr 27, 2012 8:53 pm

Performance will be better when using a plugin or behavior as opposed to events. It's usually negligibly faster but can make a big difference when doing complex stuff such as pathfinding.   
B
79
S
24
G
52
Posts: 4,724
Reputation: 39,711


Return to How do I....?

Who is online

Users browsing this forum: fr0z3n, RookieDev, TRMG and 14 guests