All pastes #101630 Raw Edit

Mine

public text v1 · immutable
#101630 ·published 2006-07-27 01:06 UTC
rendered paste body
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;
                
        }