dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: Detect a mouse click on specific entity in an arrayList

  1. #16
    Join Date
    Dec 2010
    Posts
    17

    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);

  2. #17
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    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.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)