Author Topic: collision args explanation please?  (Read 667 times)

GEEK

  • Jr. Member
  • **
  • Posts: 83
  • want to learn c++, if you want to teach me, pm me!
    • View Profile
collision args explanation please?
« on: 31. October 2013, 01:17:58 »
can anyone please explain how this works?

    sidecoll (x,y,w,h,dx,dy, rx, ry, rw, rh)

and what 'skip' means in this function:

    pixelcoll (image1,ax,ay,image2,bx,by,skip)

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 573
    • View Profile
    • Home of EGSL
Re: collision args explanation please?
« Reply #1 on: 06. November 2013, 15:29:54 »
Ok first sidecoll. Just assume you have one obejct at x,y with width w and height h. Another object is at rx,ry with width rw and height rh. Now what happens if the first object moves one (or more) pixels to dx (negative values are allowed) and dy. sidecoll tells you where the objects collide, if at all.
"Skip" in pixelcoll means how many pixels pixelcoll should skip calculating since it is a time consuming function. The more pixels you skip the more inaccurate the result is.
BTW, pixelcoll will not be possible in EGSL2, so better don't use this function if you want to port your games later.
Best regards,
Cybermonkey

GEEK

  • Jr. Member
  • **
  • Posts: 83
  • want to learn c++, if you want to teach me, pm me!
    • View Profile
Re: collision args explanation please?
« Reply #2 on: 06. November 2013, 18:26:29 »
ok, thanks for your help!