Jump to content

Change collision detection method.


shrujan
 Share

Recommended Posts

Hi All,

 

I am currently experimenting with your game Flying Dog and had some issues with it.

 

1: Is  it possible to change the image of the barrier in the game with the one attached with this post and change the way the collision is detected so as to ignore the transparent area in the image rather than finish the game as soon as the flying dog collides with the image? 

 

2: Is it possible to change the background color of the game with an image.

 

 

Thanks in advance

 

 post-9215-0-08927900-1403007652.png

Link to comment
Share on other sites

1. If you want to use complex shapes like shape attached in post above you have to use p2.js physics engine instead of physics engine which is part of Panda framework. Panda physics supports only bodies with basic shapes like rectangle and circle. And also only basic body collisions. 

 

Here is thread about p2.js physics plugin for panda

http://www.html5gamedevs.com/topic/4591-p2js-physics/

 

and doucmentation for p2.js

http://schteppe.github.io/p2.js/docs/classes/Shape.html

 

2. Yes, you can add image background as Sprite or TillingSprite and extend it with parallax effect if you want. But if you have only one colour background is better set scene property backgroundColor to some colour.

 

http://www.pandajs.net/docs/classes/game.TilingSprite.html

http://www.pandajs.net/docs/classes/game.Sprite.html

http://www.pandajs.net/docs/classes/game.Scene.html#property_backgroundColor 

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