Alyra Games's Forum Posts

  • I would use a 1D array. Each value containing the ID of the question.

    Setting up the array:

    On start of layout

    -array for each element X

    -set X value at array.CurX to array.CurX

    Choosing a random question:

    question=round(random(array.width))

    if question=0 ... array delete index 0 on X axis / set text "Question one?"

    if question=1 ... array delete index 1 on X axis / set text "Question two?"

    if question=2 ... array delete index 2 on X axis / set text "Question three?"

    if question=3 ... array delete index 2 on X axis / set text "Question four?"

    And so on. You delete each question out of the array because you don't want it to appear more than once.

  • No Problem.

  • Aphrodite

    Good to know. I wondered if such an operator existed.

  • For inventories arrays are the way to go.

    A 1D array should be enaugh. If your inventory has 100 slots, then the width of the array would be also 100. If the character picks up one item it's ID will be stored in the first emtpy array.

    Then you have to make a array-"for each element" for drawing all the items, if the user opens the inventory.

  • Maybe there is an "easier" way for this. But I don't know a better solution, as this is already simple if you dont have hundrets of cases to check.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you post a screenshot of this code lines? It would be easier to understand where the issue is.

  • What do you mean by "relative"? Do you mean in front of it? Or should sprite01 keep the angle, distance and everything else relevant to sprite02 if it moves?

  • You need to make an "Or" Block.

    Then it looks like:

    AnimationFrame = 0

    OR

    AnimationFrame = 4

    OR

    AnimationFrame = 8

    ... and so on.

    Right click the condition, then choose "make OR block".

  • Sure. Make a new event, doubleclick your object and search for the "set position" command.

    Then set the X and the Y value to the X and Y values of your start position. Do you use variables or an object for your start position? Or do you just place the object in the layout editor?

  • ryackov

    I trust you.

    Aphrodite

    Thank you for trying it out. But this was not exactly what I had to do. I had to completely delete the local number (in your case) "value" and replace all parts where it had been with the new variable. In your case "otherValue". The same procedure for all 10 variables.

    Oh... I think I now got what you did... . You just dragged the variable out of the group and it automatically changed to a global variable? oO

  • Mobile browsers also have bad performance. So the use of a wrapper is from benefit.

    For the first touch you can simply make a "push to start" message on the title menu.

  • This is true but it would have deleted all code which has this variables as references (so the whole function). I had to manually change each variable name to the new, global ones. x(

  • I know how to use variables, but thanks.^^

    The huge block of code already was in a (complex) function. I first used local variables to safe ram but then realised, that I needed global variables instead. Because no other event could acces that variables. It was a careless mistake but this can happen if you are not an experienced programmer. And this is constructs target group.

    So it was just a suggestion as it would sometimes make things easier, if you make a mistake.

    jhice The calendar should calculate whether the woman does not want sex. Because if she doesn't want to, the calendar could lie on her boyfriend, that she has her period.

    And the calendar should consider whether the woman takes the pill. Because the pill makes the period very precise. The calendar could also remind the woman every day, if she has not her period, to take the pill.

  • Hello I would have a feature request.

    I spent about 1-2 hours today by replacing variables in complex blocks of code by new variable types.

    Example:

    x0+x1+x2+x3... (setting up huge blocks of code involving variables)

    ,,Oh wait, this does not work. I have to use a global variable. Or a local one instead. Or maybe better to use an instance variable. Oh noes I have to change hundreds of lines of code which contained the old variables. D:"

    This was the scenario I had about 2 times today. It would be really usefull if construct had a feature which would allow the user to replace a variable and all it's references with a new one. Or a feature to find and replace specific peaces of code in an event sheet.