To cheat in Portal, first go to the Options Menu and enable the console. Once it is enabled, hit the "~" key. This will open the console, which is where the codes can be entered. Entering god enables invincibility, noclip allows the player to travel through objects, antiportal allows the player to create portals in nonportal areas, gotolevel Z with Z being the level number allows the player to skip to that level, gravity Z with Z being the gravity level, causes the gravity to change to the number entered.
You woke up in a very strange location and your task is to find your way to the exit door, and go through it, alive! The Portal Flash Version includes over 40 challenging, portals thinking levels, which features almost every feature the real game does, in 2d - energy balls, cubes, turrets and even the famous crusher from the trailer.
The game also includes a console to mess around with after finishing the game (~ KEY opens up console). Use "A", "W", "D" KEYS to move around. Use YOUR MOUSE to aim and click LEFT MOUSE BUTTON to launch a portal (alternatively you can use "Q" KEY to launch a blue portal and "E" KEY to launch a yellow portal). Hit "R" KEY to close both portals, "F" KEY to pick up an object. Good luck!