Felixoo's Forum Posts

  • 8 posts
  • Maybe somebody can find an error in this:

    function Tick(runtime)
    {
    	const player = runtime.objects.Player.getFirstInstance();
    	const ground = runtime.objects.Ground.getFirstInstance();
    	if (player.testOverlap(ground)) {
    		player.y = 0;
    	}
    	
    }
  • Yeah, idk why it's not working. I even completely remade the project but it still didn't work. ):

  • Bro. This isn't working. I have 1 player obj and 1 ground obj. I'm placing the code under tick to happen every tick.

  • Remember I have never programed javascript in C3. Only in other platforms. LOL I'm not used to using JS in C3. lol sorry tho if I look dumb for trying.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, now I'm really lost. Can you please give me a code snippet or something of a basic collision test?

    And also, is it supposed to be kind of like this?...

    function Tick(runtime)
    {
    const player = runtime.objects.Player.getFirstInstance()
    const ground = runtime.objects.Ground.getFirstInstance()
    const sprites = runtime.objects
    	for(let i = 0; i === sprites.length; i++) {
    	if (sprites[i].uid === 2) {
    	if (player.testOverlap(ground)) {
    	console.log('Hit')
    			}
    		}
    	}
    }
  • I'm not sure if this is possible anymore. I think you use to be able to call a function by name, but now it's just call red or call blue, yadda yadda. Sorry bout that.

  • Hey there, I have been using javascript for about two years now and I just started using it in C3. I cannot get something to happen when two objects collide.

    const player = runtime.objects.Player.getAllInstances();
    const ground = runtime.objects.Ground.getAllInstances();
    	if (player.testOverlap(ground)) {
    	console.log('Hit')
    	}
    

    I don't know if I'm doing something wrong or it's just a typo but please help me.

  • 8 posts