Pixel Perfect Sprite Collision (bounding, Shape, & Pixel)

Started by kevin, June 09, 2005, 01:09:27 PM

Previous topic - Next topic

kevin

  Pixel Perfect Sprite Collisions In PlayBasic

 This demo shows how Play Basics Vector Shape Sprite collision mode can be used to get fast, pixel perfect collisions for any kind of sprite, including rotated & scaled sprites.  

 PlayBasics sprite system has provision for seven different collision types.  Those being Static Rect, Rotated Rect, Circular, Sliding,Sticky , Vector Shape and pixel perfect.    All types can be mixed together, ensuring you can find the right balance for your collision needs.  


Demo Controls:
==============

  Mouse Button = Scale Test Sprite
        F1 Key = Toggle Sprite Collision Debug Mode
        F2 Key = Change Collision Mode (Bounding Box, Shape & Pixel Perfect)
     Space Key = Hide Sprites
       Esc Key = Exit Demo

Download

Download PlayBasic Pixel Perfect Sprite Collision (bounding,Shape & pixel perfect) (login required)


kevin

#1
not after vector sprite collisions ?

well follow this link more info   Pixel Perfect Collision on Rotated/Scaled sprites in PlayBasic



Ian Price

Kevin, I've just tried to use the pixel perfect sprite code that you posted a while back, and I get a "Not enough parameters for the "compareSpritePixels" command. I'm using PB 1.46

The command in your code reads - CompareSpritePixels(spr,spr2)

I presume this has been updated, but I can't see the correct usage in your updates here.

What are the correct parameters now?
I came. I saw. I played some Nintendo.

thaaks

Ian, CompareSpritePixels(spr, spr2, precision#) where precision is a float between 0.0 (lowest precision) and 1.0 (highest precision). Kevin says 0.5 is good enough most of the time - I would just trust him  :D

Ian Price

I came. I saw. I played some Nintendo.

kevin

#5
or you enable SpriteCollisionMode 6

Ian Price

I came. I saw. I played some Nintendo.