[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] The Giant - 'cool project I'm working on now' - thread.



On Sat, Aug 9, 2008 at 7:36 PM, Michael George <mdgeorge@xxxxxxxxxxxxxx> wrote:
> Knapp wrote:
>
> Easy fix, more than one sprite.
>
>
> I don't see how to generalize this though.  In general the box isn't a box,
> but maybe a collection of four objects making up the walls, that the user
> placed there.  And the objects that they might want to drag into the box
> could be different sizes.  Where do these sprites come from?  What would it
> look like in the following example, for instance?
>
>
> Pixel perfect collision project. If you need more speed, I bet someone
> would C code it for you. I have not tested it out.
> http://www.pygame.org/projects/9/207/
>
>
>
> I've played with that before.  It's pretty cool.  But the problem isn't
> collision detection, it's response.
>
> Circles is really cool. What does vectors do?
>
>
> Thanks, hopefully it shows you what I'm going for, only with polygons as
> well as circles (and maybe polyarcs).  Vector is just support code for the
> circles stuff.
>
> --Mike


So based on that picture you want to pick up the circle and then drop
in between the other ones? Then check when the drop happens that it is
not touching the others?
If that is right then all you have to do is have them down mouse click
on the object to be moved and while the button is down don't check
anything. When you get an up mouse button then check to make sure the
place is ok (not touching anything else, pixel collision would do
this.). If not the object snaps back to the starting place.

If you want to move it down paths (IE never let it bump anything) then
you look for collision at all times. If there is one you find out with
what, if you care, and undo the previous delta.


-- 
Douglas E Knapp

http://sf-journey-creations.wikispot.org/Front_Page