Hello Everybody.
i’m currently making a little sidescrolling jump and run game.
the “hero” should have different physical properties on user interaction.
in the game that looks like this:
when just touching the move interface (move buttons) it walks, driven by a motor joint with a high friction and density.
when touching the “slide” button in addition it should behave like sliding, or better rolling, on ice.
if the example above is confusing think of that:
normal behaviour is like super mario, if an additional button is touched the behaviour shall switch from a mario like behaviour to a tinywings like behaviour.
now my thoughts on implementing that:
a) modifying the densitiy and friction, but how i found out, that’s just possible within the addBody function, and can just be changed be readding the body, what could be very bad for the performance.
b) having 2 hero setups, and swapping them on user interaction. means, moving the “walking” hero out of the scrolling gameworld displaygroup, and just put it on a fixed position out of the screen. while putting the “sliding” hero into the gameworld displaygroup on the former coordinates of the “walking” hero. and vice versa.
both do sound complicated to me, so i was wondering if there is any better way to do this.
or if you have any suggestions.
on b) i wish i could just disable the one object, like setting isVisible to false, just for the physics bodies. without having to put it offscreen.
at the moment, i feel a little bit lost, what way i should go, and what won’t kill the performance.
cheers,
michael [import]uid: 11133 topic_id: 32861 reply_id: 332861[/import]
