JavaScript code line freezing all lines after

Not favoritedFavorited Favorited 0 favourites
  • 3 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Pictures show all code in script file.

    Code in image below shows only a black screen when started up.

    Code in image below shows the layout and all in it, but no code under Player = runtime.objects.Player = getFirstInstance(); works when started up.

    Code in image below runs the if statement in function Tick(runtime) and changes text in layout when started up, but any code under Player = runtime.objects.Player.getFirstInstance(); still does not run

    the object "Player" is a sprite and exists within the layout.

    The script file has the "Main Script" purpose.

    I tried changing the "Player" objects name to something else and the same things would happen.

    I noticed I forgot to define some lines as variables, but defining Player = runtime.objects.Player.getFirstInstance as a variable or constant did not change anything.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I vaguely remember encountering something like that a while back and it was because "Player" was some reserved thing. But iirc it only happened on export.

    Maybe try

    Player2 = runtime.objects.Player.getFirstInstance()
    

    Otherwise it's hard to say what's going on. Any errors in the console? Ideally you can post your project with everything removed that doesn't cause the bug.

  • If you get a black screen, press F12 and check the browser console for any errors. You might have made a coding mistake and the error might tell you what it is. It's difficult to help from just screenshots - it's much quicker and easier to help if you share a project file.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)