From 49805bf316bd9ed1a8dcbd829a0c28b9399d1ff3 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 23 Feb 2021 19:07:56 +0100 Subject: i&m: exercises of 23rd feb --- Year_2/IandM/02232021_1/Exercise1.pde | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 Year_2/IandM/02232021_1/Exercise1.pde (limited to 'Year_2/IandM/02232021_1/Exercise1.pde') diff --git a/Year_2/IandM/02232021_1/Exercise1.pde b/Year_2/IandM/02232021_1/Exercise1.pde new file mode 100755 index 0000000..c7bea6b --- /dev/null +++ b/Year_2/IandM/02232021_1/Exercise1.pde @@ -0,0 +1,19 @@ +Auto a = new Auto(); +AutoElettrica ea = new AutoElettrica(a.velx()); + +void setup() { + size(512, 512); +} + +void draw() { + background(255); + a.draw(); + ea.draw(); +} + +void keyPressed() { + if(key == 'R' || key == 'r') { + a = new Auto(); + ea = new AutoElettrica(a.velx()); + } +} -- cgit v1.2.3-18-g5258