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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.