How can I solve multi collisions?

Hi,
I have collision between a ball (obj) and  3 bars (obj11, obj22 and obj33).
Every time when I had a collision I suppose to score only one time.
 This is the reason for using missed15, missed25, missed35 and not
    if (!obj11.IsEmpty | !obj22.IsEmpty | !obj33.IsEmpty)
            score++;
            txtScore.Text = score.ToString();
In this case instead of 1 I have hundreds because if multi collision.
Sa my problem is how I get 4 score and so one by one. 1,2 and 3 are OK.
See code for more.
https://onedrive.live.com/redir?resid=857BC62170EDDB22!5572&authkey=!AIYlPsMNum16t9Q&ithint=file%2czip
obj11.Intersect(obj);
void gameTimer2_Tick(object sender, object e)
            obj = new Rect();
            obj.X = Canvas.GetLeft(Ball);
            obj.Y = Canvas.GetTop(Ball);
        //    obj.Height = 60; // 50;
        //  obj.Width = 60;  // 50;
            obj.Height =  50;
   obj11 = new Rect();
            obj11.X = Canvas.GetLeft(rect11);
            obj11.Y = Canvas.GetTop(rect11);
            obj11.Height = (double)PipeDifferentY; //Pipe1[1];
            obj11.Width = 1; // 15; //66;
            obj11.Intersect(obj);
if (!obj11.IsEmpty)
    missed15 = 1;
    missedTotal = missed15 + missed25 + missed35;
    txtScore.Text = missedTotal.ToString();
obj33 = new Rect();
            obj33.X = Canvas.GetLeft(rect33);
            obj33.Y = Canvas.GetTop(rect33);
            obj33.Height = (double)PipeDifferentY; //Pipe1[1];
            obj33.Width = 1; // 15; //66;
            obj33.Intersect(obj);
if (!obj33.IsEmpty)
    missed15 = 1;
    missedTotal = missed15 + missed25 + missed35;
    txtScore.Text = missedTotal.ToString();
obj22 = new Rect();
            obj22.X = Canvas.GetLeft(rect22);
            obj22.Y = Canvas.GetTop(rect22);
            obj22.Height = (double)PipeDifferentY; //Pipe1[1];
            obj22.Width = 1; // 15; //66;
            obj22.Intersect(obj);
if (!obj22.IsEmpty)
    missed15 = 1;
    missedTotal = missed15 + missed25 + missed35;
    txtScore.Text = missedTotal.ToString();
Thanks
ADRIAN DIBU

Hi.
Thanks for answer.
It works for passing gate 1, 2, 3 I have the sore 3, but at 4 and next gates I have also 3 and not 4 and so.
Please see the project it suppose to work.
void gameTimer2_Tick(object sender, object e)
            obj = new Rect();
            obj.X = Canvas.GetLeft(Ball);
            obj.Y = Canvas.GetTop(Ball);
        //    obj.Height = 60; // 50;
        //  obj.Width = 60;  // 50;
            obj.Height =  50;
   obj11 = new Rect();
            obj11.X = Canvas.GetLeft(rect11);
            obj11.Y = Canvas.GetTop(rect11);
            obj11.Height = (double)PipeDifferentY; //Pipe1[1];
            obj11.Width = 1; // 15; //66;
            obj11.Intersect(obj);
if (!obj11.IsEmpty)
    missed15 = 1;
    missedTotal = missed15 + missed25 + missed35;
    txtScore.Text = missedTotal.ToString();
obj22 = new Rect();
            obj22.X = Canvas.GetLeft(rect22);
            obj22.Y = Canvas.GetTop(rect22);
            obj22.Height = (double)PipeDifferentY; //Pipe1[1];
            obj22.Width = 1; // 15; //66;
            obj22.Intersect(obj);
if (!obj22.IsEmpty)
    missed25 = 1;
    missedTotal = missed15 + missed25 + missed35;
    txtScore.Text = missedTotal.ToString();
obj33 = new Rect();
            obj33.X = Canvas.GetLeft(rect33);
            obj33.Y = Canvas.GetTop(rect33);
            obj33.Height = (double)PipeDifferentY; //Pipe1[1];
            obj33.Width = 1; // 15; //66;
            obj33.Intersect(obj);
if (!obj33.IsEmpty)
    missed35 = 1;
    missedTotal = missed15 + missed25 + missed35;
    txtScore.Text = missedTotal.ToString();
 Thanks
ADRIAN DIBU

Similar Messages

  • How Can I get multi column values from dynamic search help?

    Hi Gurus;
    I'm using dynamic search help in my program.
    I want to get multi column values from search help. But I dont know solution for this issue.
    I'm using F4IF_INT_TABLE_VALUE_REQUEST FM.
    How Can I get multi column values from dynamic search help?
    Thanks.

    Believe it or not, the same FM worked for me in a dynpro. I will try to explain here how it works in custom screen and then you can do your work for other screens or program types. I am not going to write my actual work but will explain in general.
    I have 4 fields (FLD1, FLD2, FLD3, FLD4) and i made the search based on FLD2 and when user click on a line (could be any field), then this would bring the line on to the screens.
    There are like 3 steps.
    You have your value_tab for my fields FLD1, FLD2, FLD3 and FLD4. This is just the data that we pass into the FM. (data: IT_VALTAB type table of ZVAL_TABLE)
    Next map the screen fields into an internal table (data: It_dynpfld type table of dselc ). I also have other internal tables defined  (just to keep it straight, i will be putting here) data:  It_return type standard table of ddshretval.
    Next step is to call the function module. Make sure you have values in IT_VALTAB.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
            retfield        = 'FLD2'
            value_org       = 'S'
          tables
            value_tab       = It_VALTAB
            return_tab      = It_return
            dynpfld_mapping = It_dynpfld
          exceptions
            parameter_error = 1
            no_values_found = 2
            others          = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
          with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        else.
          perform get_selected_fields tables It_return.
        endif.
    The code within the perform GET_SELECTED_FIELDS  - We need to map the result fields after user selects it. The code goes like this. This is step is to update the dynpro fields.
    I need a internal table as well as a work area here. like,
    data: lt_fields type table of dynpread,
            la_fields type dynpread.
      field-symbols: <fs_return> type ddshretval.
    so fill out LT_FIELDS from the IT_RETURN table
    loop at lt_return assigning <fs_return>.
        la_fields-fieldname = <fs_return>-retfield.
        la_fields-fieldvalue = <fs_return>-fieldval.
        append la_fields to lt_fields.
        clear: la_fields.
      endloop.
    Call the FM to update the dynpro
    call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = '1002' "This is my screen number. You could use 1000 for selection screen (hope so)
        tables
          dynpfields           = lt_fields
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    good luck

  • HT5622 my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    Hey nocillado,
    Thanks for using Apple Support Communities.
    It sounds like you have 2 things you want to address. These articles can help you use iCloud with your existing Apple ID.
    Get help activating your iPhone
    http://support.apple.com/kb/ts3424
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Using the same Apple ID for Store purchases and iCloud (recommended)
    Have a nice day,
    Mario

  • My speaker is not working properly in 4s if i use headphone its working now my volume increase decrease button is also not working properly how can i solve it pl help me my warranty finished

    my speaker is not working properly in 4s if i use headphone its working now my volume increase decrease button is also not working properly how can i solve it pl help me my warranty finished

    Hello. I sent my WRT1900AC V1 to Linksys four days ago (Monday) via UPS with a RMA. Linksys paid the shipping and everything. The router is still in route, and it should arrive to their offices tomorrow. Once they receive the WRT1900 AC V1, they are going to send me an EA8500 as a replacement. But I have been reading the comments about the EA8500 here in the forum and it seems to have the same problems. I guess the firmware is extremely flawed in both routers (maybe it is almost the same code?). Anyway, I will try the EA8500 and I hope it works. I bought a temporary router from Walmart and I paid $35 for it. It is a Belink N600 DB. I can't believe that a $35 router is working a lot, lot, lot better than my previous $250 WRT1900AC router. Unbelievable. If the EA8500 doesn't work, I'm going to try and get my money back from Linksys, or contact The Consumerist or someone to get my money back and get a Nighthawk instead.

  • How can i solve "Cannot connect to the iTune Store" issue on my iPhone?

    Hi,
    Frequently i'm getting alert message (Cannot Connect to the iTune Store) while use my valid Credential on iPhone 4 (even Itunes application) Setting-> iTunes & App Stores->. but same credential accepted other iPhones too why not in my iPhone 4. same way others Apple ID wouldn't accept in my iPhone 4. how can i solve this problem? please suggest me.
    Thanks in Advance,
    Suresh Balakrishnan.

    Take a look at these instructions:
    http://www.digitaltrends.com/mobile/how-to-make-ringtones-for-iphone/

  • I have deleted all my videos songs and photos from my iphone 4 but when i connect to itunes it still shows 17gb free. how can I solve this issue without restore. Total storage of my iphone is 32 gb.

    I have deleted all my videos songs and photos from my iphone 4 but when i connect to itunes it still shows 17gb free. how can I solve this issue without restore. Total storage of my iphone is 32 gb.

    I don't see an issue, but if you mean why didn't you get most of your memory back you need to see what else is using storage. Go to Settings/General/Usage. Wait a bit for it to calculate storage allocation, then when it finishes you can see how much storage each app uses.

  • I'm having trouble with my Apple ID. I changed my email account, and recently (a month ago) and since I switched is requested every time I open any app to Apple ID password to the old email. How can I solve this? Could it be that my iPhone 4S is in sync w

    I'm having trouble with my Apple ID. I changed my email account, and recently (a month ago) and since I switched is requested every time I open any app to Apple ID password to the old email. How can I solve this? Could it be that my iPhone 4S is in sync with my Ipod???

    If you updated your existing account then try logging out of it on the iPhone by tapping on the id in Settings > iTunes & App Stores and then log back in and see if that 'refreshes' the account on the iPhone. If you created a new account then any content that you purchased/downloaded via the old account will remain tied to that old account, and only that old account can download updates to its apps.

  • TS3899 In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    Greetings,
    Questions:
    1. What version of the Mac OS are you running (Apple > About this Mac)?
    2. What version of the iOS are you running (Settings > About)?
    3. Do you use MobileMe/ iCloud or another server based sync solution like Google or Yahoo?
    4. Do other changes to synced information like Address Book content sync successfully back and forth?
    Based on your description it sounds like you have a 1 way sync issue.  Events sync fine between the iOS devices and fine from the computer to the iOS devices but not from the iOS devices to the computer.
    Try:
    Backup your computer and iOS devices before doing anything else:
    http://support.apple.com/kb/HT1427
    http://support.apple.com/kb/ht1766
    Ensure all the devices in use are fully up to date: Apple > Software Update / Settings > General > Software Update
    Make separate backups of critical data:
    Backup your computer Addressbook: http://docs.info.apple.com/article.html?path=AddressBook/4.0/en/ad961.html
    Backup your computer iCal: http://support.apple.com/kb/HT2966
    Reset syncing on your Mac: http://support.apple.com/kb/TS1627
    Reply back if that does not resolve your issue.
    Hope that helps.

  • HT1527 I have windows 8.1 and cannot access itunes store even creating a new apple id. With other users on the same computer I can access itunes store. How can I solve this?

    I have windows 8.1 and cannot access itunes store even creating a new apple id. With other users on the same computer I can access itunes store. How can I solve this?

    i had the same problem before using a fresh install of Windows 8.1.  I have resolved this issue by running the program compatibility wizard.  This I did by right-clicking on the iTunes icon in the desktop, selecting Troubleshoot compatibility, waited for it to detect compatibility issues and when presented with the following options: 1.) Try recommended settings; 2.) Troubleshoot program, I chose the latter.  When asked what problems I noticed, I checked the following: "The program worked in earlier versions of Windows but won't install or run" and "The program requires additional permission"
    After that, it tired to resolve the issue, and provided the necessary settings to run iTunes.  Now it's running flawlessly.  I have Avast anti-virus installed though.
    HTH!

  • How can I solve this error message? Some of your photos, including the photo "IMG_0374.jpg", were not copied to the iPad "(my name's) iPad" because they cannot be displayed on your iPad.

    how can I solve this error message? "Some of your photos, including the photo “IMG_0374.jpg”, were not copied to the iPad “(my name’s) iPad” because they cannot be displayed on your iPad."
    There were 273 photos in the event syncing from my Mac, but only the last 103 made it to the ipad. Most of the photos were taken by an iphone. I would appreciate any thoughts or insights - thanks.

    Adrian-
    That error message suggests the photo is somehow corrupt.
    Do you have the Apple Camera Connection Kit?  You can set up a USB thumb drive with MS-DOS FAT-32 format and copy your photos to it into a folder named DCIM.  Assuming they have an 8 character plus suffix name, the iPad will recognize them and give you the option of transferring them via the Kit's USB adapter.
    Once they are transferred, you can find out if there is a problem with any.
    Fred

  • Why is that i can not view my warranty status? whenever i tried to put my phone's serial number itunes prompt that my serial number is not a valid one. how can i solve this issue?

    why is that i can not view my warranty status? whenever i tried to put my phone's serial number itunes prompt that my serial number is not a valid one. how can i solve this issue?

    https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • I have created a Blog in iWeb and uploaded it to an FTP server.   It works fine, except that the 'Comments' facility is missing.   When I upload the blog to MobileMe   the 'Comments' facility is there and working great.   How can I solve the problem on th

    I have created a Blog in iWeb and uploaded it to an FTP server.   It works fine, except that the 'Comments' facility is missing.   When I upload the blog to MobileMe   the 'Comments' facility is there and working great.   How can I solve the problem on the FTP server Blog.

    You haven't a problem. You simply did not read the iWeb Help :

  • My hard drive has 70.93 GB available, yet when i have more than one internet tab open, i have to force quit google chrome because 'there is no more available application memory'. How can I solve this? I have a 2009 macbook pro running on 10.6.8.

    My hard drive has 70.93 GB available, yet when i have more than one internet tab open, i have to force quit google chrome because 'there is no more available application memory'. How can I solve this? I have a 2009 macbook pro running on 10.6.8. I have tried updating to mavericks through the mac app store but after it downloading for a day i got an error message saying there was a problem with the download. The same thing happens if i try to update itunes or the mac app store. After research, i have also tried repairing disk permissions, but every time they do get repaired the 'repair' button still appears, i'm not sure if it's because it was unable to repair the initial problems or if it just keeps detecting new ones.

    2 GBs is a minimum in which you can do many things, but not concurrently. Be very careful to not install third-party add-ons, limit the number of applications you choose to enter in Login Items, run as few applications concurrently as you demand.
    I would consider adding more RAM to your computer. Your model supports 8 GBs, so I would install that.

  • The ipad'osby media pro' could not be synced because this computer is not authourised for purchased item that are on this ipad.how can i solve this proble,i've authourised it several times

    the ipad'osby media pro' could not be synced because this computer is not authourised for purchased item that are on this ipad.how can i solve this proble,i've authourised it several times

    Hello, osbybass. 
    Thank you for the question.  This alert can mean that iTunes is recognizing applications on the iPad purchased by another Apple ID.  If anyone in your household has an Apple ID, try authorizing the computer with their Apple ID and attempt to sync.  If you are still experiencing issues, go through the troubleshooting steps in the attached article. 
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/ts1389
    Cheers,
    Jason H. 

  • I'm no longer able to select the file size when emailing a photo. How can I solve this? iPhone 4S with iOS 7.1.1

    I'm no longer able to select the file size when emailing a photo. How can I solve this? iPhone 4S with iOS 7.1.1. Thanks a lot.

    Yeah - I tried that, several times; each time I get "iTunes is restoring the software on this iPhone" and after about 30 minutes the screen on the phone lights up again with the same screen I had before.  After that ... nothing.

Maybe you are looking for