From ccf5a17a581a75fdc06173c5e05d14c92ce285e8 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Wed, 16 Sep 2015 21:58:52 +0200 Subject: [PATCH] GameScreen.GetEntitiesUnderPoint: Entity picking --- code/GameLib.js | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/code/GameLib.js b/code/GameLib.js index 702abce..50b8b4a 100644 --- a/code/GameLib.js +++ b/code/GameLib.js @@ -68,11 +68,10 @@ GameScreen.prototype = { Update: function(){ for(var i=0,n=this.Entities.length;i (this.PositionDest.X - (this.Size.X/2)) && + point.Y < (this.PositionDest.Y + (this.Size.Y/2)) && + point.Y > (this.PositionDest.Y - (this.Size.Y/2)) && + true + ); + }, Debug: false };