Posts Tagged ‘capture detection

13
Feb
09

Global Game Jam – The Deep – Capture Detection

ii) In ‘The Deep’ game we have a string membrane that can contort into many shapes both concave and convex. I needed to be able to detect if a ‘plankton’ (or many) is within the membrane when the digest mechanism is triggered (the creature’s orbs touching together).

My method was to draw a shape using the membrane as a template. Fill the shape, then test the plankton to see if their coordinates are over the fill colour.

The Deep: Plankton Capture Detection

The Deep: Plankton Capture Detection

1) The creature’s orbs touch triggering the digest mechanism.

2) Using the vertices on the rope chain draw a shape.

3) Colour fill the shape.

4) Find the extents of the shape. Calculate the bounding box. Now check to see which plankton are within the bounding box. Take the coordinates of each of these plankton and test whether they have the fill colour at that coordinate. If so, then the plankton must be inside and is therefore digested. Points scored.

Again the source of the game can be found here.

Advertisement



Categories

Reasons to be Creative 2012

FITC Amsterdam 2012

Flash on the Beach 2011

Flash on the Beach 2010

Swingpants at Flash on the Beach

Flash on the Beach 2009

Swingpants at FOTB2009

Twitter Updates