Jump and boundries

could somebody please help me on how to:

make a character jump by using spacebar

make a boundry (character can go no further than a wall or something)

i really need ur help please=)