Push actors without loosing speed.

Hey guys - I'm currently prototyping a puzzle game where you control an actor (call him hero) than can move around the screen aligned to a grid - trying to get certain items that are on the grid. I'd like to place movable obstacles in their way. Is there a way for the hero to simply push obstacle along the same path? For the game to work the hero needs to say aligned to the grid (otherwise it can't reach the items)

Currently when I try to do this the item gains a constant velocity and slowly moves off the screen, whilst the the hero's speed is decreased, meaning it is no longer aligned to the grid.

My current system for movement is interpolates. Simplified it would be
When hero touched, interpolate self.x to new.self.x (which is self.x +100)

This works fine when there are no items in the way, and means the hero stays aligned to the grid. However, when an item is in the way it essentially slows down the hero, so instead of moving 100 pixels to the right it'll end up only moving half that before stopping. I had assumed that the interpolate would continue firing until the condition was met, but it seems it only works for the time set in the behaviour, after which it fails, even if it hasn't reach new.self.x

I've played around with the physics settings on both the hero and the item but can't seem to get this to work. Am I missing something obvious, I'm assuming there's a better solution than interpolate position but I can't think of it?

Sign In or Register to comment.