Thoughts on Animation + Sprite Sheet in C2

0 favourites
  • 4 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hey Everyone!

    As a huge C2 fan, I wanted to see how people are optimizing their workflow with C2.

    In specific regards to,

    • Changing the Speed for every new animation
    • Importing 40 sprite sheets
    • Setting Custom Default Values for C2 in general (Curious if anyone has played with Source Code of C2 here )

    Let me know what you are doing to make life easier and share it with the rest of us!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't think the licenses let's us play around with the source code of C2, so I usually do those by hand when needed.

    I do use a lot of functions and variables/constants however to simplify events.

    Sometimes I use maths to understand better how to achieve my goal, like that one time I wanted to set a specific height jump.

    Keep in mind importing sprite sheets in C2 means their height and width (of each frame) must be the same, that can be annoying.

  • well.. you can't play with c2's editor source, but you can edit export source..

    go to install directory of C2 (default c:/program files/construct 2) and open folder exporters/html5.

    you will find there - > c2-externs, common prelude, commonace, eveng, expressions, glwrap, layout, system and a few other JS files.

    they are the source code of your game that gets put in runtime.js -> it's combined depending on your choices and complexity of your game.

    i've been tweaking that, but C2 (ashley) won't give you support if you tamper with it, so you're on your own.

    also there are folders in that folder called "plugins" and "behaviours", which have all the JS files (runtime.js / edittime.js) from which runtime.js gets incorporated in that runtime.js file (depending on what plugins / behaviours you use) and edittime - > what is shown / can be edited in editor.

    again tampering the default plugins you won't get any support.

    i've done some work on those too, things could work better somewhere but ashley just doesn't have time for such massive rework/optimizations and i'm not really a high JS expert nor do i have really the time, and whatever you "change" they won't accept to incorporate in code because it might cause issues.

    other than that, most of your events and stuff gets exported to data.js where you won't understand anything because it's just concatenated together.

    in the end you don't have to work on those because with good optimization and correct usage your game will work good no matter how big it is.

    now to answer your original question:

    • i set speed when i choose animation. you can make a function that gets the object from family for example and then sets its speed to designated value, so you won't have to write the same code 100 times, just once.

    for example - > function (family, animation,speed) - > set animation on family; set speed on animation; return;

    • what do you mean importing 40 ss? in sprite editor? 1 by 1
    • same as first. organize your game. here's an example:

    turret defense - you got 5 turrets, all different abilities. what are their common properties? fire range, damage, health(maybe), cooldown time, level, etc.. you put those 5 turrent in a family, give that family those properties and voila all your turrets got these properties.

    so what happens when you want to level up a turret? all you need is a function which receives a family item. for example - >

    function Level (family turret) - > if(turret ==family.smallcanon) - > if (level == 3) return; else level= level +1; ..increase stats...

    if (turret == family.bigcanon) - > if (level == 10) return; else level = level +1, increase other stats...

    and so on..

    if you need a new type of turret - > you just have to change that function, add another if which takes that new turret and changes it's stats, and all you have to do is put the sprite in the family.

    ofc this is an easy example, you can do a lot more with functions and families. grouping is the way to go :=) think of your game first then develop

  • Yea haha,

    I know about families and the functions, but I need this to be optimized as hell and functions setting default values of animation speed are something I am trying to avoid haha

    Damn, Guess I'll wait for C3 then

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)