Hot answers tagged

1

float Timer = 2f; float TIMER = 2f; float StartVelocity = 10; float EndVelocity = 0; void Update() { float elapsed = (float)gameTime.elapsedSecondsOrWhatever; Timer -= elapsed; if (Timer < 0) Timer = 0; velocity.Y = MathHelper.Lerp(EndVelocity, StartVelocity, Timer/TIMER); }


1

I finally succeeded to get rid of this behaviour. (Thanks @Jon !) "Don't let the snake change its direction if it heads backward from its current heading. " It actually works :) Example with 'Up' Direction : int X = _snake._parts.Last().X; int Y = _snake._parts.Last().Y; if (newDirection == Direction.Haut) { Rectangle test = new Rectangle(X, Y - ...



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