Tag Info

Hot answers tagged

8

Ducking ability could be: Ability to turn into a duck, for a disguise or for duck related beak attacks. Ability to swim like a duck, enabling escape across water. Ability to quack like a duck, stunning the hero's enemies. Ability to lay eggs like a duck, perhaps with treasure inside. Ability to talk to ducks for duck related conversation, or command them ...


5

What you are asking about is called acceleration. Easing out and easing in. It is achieved by computing the elements current speed before you move it. The simplest way to do that if your goal is only smoothness in motion is to use acceleration. You do this like this (pseudo code): p.x = 10.0; // Current character position. v.x = 0; maxV.x = 1.0; // Inset ...


4

What you're looking for is some dampening function, i.e. friction with the table. Dampening is actually a rather easy function: v *= factor; Where factor is a number between 1 (no dampening) and 0 (immediate halt). The actual number for factor depends on your surfaces. For example, 0.99 could be ice, 0.9 could be some grass, 0.8 could be sand. You'll ...



Only top voted, non community-wiki answers of a minimum length are eligible