File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ ArrayList vehicles = new ArrayList();
15
15
16
16
Vehicle bestCar;
17
17
18
+ PImage carImage;
19
+
18
20
boolean pdf = false ;
19
21
20
22
PFont font;
@@ -65,6 +67,8 @@ void setup() {
65
67
66
68
gfx = g;
67
69
70
+ carImage = loadImage (" car.png" );
71
+
68
72
randomSeed (3 );
69
73
}
70
74
@@ -86,15 +90,23 @@ void draw() {
86
90
noStroke ();
87
91
88
92
world. step();
89
- world. draw(gfx);
93
+ // world.draw(gfx);
90
94
91
95
if (frameCount < 600 && frameCount % 30 == 0 ) {
92
96
stupidCar();
93
97
}
94
98
95
99
for (int i= 0 ; i< vehicles. size(); i++ ) {
100
+ pushMatrix ();
96
101
Vehicle vehicle = (Vehicle )vehicles. get(i);
97
102
vehicle. update();
103
+ FBody b = vehicle. chassis;
104
+ translate (b. getX(), b. getY());
105
+ scale (0.08 );
106
+ rotate (b. getRotation());
107
+ translate (- 120 ,- 80 );
108
+ image (carImage, 0 , 0 );
109
+ popMatrix ();
98
110
}
99
111
100
112
if (gui && ! pdf) {
You can’t perform that action at this time.
0 commit comments