Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6603561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:01:50+00:00 2026-05-25T19:01:50+00:00

Ok, I have three conditions here. It’s seems pretty simple, but I can’t get

  • 0

Ok, I have three conditions here. It’s seems pretty simple, but I can’t get it working how I want, bear with me as I try to explain it.

If(conditionA){
Play Sound 1}

If(conditionB) {
changedrawable ///(irrelevant)    

}

 If(conditionA && conditionB){
 Play sound 2 
}
    ////Unfortunately, since condition A is true, it plays sound 1 too, and I only want it to play sound 2

FWIW These conditions are just coordinates on the touchscreen, and I have them set up as boolean’s

Boolean conditionA;
conditionA = y > 0 && y < (0.2 * tY) && x > 0 && x < (0.1667 * tX) || y2 > 0
            && y2 < (0.2 * tY) && x2 > 0 && x2 < (0.1667 * tX);

ConditionA and ConditionB are referring to different points on the touchscreen. The main question: how on earth can I get it so when conditionA and conditionB are BOTH true, ONLY Play Sound 2 (instead of both sounds)? I have been pulling my hair out the last day trying to figure this out. Please let me know if there is a solution or if you need further details. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:01:50+00:00Added an answer on May 25, 2026 at 7:01 pm

    Shouldn’t it be

    if(conditionA && conditionB) {
        play sound 2
    } else if(conditionA) {
        play sound 1
    }
    if(conditionB) {
        change drawable
    }
    

    You only want the else if for playing the sound. Not for changing the drawable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple query (three where conditions; two equals, one between) from
Have three divs in a container that I want to float over a large
I have three tables (individuals, groups & recordlabels) and want use the information between
Here's what I want: I have an element in my html code, and I
I have a query where not all conditions are necessary. Here's an example of
I have here sample table with three fields. TableA FieldA FieldB FieldC ====================================== 123XYZ456
hope someone can figure out what I'm doing wrong here. The task seems quite
I have a tree-like model where in all situations but one , I want
Would appreciate any help to a newbie here. I have a simple if/else if
Is there a tool that analyses .NET code and finds race conditions? I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.