JosepM's Forum Posts

  • Hi DUTOIT,

    Nop, my initial approach is create the map with many sprites where each sprite is a region, country, etc.. and each frame show the region selected and with some colors of each faction.

    As you said me, group all the region sprite into families permit me loop to select automatically the destinations from the selected region and as you said before load from a JSON into an array to control it.

    {"Z1":[2,6,7],"Z2":[1,3,6,7],"Z3":[2,4,6,7],"Z4":[3,5,6,7],"Z5":[4,6,7],"Z6":[1,2,3,4,5],"Z7":[1,2,3,4,5]}

    But the array don't recognize the JSON array. Is correct? or I missing something?

    How handle it from one worldmap sprite?

  • Hi DUTOIT,

    I test your example and is good, but the problem I see is that my regions are each one a sprite, my map is a colletion of sprites and no instances of the same sprite, so how can I refer to each one from inside the repeat loop?

    For the chips stats and others elements that can be instances is very good.

    Salut,

    Josep M

  • Hi DUTOIT

    I explain with more detail what I want to accomplish.

    Now I have the “hard coded” version of the map definition, I mean that I defined for each zone the posibles destinations in “touch event”. Thank you for your tips.

    I want that these posibles destinations will be drive through an array. For each zone I have an array with the posibles destinations, so when the user “touch” one zone, I want repeat for each element of their array and change the frame, so maintain the zones connectors will be more easy.

    Pseudocode.

    Load from an URL or file the JSON of the arrays for each zone.

    Zone #A touched
    if active=true of Zone #A
    repeat for each element X of array #A
    	Change frame of zone X
    	Set active =true
    end repeat [/code:1b0usnav]
    
    On this way I can update the zones destinations from an array and not by “hard code”
    
    It’s posible do that? how can I refer to a sprite inside the repeat loop?
    Can I pass sprite reference to a function?
    I read about the UIID but don’t know how pass it?
    
    Salut,
    Josep M
  • Hi DUTOIT,

    Many thanks for your example, finally I was able to put my map working. Attach the .capx so maybe can be usefull to anybody.

    Few questions more.

    1)Why the city tokens select also the zone? I touch the city and the zone react to the touch. The city pass the event to the bottom elements? Can be blocked?

    2)How call a function from other event sheet? If I add a the function into other event sheet the call doesn't work, or I don't have idea how call it.

    3)Can be used with an array to stablish the destinations from a select zone?

    Zone 1: 2,7,6

    Zone 2: 1,3,6,7

    Zone 3: 2,4,6,7

    Zone 4: 3,5,7,6

    Zone 5: 4,7,6

    Zone 6: 1,2,3,4,5

    Zone 7: 1,2,3,4,5

    So when I touch a zone I get the NameID check the array and with repeat for each element assign the frame, but I don't know how assign the sprite to the frame inside the repeat so each sprite is diferent.

    Thought?

    Salut,

    Josep M

  • Hi,

    Well, after view the videos I understand the use of containers and how select the zones using others frames.

    In my case then I will have a unselected and a selected image of each zone. All the zones are different so I don't know if is better put all the zones inside a container. So each sprite must be assigned with her own triggers, isn't?

    Salut,

    Josep M

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes. I try it

    Thanks for answer and point me...

  • Hi,

    I'm lost about pass values from / to another action. I need some help so I'm blocked.

    1) I want recover the value from an "touched" object and store globally.

    2) From these globally value I want "repeat for each key" and from the values that I found I want perform some action, color change for example over the objects values.

    I'm blocked I read the manuals, search the forum but I don't have idea how handle it.

    The 1) is ok. I have a instance variable with the name of the sprite and when I "touch" I set the value to a instance variable of the dictionary. But no more...

    How can I do the point 2) ?

    Thanks in advance.

    Salut,

    Josep M

  • Ok. How I add a dictionary for each sprite. I read the documentation and not see that. I guess is a global variable.

    Can I add an array into the dictionary?

  • Hi,

    I would like share my thoughts about how handle this. The game idea is like a Risk game.

    Q1

    I have a map with many regions.

    What is best? Each region one sprite or the whole map as background and on top transparents sprites for each zone?

    Q2

    The user touch one region and I need select the destination regions from the touched region.

    The destinations should be selected in function of the action points (AP) that the player left available.

    For this I think this approach.

    1. Create an array for each region where the values are the posibles destination regions.

    For the posibles destinations I need store the AP that must be required to enter into and subtract from the player AP.

    2. Only highlighted regions can be touched, so I think put a variable that is put to true or false to examine if is posible touch it.

    3. If the movement is posible move the player chip.

    How is best to create the arrays? for each sprite? or globally? I guess that is better globally to share positions but then I have the doubt about how identify each sprite ID when the player touch it.

    Thoughts?

    Salut,

    Josep M

  • Well done

  • Very impresive work. Well done. I like.

    What program you used? It's for sale only or are part of a game?

  • The event 4 is for simulate that the piece lost RES (resistance) but when I left-click on any of the others pieces always show the same RES value, no matter what right-click, even the same value.

    I want simulate that each of the pieces have one start values, and then as the game run with the user interaction the pieces lost RES.

    Salut,

    Josep

  • Yes, please

  • Hi,

    I have a puzzle pieces that are duplicated. I want that each of the pieces have their own attributes, I define some instances variables for the sprites, but all the pieces have the same values and if I change to one of them all are changed. I read about the instances variables belong to each object.

    Maybe I can use one sprite for each piece but I don't know how affect it to performance.

    What I'm doing wrong?

    Salut,

    Josep M

    [attachment=0:degnl77i][/attachment:degnl77i]

    [attachment=1:degnl77i][/attachment:degnl77i]

  • Hi,

    Any experience using spritesheets that you can adquire from authors?