Re: Detect a mouse click on specific entity in an arrayList
VerCar is the name of the new entity being created to represent a vertical car in the game. I was testing to see is the clicked object was the same as VerCar so I could then change the speed of it, because I cant do clickedCar.setVerticalMovement(300);
Re: Detect a mouse click on specific entity in an arrayList
If VerCar is different entity and you can't do clickedCar.setVerticalMovement(300) then how is VerCar ever going to equal clickedCar?
If your GUI car object does not hold a reference to the data model that determines it's motion/direction etc then you will need to either make it do so or provide a map that links the 2 together. Personally I'd go with the former approach but i don't know what your overall design or purpose is so the second approach may be more appropriate.