0 Favourites

How do I change and buy skins on demand ?

  • We have created an app and now we want to add a "skin" system for the character.

    The problem is, there are too many variables and too many visibility and opacity changes. -.-

    My question: Is there a simpler way or plugin to change skins of the character.

    Currently I'm changing them with adding variables to each color, and each change, changes variables for the whole set of colors which adds up to way to many lines of code and is getting easy to get lost in it.

    Best Regards.

  • XML is great for situations like this.

    But you'll still have to manually define values for your variations.

  • Thanks for the tip, it really helped us to try it and gave us the idea to use the Array for it.

    But still, entering the values manually is a lot of work xD.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You can create a dictionary object, and attach it to a/any/all character instance... by putting them into a container.

    This way, each character has it's own dictionary automatically, that is always referenced to the correct character (because of the container) - then you can reference the dictionary traits of any specific instance; IE - "key : value" -or- "Shirt : 12" -or- "Pants : 'BlueShorts'" -etc-

    This way you can simply use your (dictionary) value of each key as an animation frame or animation name to a "shirt" object (sprite); IE "Shirt : 12"

    [Every X seconds/on button clicked/whatever condition]

    ---Set Pants.sprite animation_frame to Dictionary.get("Shirt") {will return "12" because of, "Shirt : 12"}

    ---Set Shirt.sprite animation_frame to Dictionary.get("Pants") {etc}

    --- Set Hat.Sprite animation_frame to Dictionary.get("Hat") {etc}

    --- ETC

    Hope this makes sense^

    *EDIT*

    I'm sure your application of it won't be the same approach but it's much easier than handling a tonne of variables, especially when you just loop through the entries.

    ~Sol

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