Felixoo's Recent Forum Activity

  • 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. ):

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

Felixoo's avatar

Felixoo

Member since 11 Oct, 2020

Twitter
Felixoo has 11 followers

Trophy Case

  • 4-Year Club
  • x3
    Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x3
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

9/44
How to earn trophies