Jump to content

detect collision problem


mirage29
 Share

Recommended Posts

Hi,I am Taiwanese,Pandjs is so good.

My English is poor but I have a problem.

 

I do this example - collision handling in this page.

 

http://vermeire.home.xs4all.nl/panda/index.html#

 

 

I copyed full code in my js and used my pic then runed.

but the collision not work!They through each other!

 

http://imgur.com/wnP0jh9

 

Why?Plz help me!!

Link to comment
Share on other sites

thanks Phempt.

 

Now I Solved it!

 

The example code has worng.

 

  1.         this.body = new game.Body({
                position: { x: x, y: y },
                velocityLimit: { x: 150, y: 150 },
                velocity: {x:-100,y:-50},
                collisionGroup: 1,
                collideAgainst: 0,
                mass: 0
            });

 

to

 

  1.         this.body = new game.Body({
                position: { x: x, y: y },
                velocityLimit: { x: 150, y: 150 },
                velocity: {x:-100,y:-50},
                collisionGroup: 1,
                collideAgainst: [0],
                mass: 0
            });

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...