Browse Source

Visitors and Terrain

Supermaniac101 10 years ago
parent
commit
8219cb2a75

+ 7 - 1
src/gui/simulator/Terrain.java

@@ -242,7 +242,13 @@ public class Terrain extends JPanel {
                 	//if object selected, scale object
                     if(object.contains(clickPoint)){
 						double oldscale  = object.getScale();
-						object.setScale(object.getScale() * 1 + (e.getPreciseWheelRotation()/10.0));
+						if(oldscale < 0.3){
+							if((e.getPreciseWheelRotation()/10.0) > 0){
+								object.setScale(object.getScale() * 1 + (e.getPreciseWheelRotation()/10.0));
+							} 
+						} else {
+							object.setScale(object.getScale() * 1 + (e.getPreciseWheelRotation()/10.0));
+						}
 
 						//intersect
 						for(DrawEngine draw: entities){

+ 6 - 1
src/gui/simulator/Visitor.java

@@ -23,7 +23,12 @@ public class Visitor {
 	public Visitor(Point2D positie) {
 		this.positie = positie;
 		this.rotation = 0;
-		this.speed = 1;
+		double number = Math.random()*2;
+		if(number < 1){
+			this.speed = 1;
+		} else {
+			this.speed = number;
+		}
 		this.target = new Point2D.Double(0, 0);
 	}
 

+ 1 - 1
src/gui/simulator/WalkingPath.java

@@ -56,7 +56,7 @@ public class WalkingPath {
 		}
 	}
 	public void paint(Graphics2D g2){
-		g2.setStroke(new BasicStroke(20,BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
+		g2.setStroke(new BasicStroke(40,BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
 		for(int i = 1; i < getPath().size(); i++){
 			g2.setPaint(new TexturePaint(texture, new Rectangle(0,0,100,100)));
 			g2.drawLine((int)get(i-1).getX(),(int)get(i-1).getY(), (int)get(i).getX(),(int)get(i).getY());