What's the best way to organize an (Alchemy) type game?

0 favourites
  • 6 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • I have the basic concept down, seems pretty easy. When two items combine they are consumed and disappear. Where I run in to an issue is the shear amount of actions I'm creating to reach the number of combinations I'd like to have.

    Does anyone know a better way to do this? Families or something?

    Thank you,

  • I've included a link below for the mechanic I'm trying to achieve (and organize).

    http://littlealchemy.com/

  • I hope i got you right:

    Put all your "elements" in a family.

    Add instance variable "id" for the family and give each element an id.

    Then you need a config to check what new element you'll get.

    You can either save it manually in an array (X axis would be the element id, Y Axis the element id of the element you combined and Z the result).

    In this cases I like to create my own "Config" Plugin where I save all the data in a JSON Object and return it as JSON String to C2 when needed. (normally I use Hash Plugin to do this, but you could also use an array stucture).

  • I agree, an array with all the items you've made would be best, and as for creating the items, you may need to have to have a large volume of code due to the nature of the game sadly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I was afraid it would be as complicated as I imagined. I'd hoped that I was just overlooking something simple. This would be an amazing game mechanic to combine with an RPG for crafting or something but it might just be over my head right now.

  • Hey fun thing, I actually made this game. :)

    I haven't tried to recreate this in construct but I don't think it would be a problematic thing to do.

    I have a json file with all connections, something that looks more less like that:

    {
       "6":{
          "parents":[
             [
                3,
                2
             ]
          ]
       },
       "8":{
          "parents":[
             [
                6,
                3
             ]
          ]
       },
       "9":{
          "parents":[
             [
                1,
                1
             ]
          ]
       },
       "13":{
          "parents":[
             [
                1,
                4
             ],
             [
                15,
                1
             ]
          ]
       },
    [/code:130dsob3]
    
    All elements have a family variable with their id. Then use drag and drop to detect mixing and just go through the list to check if this pair exists in the library.
    
    As mentioned by Vuuv you could format this data so it fits the array or you can try using xml instead.
    
    Then for the progress I store pairs of parents and I go through it the same way when I load or reload the library.
    
    edit:
    You could also try using this:
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)