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 492777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T02:08:50+00:00 2026-05-13T02:08:50+00:00

Right now I’m trying to make it so I’ve got 1 character and 3

  • 0

Right now I’m trying to make it so I’ve got 1 character and 3 enemies if my character dies it’s supposed to give game over or something but I can’t make it to work (if enemies die it works tho I don’t know why).

Here is what I’m doing:

        bool Exit = false;
        bool CharDead = false;

        Heroe Heroe1 = p.ElementAt(0);
        Enemigo Enemigo1 = l.ElementAt(0);
        Enemigo Enemigo2 = l.ElementAt(1);
        Enemigo Enemigo3 = l.ElementAt(2);
        a.Agregar(comienza);
        List<Items> item = new List<Items>();
        do
        {
            if (Heroe1.HP > 0)
                AccionesHeroe1(l, p);

            if (Enemigo1.HP > 0)
                AccionesEnemigo1(l, p);

            if (Enemigo2.HP > 0)
                AccionesEnemigo2(l, p);

            if (Heroe1.HP > 0)
                AccionesHeroe1(l, p);
            else
                CharDead = true;
            if (Enemigo3.HP > 0)
                AccionesEnemigo3(l, p);

            if (Heroe1.HP <= 0)
            {
                CharDead = true;
            }
            if (Enemigo1.HP <= 0 && Enemigo2.HP <= 0 && Enemigo3.HP <= 0)
            {
                Exit = true;
            }

        } while (Exit == false || CharDead == false);
  • 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-13T02:08:50+00:00Added an answer on May 13, 2026 at 2:08 am

    Your ending condition is:

     (Exit == false || CharDead == false);
    

    This will only exit when CharDead AND Exit are both true.

    You probably want to rework it to be:

     (Exit == false && CharDead == false);
    

    This way, as soon as Exit is not false or CharDead is not false, you’ll exit.

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

Sidebar

Related Questions

Right now I'm doing something like this: RewriteRule ^/?logout(/)?$ logout.php RewriteRule ^/?config(/)?$ config.php I
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName
Right now I'm trying to set the default audio device on Windows 7 programmatically,
Right now I'm just trying to test my app on my phone and not
Right now I'm asking the user for two numbers. I'm trying to print the
Right now I am trying to design an Android app where a critical feature
right now I have this pulling data for the current week, but the week
Right now when i do something like this: use strict; use warnings; package My::Test;
Right now I am porting a VB6 project over to C# and keep getting
Right now, I keep all of my projects on my laptop. I'm thinking that

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.