dop2000's Forum Posts

  • klabundee in his example doesn't compare time or speed, which means if you move your finger really slowly across the screen, it will still be recognized as a swipe.

    I would do something like this:

    On any touch end

    Touch.speed>200

    ....Touch.Angle between 60 and 120 -> Move character down

    ....Touch.Angle between 150 and 210 -> Move character left

    ....Touch.Angle between 240 and 300 -> Move character up

    ....Touch.Angle between 330 and 30 -> Move character right

    For more strict swipe recognition you might want to check if the time between touch start and touch end is less than, say 1 second.

  • Ashley

    Sorry, I meant Debug preview. (in Chrome)

    It's not a big deal actually, as I'm using the Desktop build where Ctrl-F4 works. If only Ctrl-W were also working...

  • No, like this:

    It would actually make more sense to move this code to a separate event or function, and call it when some Unit parameters are changed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Banatawa

    Use random(151) - this will return a number from 0 to 150.99999999999

    So you if you want to round it to the nearest integer:

    round(random(151))

  • I suggest you start with some tutorials:

    https://www.scirra.com/tutorials/all

    Here is one about saving/loading game progress:

    https://www.scirra.com/tutorials/526/ho ... -savegames

  • You do not have permission to view this post

  • I guess you can use something like this:

    System-> compare two values -> CSV.At(row, column)=""

    or

    System-> compare two values -> int(CSV.At(row, column))=0

  • This is not a bug.

    You need to wait 1 tick before picking newly created objects.

    Also, you need to put "StatText ID=Unit.UID" inside the "For each Unit" loop.

  • You do not have permission to view this post

  • This can't be done with variables.

    You can do this with dictionary keys.

  • Are object1 and object2 really different objects? Or are they two instances (copies) of the same object?

    With two different objects there should be no problem accessing their instance variables in the same event.

    If they are two instances of the same object, then there is a trick you can use -

    say you have a sprite Circle. Create a family CircleFamily with just this sprite.

    Then change your event to this:

    Circle overlapping CircleFamily ...

    Inside this event you will be able to access both instances that are overlapping - one using "Circle" name and another using "CircleFamily".

  • I've never had such issues. Have you tried a different browser?

    One possible explanation that comes to mind - you can access Touch properties (X, Y, acceleration, angle etc.) only when the screen is actually in touch. Or if you are using mouse to emulate touch - when the left mouse button is pressed.

    So, for example, this code will not work, because Touch.X,Y will become 0 after the wait:

    On tap gesture -> Wait 0.1 seconds ; Set Sprite position to Touch.X, Touch.Y

    When you are using Mouse plugin, you can track mouse X,Y all the time, no need to press any buttons.

  • You might need this plugin:

  • Interesting..

    I think this happens because the original instance of the sprite doesn't exist anymore after the Wait 0, so you can't access any of its properties. (even the "Count" expression)

    It works if you add "Pick all Sprite" event after the Wait.

  • Try this:

    "parent.test('" & currentPlayer & "', " & totalScore & ");"

    So the resulting string will look like this:

    parent.test('John', 1500);