"ok" is technically spelt "OK". It's really just two capital letters put next to eachother to make a word (there are a few words out there that require a capital letter to spell it correctly).
I've been unable to work on this scenario recently because I've been extremely busy, the Greenfoot editor is now blocked on my computer, and I'm sleep deprived (mainly because I have an after school activity that takes up like 2 hours followed by homework)... so... first world problems. :/
Wouldn't it be better to use the arrow keys instead of the number keys? You just type "left" and similar. So something like.
[code]
if (Greenfoot.isKeyDown("left"))//Whatever changes gravity here.
[code/]
I made an entire scenario on this mechanic actually. It's hit detection doesn't allow the object to glitch into the walls too. It alligns itself into the object it's hitting so it doesn't move into it.
http://www.greenfoot.org/scenarios/9172
2013/11/26
Adventure
2013/11/22
Mandelbrot set
2013/11/22
Megaman EX (Alpha 3)
2013/11/22
Megaman EX (Alpha 3)
2013/11/18
Megaman EX (Alpha 3)
2013/11/18
Hidden Picture
2013/11/18
3D engine preview
2013/11/18
3d house demo
2013/11/15
Gravity Demo