Waltan's Recent Forum Activity

  • There is "Is on ground" and "Is falling" conditions in "Platformer" behavior.

    Do it like this:

    If (Is NOT on ground)

    {

    if (Is falling) - set animation "falling"

    else - set animation "jumping"

    }

  • I made an .apk via CocoonJS, launched it on tablet and instantly got message saying that my app stopped working.

    Then I made completely empty project with only 1 sprite in it and same thing happend!

    I tested it in Intel XDK, it worked great, this means, that problem might be in:

    • CocoonJS Cloud Compilator
    • My tablet

    Can you help me to solve this problems?

    Try to launch this one (it's an empty project with 1 sprite compiled via CocoonJS) on your device and tell me what will happen.

    I also attached source file of this project, so, if you dont mind, try to compile it by your own way, so I could test it on my tablet and see if something wrong with it.

    .capx

  • Each time it is called in the "findpath" function, the for each XY element loops through the whole Path array. During that loop-through, every time the Else is triggered (which could be a lot, depending on how many "F" values it contains) it then calls the "findpath" function to run the for each XY element loop all over again... Which means it will run the for each XY loop as an infinitely self-triggering loop. I think... from looking at the event sheet.

    It contains 1 F value. There is no problem with XY loop, Im only getting error because of this else if I'm checking values in array's loop.

    For example, I have my base code (which is working pretty well), and there is no problem.

  • Hello, I'm just trying to make some pathfinding system, and I've got a problem!

    This is my function called "findpath". It does some actions and checkes if current array slot is finish point ( = "F" ). If its not ("ELSE"), then function must call itself and do this actions again and again, until it will get to the finish (there is always 100% way to reach finish point).

    But Im keep getting this error:

    Here is the line:

    Please, help!

  • PhoneGap - tiny apk size, but low performance

    CocoonJS - ok size (~8mb in kinda "empty project") and very good performance

    XDK - have not tried, I dont like this exporter

  • Oh, I discovered what the problem was.

    "Else" wasn't working as I expected to, I had to specify the animation.

    Did I miss meaning of "else" or it is an program's logic issue?

  • I might be wrong about this, but, if the canvas resizes, ViewportLeft might not always = 0.

    You could try making your own ViewportBottom. I think it would be something like scrolly + (WindowHeight/2). This might not work though if you are using a layer with a parallax of 0.

    But anyway, what is the problem with this logic? These viewports could take any values, but it must always display my button on a position I entered. Top works, Bottom is not, why?

  • I have some interface buttons. They are bounded to viewports values like this:

    Those, which lined with red color, adds some value to ViewportTop, and the green one substracts from ViewportBottom.

    Here is the code:

    (Layer #2 is an "interface" layer with 0 X and Y parallax)

    It works fine in default Construct 2 preview (without Fullscreen), but this is what I got on mobile devices (with Fullscreen on, of course):

    It is obvious, that ViewportLeft and Top are always = 0 in this case, so there might be no problems with adding some values to 0. Seems like there IS some trouble with substracting from ViewportBottom, which is always different, BUT ViewportRight is always different too, but it works well.

    I cant get what is wrong. Please help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • UPDATE: I just realized you said layer scaling, not layout scaling, which my original info referred to. Refer to the manual entry for touch. X and Y don't adjust for layer scaling/rotation/what have you unless you give it a layer as a parameter. For example:

    Touch.X(0)
    Touch.Y(0)[/code:2crfrhp9]
    Gives you adjusted touch coordinates for layer 0.
    
    As for the number length, you absolutely should not worry about that.  There's no extra work processing a high precision number like that vs. a rounded number, so long as internally they're stored as the same type(which they almost certainly are).
    

    Thanks alot!

  • Here is a gif, explaining what I mean.

    How do I adjust touch coordinates, to create these 4 colored blocks on correct positions considering the layer scale?

    Also, should I worry about long numbers like this one?

    How can I make it shorter? round() will round this number to 1 (because scaling takes value between 0, 1 and 2).

  • bump

  • Im using CocoonJS export for my Android game.

    When I tap "back" button on my tablet, system asks me if I want to exit. This happens on every layout.

    I want to change it.

    How do I get access to the system device buttons and change its actions? For example, to create my own in-game context menu, which can be called with "options" button, and returning to the previous layout with "back" button.

    Or maybe I can just turn it off?

Waltan's avatar

Waltan

Member since 5 Jul, 2011

None one is following Waltan yet!

Trophy Case

  • 13-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies