How to detect if the area was 100% painted in as3

前端 未结 3 1285
青春惊慌失措
青春惊慌失措 2020-12-11 23:46

I´m making a game that simulates an industry of pan, and one of the process is Painting.

What I want to do is to let the player paint the pan, but i don´t want it to

3条回答
  •  一个人的身影
    2020-12-12 00:15

    Your essentially dealing with a collision detection problem. From looking at their API you could try something like a for loop with getColorAtPoint and try to determine they have drawn at each pixel.

    If all else fails look into collision between the objects the library generates using the .hitTestObject method of an object.

    See this: http://sierakowski.eu/list-of-tips/39-collision-detection-methods-hittest-and-hittestobject-alternatives.html

    And this to see how someone handles collision with pixels: http://www.emanueleferonato.com/2010/08/05/worms-like-destructible-terrain-in-flash-part-2/

提交回复
热议问题