Alyra Games's Forum Posts

  • Would you please use the google translator so we can understand you?

  • I would simply use a 2D array.

    The X row contains all the item information: price (X0), Infotext (X1), satiety (X2), etc.

    The Y row stands for each individual item.

    Example:

    .........X0..........................X1...............................................X2

    Y0......5............."This is a cool Item"..................................5

    Y1....14,99......"This is an even cooler Item"...................10

    Y2.....20......."This is the item you ever wanted".............15

    You than make a "for each Y element" array-loop, for creating the sprites and text. Set their sprite to array.CurY (this is the Y position of each item in the array and simultaneously the ID).

    You only need 1 sprite object (with all frames for all items) and 1 text object for all items.

    Edit:

    For the drag & drop I would do something like this:

    If object is overlapping the background of the shop menu

    • on key press: activate drag & drop behaviour
    • on key release: deactivate drag & drop behaviour
  • My fault I mean on the right side where the commands are.

    I attached a picture showing how I meant it. But if it works now, than its ok.

    It would look like this:

  • No problem. Good to know, thanks.

  • What do you want to do and what does happen instead?

  • I have an idea. I could safe the last angle, before I set the angle to 0°, in a variable and before I start the sine behaviour again set it to this angle. But this is dumb.

    Maybe anyone has a solution for this.

  • Hi.

    I use the angular sine behaviour to make some of my objects look like they wood walk. If they arrive the path I deactivate the sine movement and have to set the angle of the object to 0, because otherwise it won't be on a correct angle. If it then moves again I reactivate the sine movement. But this time it will get out of step and it does look weird.

    Before this issue I did not set the angle to 0 and the objects keeped slightly skew. But the sine movement kept looking correct all the time. So the issue has to be with the angle modification. How can I reset the sine angle? I think it safes where its angle was before and if I change this angle manually it will not look correct anymore.

    Thanks

  • This would be window.width.

  • I searched for viewport an found this: https://www.scirra.com/manual/28/layer

    layer.viewLeft

    layer.viewRight

    layer.viewTop

    layer.viewBottom

    This are the commands. So I assume instead of layout width it would be layer.viewRight .

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.