public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
        input = container.getInput();
        GameState state = game.getCurrentState();
        if (!(state instanceof World)) return;
        
        prevVelocity.set(velocity);
        
        invMass = 1F / size;
                        
        edgeLength = (float) Math.sqrt(size);
        x1 = x - edgeLength / 2;
        x2 = x + edgeLength / 2;
        y1 = y - edgeLength / 2;
        y2 = y + edgeLength / 2;
        
        prevX = x;
        prevY = y;
        
        velocity.add(force.scale(invMass));
        force.set(0, 0);
        
        x += velocity.x;
        y += velocity.y;
        
                
        float speed = 100F;
        
        if (playerControlled) {
            Vector2f inputV = new Vector2f();
            
            input = container.getInput();
            if (input.isKeyDown(Input.KEY_UP)) {
                inputV.add(new Vector2f(0, -1));
            }
            if (input.isKeyDown(Input.KEY_DOWN)) {
                inputV.add(new Vector2f(0, 1));
            }
            if (input.isKeyDown(Input.KEY_LEFT)) {
                inputV.add(new Vector2f(-1, 0));
            }
            if (input.isKeyDown(Input.KEY_RIGHT)) {
                inputV.add(new Vector2f(1, 0));
            }
            
            inputV.normalise();
            inputV.scale(speed);
            
            force.add(inputV);
        }
        
        velocity.scale(0.95F);        
    }