tk.yAcceleration = -10; tk.customFunctions += new customFunction(BounceBehavior); jumping = false; public void Activity() { if (inpMan.KeyDown(Key.Left)) { tk.xVelocity = -6; } else if (inpMan.KeyDown(Key.Right)) { tk.xVelocity = 6; } else tk.xVelocity = 0; if (inpMan.KeyPress(Key.Space)) { if (jumping == false) { jumping = true; tk.yVelocity = 5; } } } public void BounceBehavior(Sprite sprite, SpriteManager sprMan) { if (Collisions.rectCollisionAllowanceMove(sprite, groundSprite)) jumping = false; }