Skip to content

Commit 0937a5a

Browse files
committed
Swearing and cars and swearing
1 parent 522b447 commit 0937a5a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

vehiclesim/data/car.png

16.8 KB
Loading

vehiclesim/vehiclesim.pde

+13-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ArrayList vehicles = new ArrayList();
1515

1616
Vehicle bestCar;
1717

18+
PImage carImage;
19+
1820
boolean pdf = false;
1921

2022
PFont font;
@@ -65,6 +67,8 @@ void setup() {
6567

6668
gfx = g;
6769

70+
carImage = loadImage("car.png");
71+
6872
randomSeed(3);
6973
}
7074

@@ -86,15 +90,23 @@ void draw() {
8690
noStroke();
8791

8892
world.step();
89-
world.draw(gfx);
93+
//world.draw(gfx);
9094

9195
if (frameCount < 600 && frameCount % 30 == 0) {
9296
stupidCar();
9397
}
9498

9599
for (int i=0; i<vehicles.size(); i++) {
100+
pushMatrix();
96101
Vehicle vehicle = (Vehicle)vehicles.get(i);
97102
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();
98110
}
99111

100112
if (gui && !pdf) {

0 commit comments

Comments
 (0)