dop2000's Forum Posts

  • Why are you comparing BulletsOnScreen with Bullet.count? Bullet.count was supposed to replace BulletsOnScreen variable. So the condition should be something like Bullet.count>4

  • Yeah, the objects need to be on specific layers, make sure to check layer properties. And there are also some blend modes used. I don't remember the details myself to be honest :)

  • Check out this demo:

    howtoconstructdemos.com/visible-field-of-view-fov-in-a-top-down-game-like-a-flashlight-beam-capx

    This solution has many limitations (for example, you can only have one flashlight beam), but maybe you could use it in your game.

  • See the size of the sprite on your layout, not in the animation editor. It's (-32,32)

    The minus sign means that it's flipped. Just click "Make 1:1" in sprite properties to reset its size.

  • Not sure what you mean. But if you want to move an object with 8direction at a certain angle, you can use vectors.

    Variable a=20 // angle
    Variable s=100 // speed
    
    On every tick: 
     Player Set Vector X to cos(a)*s
     Player Set Vector Y to sin(a)*s
    
    
  • You can download the project from the video and compare it with your code.

  • Ok, seems like your task is pretty specific and you've found a good working solution for it. I've never had to program such complex buttons :) It's usually really straightforward - play an animation when touched, reset to default when released.

  • So, to clarify - as long as you keep the number of lasers on the screen below 5, you can fire a new laser at any time without any delay. But when there are 5 lasers, the gun becomes unavailable for 2 seconds. Is this correct?

    First, you can use PlayerBullet.count expression instead of BulletsOnScreen variable - this way you don't have to worry about updating this variable when a laser is created of destroyed.

    You can also use "Timer "Bullets" is running" condition instead of CanShoot variable.

    There is a mistake in your second event - "BulletsOnScreen>4" condition runs on every tick while it's true, so the timer is restarted again and again.

    I suggest you create a sub-event inside the event where the bullet is spawned. In that sub-event check if the PlayerBullet.count>4, and start the timer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I understood your task correctly, you can do this:

    If you have many button objects following the same logic, you can add them to a family and reuse these three events for the entire family.

  • I downloaded the project from the video description and it doesn't have that problem you are having. So you must have done something wrong, it's impossible to say what exactly from your screenshot.

  • I don't get it why you need all that complex code. "On Tap" event is specifically designed for buttons and it checks that the finger has not moved away from the initial location.

    Another alternative is to add a second condition to the "On Touch End" event - "Touch is touching Button".

  • There's likely a mistake in your code. Please post your project file or a screenshot of events.

    You can also check a few examples here:

    howtoconstructdemos.com/category/virtual-joystick

  • Cleaning just browser cache is not going to do it, I believe you need to clean all website data, including hosted app data.

    If it doesn't help, try a different browser, or opening C3 in a private tab.

  • Those are expressions. Every object in Construct has a bunch of expressions, I suggest checking them out, they are super useful.

    You can use "System Compare Two Values" condition for example. The first value being Player.BBoxBottom, and the second value Building.BBoxBottom

    Edit: actually in this case it's better to use "System Pick by evaluate" condition. First you pick all buildings which are overlapping the player, then pick buildings among them which have BBoxBottom>=Player.BBoxBottom

    ----+ Player: Is overlapping Building
    ----+ System Pick Building By evaluate (Building.BBoxBottom>=Player.BBoxBottom)
    -----> Building: Set opacity to 20
    
  • Thank you very much for the example. So depth translates to the different pages?

    It's up to you how you organize your data in table format. Pages may represent a parent object in JSON. (shops in my example above) I also often try to split big arrays into multiple pages, simply because it's easier to read and edit than one huge wall of numbers.

    And of course not all JSONs can be done this way, I have a few plain-text JSON files in my project as well.