shabu's Recent Forum Activity

  • hello everyone, sorry for my silly question, I've just started working with construct and scripting. I prefer to use scripting than the visual editor but I'm running into an issue in calling objects from script.

    runOnStartup(async runtime =>
    {
    	// Code to run on the loading screen.
    	// Note layouts, objects etc. are not yet available.
    	
    	runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
    });
    
    function OnBeforeProjectStart(runtime)
    {
    	// Code to run just before 'On start of layout' on
    	// the first layout. Loading has finished and initial
    	// instances are created and available to use here.
    	
    	runtime.addEventListener("tick", () => Tick(runtime));
    }
    
    function Tick(runtime)
    {
    	// Code to run every tick
    	jumpPowerBarRun();
    }
    
    var state = 0;
    var size = 0;
    
    function jumpPowerBarRun (){
    	if (state == 0){
    		//alert(" this is running");
    		console.log("jumpPowerBarRun ");
    		console.log(runtime.objects.JumpPowerBar.width);
    		//runtime.objects.JumpPowerBar.setSize(runtime.objects.JumpPowerBar.width - 5);
    		//size = size + 5;
    		//console.log(size);
    		
    	}
    }

    right now I'm just trying to print some info from the object to the console but I keep getting uncaught exceptions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
shabu's avatar

shabu

Member since 18 May, 2020

None one is following shabu yet!

Trophy Case

  • 4-Year Club
  • Email Verified

Progress

5/44
How to earn trophies