From cd8b5ef7da2116c20c6b4fa22fa94282fac49bda Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Wed, 13 May 2020 21:59:10 -0500 Subject: Add height to vent --- src/paperflight/static/update.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/paperflight/static/update.js') diff --git a/src/paperflight/static/update.js b/src/paperflight/static/update.js index 296308f..226d015 100644 --- a/src/paperflight/static/update.js +++ b/src/paperflight/static/update.js @@ -17,7 +17,8 @@ function update() { } } function updateVent() { - if (plane.x >= this.x - plane.width && plane.x <= this.x + this.width && plane.y < this.y) { + if (plane.x >= this.x - plane.width && plane.x <= this.x + this.width && this.y - this.height < plane.y && plane.y < this.y) { + // console.log(plane.y, this.y, this.y-this.height) plane.y -= 2 } } @@ -45,4 +46,4 @@ function updateCoin(){ this.collected = true collected++ } -} \ No newline at end of file +} -- cgit v1.2.3