Sign in to follow this  
mirage29

detect collision problem

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!!

Share this post


Link to post
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
            });

 

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.