|
|
@@ -29,6 +29,7 @@ import java.awt.geom.NoninvertibleTransformException;
|
|
|
import java.awt.geom.Point2D;
|
|
|
import java.awt.geom.Rectangle2D;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.ConcurrentModificationException;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.LinkedList;
|
|
|
@@ -50,7 +51,7 @@ public class Terrain extends JPanel {
|
|
|
private WalkingPathArrayList paths;
|
|
|
|
|
|
private Point2D oldPosition, lastClickPosition,lastMovedMousePosition ;
|
|
|
- private double oldRotation, oldScale;
|
|
|
+ private double oldRotation, oldScale, night;
|
|
|
private DrawEngine dragObject, selectedObject;
|
|
|
|
|
|
private Sidebar sidebar;
|
|
|
@@ -412,6 +413,8 @@ public class Terrain extends JPanel {
|
|
|
g2.fill(this.selectedObject.getAffineTransform().createTransformedShape(this.selectedObject.getRect()));
|
|
|
g2.setTransform(oldTransform);
|
|
|
}
|
|
|
+ g2.setColor(new Color(0,0,0,(int)night));
|
|
|
+ g2.fill(new Rectangle2D.Double(0,0,festivalwidth,festivalheight));
|
|
|
g2.setClip(null);
|
|
|
}
|
|
|
|
|
|
@@ -460,6 +463,11 @@ public class Terrain extends JPanel {
|
|
|
visitors.add(new Visitor(new Point2D.Double(-100-Math.random()*200, getFestivalHeight()-Math.random()*getFestivalHeight()), startpoint, this));
|
|
|
}
|
|
|
topbar.recalculate();
|
|
|
+ if(topbar.getTime().get(Calendar.HOUR_OF_DAY) > 20 && topbar.getTime().get(Calendar.HOUR_OF_DAY) < 25){
|
|
|
+ setNight(night+0.02);
|
|
|
+ }else if(topbar.getTime().get(Calendar.HOUR_OF_DAY) > 4 && topbar.getTime().get(Calendar.HOUR_OF_DAY) < 8){
|
|
|
+ setNight(night-0.08);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void checkPlayingActs(){
|
|
|
@@ -560,7 +568,12 @@ public class Terrain extends JPanel {
|
|
|
public WalkingPathArrayList getPaths() {
|
|
|
return paths;
|
|
|
}
|
|
|
-
|
|
|
+ private void setNight(double d){
|
|
|
+ System.out.println(d);
|
|
|
+ if(d >= 0 && d < 150){
|
|
|
+ this.night = d;
|
|
|
+ }
|
|
|
+ }
|
|
|
public boolean isLastplayedact() {
|
|
|
return lastplayedact;
|
|
|
}
|