Get a single or specific collision point

JeffreyDriver

  • Posts: 1667
I'm trying to make an object move along a rail. Physics does part of what I want, but I need to be able to retrieve data from tiles. How would I just get the data for a single collision point that's closest to the centre of my actor? Any thoughts?
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

squeeb

  • Posts: 1276
http://community.stencyl.com/index.php/topic,27769.0.html
there is a block distance between actor and actor... not sure if itll help with what you need

JeffreyDriver

  • Posts: 1667
Thanks, but not quite what I'm looking for. I think I'm near to getting it sorted though.

See below for what I'm doing. Anyone have thoughts on how they'd approach it?

<a href="http://static.stencyl.com/games/38826-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/38826-0.swf</a>
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

merrak

  • *
  • Posts: 1892
There's a block in the collisions palette that lets you loop through all the collision points. You can then find the point closest to the center of the actor by computing the distances from each point to the center.

See below for what I'm doing. Anyone have thoughts on how they'd approach it?

I'd just make the cart heavier. What you have now looks more realistic to me. A real cart wouldn't be glued to the track--it'd be heavier, though, and wouldn't fly nearly as high. If you're using Box2D then I'd suggest sticking to physics solutions and working within the parameters of the model as much as possible.

JeffreyDriver

  • Posts: 1667
Thanks. I've solved the issue by using weight and adjusting the speed according to the angle on the slope.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk