Alyra Games's Recent Forum Activity

  • You have to use the viewport. But I don't exactly now how to do this. Or maybe the window width/height operators.

  • A better way to achieve this would be to check the objects coordinates.

    If objects X<=object.width the object is on the left side

    If objects X>=layout width - object.width // the object is on the right side

    If objects Y>=object.height // the object is on the top side

    If objects Y>=layout height - object.height // the object is on the bottom side

  • You should use the Edit function instead of quadruple-posting.

  • Just create the timer on start of the layout.

    Then use "set timer" and "on timer", instead of "if destroyed".

  • I think the issue is on "add" 0.5 to DoubleTouchTime. You have to set it. Because On any touch is like every tick i think. It will add it maaany times if you touch.

    Do you have to create the timer on tap? What if you already had one and just use the set timer event on tap?

  • I'm trying something similar. What I do is:

    On every tick:

    • set scale of object to: object.Y/600

    This code will scale objects smaller as they are in the background and scale them bigger as they are in the front. You have to adjust the 600 to what looks best for your objects.

    Instead of every tick you can use if the object moves. This would save performance. I didn't optimise my code yet.

  • 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.

Alyra Games's avatar

Alyra Games

Member since 13 Feb, 2014

None one is following Alyra Games yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies