I am writing a game on processing. When you press the LEFT key, the hero shifts a couple of pixels, then waits for a split second and only then continues to move.
void keyPressed(){ if (keyCode == LEFT) hero.pozx -= hero.v0; } Same problem:
void setup(){ size(200,200); } void draw(){ background(0,255,0); } void keyPressed(){ rect(100,100, 100, 100); }