dop2000's Recent Forum Activity

  • I never imagined something so simple would be so complicated.

    I've been using Construct for many years, and this is probably the first time I've seen someone ask this. In 99.99% of cases, people want to scale the game while preserving the aspect ratio.

    Anyway, here's a simple way to recalculate the mouse position:

    function OnPointerMove(e, runtime)
    {
    
    	const w = window.innerWidth;
    	const h = window.innerHeight;
    	const layerX = e.clientX * (1920/w);
    	const layerY = e.clientY * (1080/h);
    
    	const sprite = runtime.objects.Sprite.getFirstInstance();
    	sprite.x = layerX;
    	sprite.y = layerY;
     
    }
    
  • The screenshots don't help much. You probably have other events which override the animations.

    I've also discovered that the animations dont even finish, like when you use a light attack within the second area, it fails to finish it.

    There's almost certainly some other event which sets a different animations in the same tick. That's why the animation is restarted all the time and never finishes.

  • even if it distorts the game slightly.

    I don't think it's a good idea. What if someone runs your game on an ultrawide monitor?

    To scale preserving the aspect ratio - use "Scale Outer" and enable "Unbounded scrolling" on the layout. No code needed!

    Here is a demo:

    dropbox.com/scl/fi/nlcnbsjne5ae9p90lixzf/ScaleOuterDemo2.c3p

  • Scale outer cuts the image, parts of the display are not shown in many situations

    It doesn't cut anything, you are probably not using it right.

    Can you post an image of what you are trying to make, or a demo project?

    Perhaps what you are looking for is the "System Set Canvas Size" action? It has the same effect as changing the viewport size in project properties.

  • Can you post your project file, or at least some screenshots of your code?

    Make sure the new position of the character is within the layout bounds - make the layout bigger if needed. Some behaviors (like Pathfindind) won't work if the object is outside of the layout.

  • I have no idea what your code does. I asked ChatGPT and it said "The code breaks Construct's input system by stretching the canvas with CSS instead of resizing the internal render size."

    Why don't you use the built-in "Fullscreen mode" setting? The most popular option is "Scale outer", it properly fills the entire viewport.

    construct.net/en/tutorials/supporting-multiple-screen-17

  • Your timescale is 0, that's why the Flash behavior is paused.

    You have a condition "if layer 4 is visible -> set timescale to 0", make sure you reset the timescale back to 1.

    I suggest using layer names instead of numbers, this way if you remove or add any layers, you won't have to change their numbering in your events.

  • Your link shows "Access denied".

    You can run your game in Debug Mode (Shift+F4) and check yourself what happens with the sprite.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • From what I've learnt the picking algorithms vary depening what you do in you function and if you use "for each" loops.

    I don't think that's true. As I wrote in my previous comment - picking the array instance should be the first condition!

    Pick, then loop through the array. It doesn't matter if you use "for each X" or a system "for" loop. And you don't need to pick the array again inside the loop.

  • You need to provide some details and/or share your project file.

  • The entry condition for the loop are "for each X element" and "ArrayName" = passed name argument from function

    ArrayName check should be the first condition!

    Did you set the ArrayName value correctly for each array? You can check this in the Debug Mode.

    Since every array object has only one instance, you don't really need the instance variable. You can just pick by array UID:

  • What?? That's incorrect. You need to delete records in a loop, in reverse order.

    For "n" from array.width-1 to 0
    Array.at(loopindex)=""
     ----> Array delete index loopindex from X axis
    
dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 280 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies