dop2000's Forum Posts

  • Simply add another condition to your "Button on click" event: "Button is visible"

  • You do not have permission to view this post

  • Use Timer behavior.

    Or you can create an instance variable TimeLastHurt and do this:

  • So to my understanding, I should continue reducing them in layout to keep that sharp look for both small and large screens?

    Yes, if you don't mind using more memory.

    Also, some images (pixel-perfect, vector graphics) may visibly lose in quality when resized in C2.

    Returning to my example from the previous comment - on 1080p screen the second image with 250x250 original resolution may look slightly better, than the 500x500 image scaled down to 50%.

  • I think this is true if you want your images to look better on a higher resolution screen.

    For example, let's say you make your game for 1080p screen and put two identical images on the layout - one is 500x500px resized down to 250x250px (resized on layout), another 250x250px (real image size).

    On a 1080p screen both images will look the same.

    On a 4K screen the first image will look slightly sharper than the second.

    But it will also use much more memory.

  • I think the best practice is to target one screen resolution (high enough, but not crazy high) and prepare all images for this resolution.

    So you export images in the correct size from some external program, import to C2 and use them without resizing.

    When you scale down images in Sprite Editor, you reduce their quality.

    When you scale down images on the layout, you also reduce their quality and wasting video memory.

  • Also, you should post this in "How do I.." section of Construct 2 forum.

  • You have all the correct events, but they are in wrong places.

    First event should have two conditions:

    Crate HP<=0 : Crate start animation "Break"

    Trigger once

    Second event should also be top-level (not a sub-event):

    Crate on animation "Break" finished : Start fade

    However, this code may not work correctly if you have multiple instances of Crate object, because "Trigger once" doesn't work per instance. As long as one crate has HP<0, this event will not get triggered for other crates.

    So I suggest you change your code to this:

    Crate HP<=0                                : Crate start animation "Break"
    Crate animation "Break" NOT playing
    
    Crate on animation "Break" finished        : Start fade
    [/code:1rihlvf3]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you sure your array contains any data when this function is executed?

    I suggest running your game in Debug Mode (Ctrl-F4) and check everything.

    If you still unable to solve this, please share your capx.

  • Set Type=numbers in TextBox properties.

    To limit the number of characters to 2:

    TextBox On Text Changed -> TextBox Set text to left(self.Text, 2)

    Also, see Tutorials section, there are lots of helpful examples on how to customize texboxes:

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

  • Have you tried running the game in Debug Mode? What are the numbers for FPS, CPU, images memory usage?

    Try removing big portions of these grass sprites from the layout and see if FPS/CPU usage improves. Try deleting the entire grass object, disabling different event groups etc, and see what's affecting the performance the most.

  • There is an easy way to do this which is used in many games.

    Add Flash behavior to the player. When biker is hurt, start flashing for 1-2 seconds.

    Add another condition "Is not flashing" to the event. This way while the biker is flashing, it's invulnerable.

    Or you can do this with Timer behavior. Set a variable IsInvulnerable=True, start timer. On Timer event, set IsInvulnerable=False.

  • 1. Use punctuation (stops, commas, question marks). Your message is a mess and it's hard to understand you.

    2. Clearly explain your problem and your question.

    3. Share your code or capx file.

  • You don't necessarily need to add Solid behavior to objects for Pathfinding to work. Pathfinding behavior allows to add custom obstacles.

    Also, check out this addon:

  • See this post:

    Or you can style if with CSS, search Tutorials for examples.