class Word { public String txt; public int count = 1; public float x,y; public float px,py; //previous public float fx,fy; //friction Word(String txt) { this.txt = txt; this.x = width/2; this.px = width/2; this.y = height; this.py = height; this.fx = .05; this.fy = .05; } void moveTo(float x,float y) { this.x+=(x-px)*fx; this.y+=(y-py)*fy; px = this.x; py = this.y; } int getX() { return int(x); } int getY() { return int(y); } }