Changeset 6472


Ignore:
Timestamp:
2015-06-26 13:28:43 (8 years ago)
Author:
anlakane
Message:
 
Location:
2014/30/MitjaK/Attack to Agora/Attack to Agora
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora.cs

    r6471 r6472  
    4646    const double VIHOLLISEN_TORMAYSDMG = 4.0; 
    4747 
    48     int kenttaNro = 18; 
     48    int kenttaNro = 1; 
    4949 
    5050    /// <summary> 
     
    5858    /// </summary> 
    5959    const int VIIMEINEN_KENTTA = 19; 
    60  
     60      
    6161    #region yleiset toiminnot 
    6262    public override void Begin() 
    6363    { 
    64         SetWindowSize(1366, 768); 
     64        SetWindowSize(1366, 768, true); 
    6565        LataaContent(); 
    6666        AloitusAnimaatio(); 
     
    270270        asemiesLiikkuu = LoadAnimation("asemiesliikkuu"); 
    271271        tuliAnimaatio = LoadAnimation("tulianimaatio"); 
     272        tuliAnimaatioFlipped = Animation.Mirror(tuliAnimaatio); 
    272273    } 
    273274 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora_mitja.cs

    r6471 r6472  
    2323    Image ajHBarFull = LoadImage("ajheathbarfull"); 
    2424    Animation tuliAnimaatio; 
     25    Animation tuliAnimaatioFlipped; 
    2526    bool tekeekoTulidamagea = false; 
    2627    const double TULEN_DMG = 0.1; 
    27     const double TULEN_ETAISYYS = 300.0; 
    28     const double AJ_NOPEUS = 300.0; 
    29     bool isAJFlipped = false; 
     28    const double TULEN_ETAISYYS = 200.0; 
     29    const double AJ_NOPEUS = 100.0; 
     30    bool ajGoingRight = true; 
     31    bool pelaajaAskenOikealla = false; 
    3032 
    3133    Elava currentBoss; 
     
    245247        anttijussibossFlipped = Image.Mirror(anttijussiboss); 
    246248 
    247         Elava anttiJussi = new Elava(anttijussiboss, 1000); //hp 10000? 
     249        Elava anttiJussi = new Elava(anttijussiboss, 10000); //hp 10000? 
    248250        anttiJussi.Kuoli += AJDefeated; 
    249251        anttiJussi.Size *= 0.2; 
     
    275277        fireT.Timeout += delegate 
    276278        { 
    277             tuli.Left = anttiJussi.Right; 
    278             tuli.Y = anttiJussi.Y + 80; 
     279            if (ajGoingRight) 
     280            { 
     281                tuli.Left = anttiJussi.Right; 
     282                tuli.Y = anttiJussi.Y + 80; 
     283            } 
     284            else 
     285            { 
     286                tuli.Right = anttiJussi.Left; 
     287                tuli.Y = anttiJussi.Y + 80; 
     288            } 
    279289        }; 
    280290        fireT.Start(); 
     
    307317            if (tekeekoTulidamagea) 
    308318            { 
    309                 double distance = Vector.Distance(new Vector(tuli.Left, tuli.Y), taistelija.Position); 
     319                double distance; 
     320                if (ajGoingRight) 
     321                    distance = Vector.Distance(new Vector(tuli.Left, tuli.Y), taistelija.Position); 
     322                else  
     323                    distance = Vector.Distance(new Vector(tuli.Right, tuli.Y), taistelija.Position); 
     324 
    310325                if (distance < TULEN_ETAISYYS) 
    311326                { 
     
    318333                { 
    319334                    currentBoss.Velocity = new Vector(-AJ_NOPEUS, currentBoss.Velocity.Y); 
     335                    ajGoingRight = false; 
    320336                } 
    321337                else 
    322338                { 
    323339                    currentBoss.Velocity = new Vector(AJ_NOPEUS, currentBoss.Velocity.Y); 
     340                    ajGoingRight = true; 
    324341                } 
     342            } 
     343 
     344            if (ajGoingRight && !pelaajaAskenOikealla) 
     345            { 
     346                currentBoss.Image = anttijussiboss; 
     347                tuli.Animation = tuliAnimaatio; 
     348                tuli.Animation.Start(); 
     349                pelaajaAskenOikealla = true; 
     350            } 
     351            if (!ajGoingRight && pelaajaAskenOikealla) 
     352            { 
     353                currentBoss.Image = anttijussibossFlipped; 
     354                tuli.Animation = tuliAnimaatioFlipped; 
     355                tuli.Animation.Start(); 
     356                pelaajaAskenOikealla = false; 
    325357            } 
    326358        }; 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to AgoraContent/Attack to AgoraContent.contentproj

    r6443 r6472  
    428428  </ItemGroup> 
    429429  <ItemGroup> 
    430     <Compile Include="anttijussiboss.png"> 
    431       <Name>anttijussiboss</Name> 
    432       <Importer>TextureImporter</Importer> 
    433       <Processor>TextureProcessor</Processor> 
    434     </Compile> 
    435   </ItemGroup> 
    436   <ItemGroup> 
    437430    <Compile Include="LMGfire.wav"> 
    438431      <Name>LMGfire</Name> 
     
    489482      <Importer>AnimationImporter</Importer> 
    490483      <Processor>AnimationContentProcessor</Processor> 
     484    </Compile> 
     485  </ItemGroup> 
     486  <ItemGroup> 
     487    <Compile Include="anttijussiboss.png"> 
     488      <Name>anttijussiboss</Name> 
     489      <Importer>TextureImporter</Importer> 
     490      <Processor>TextureProcessor</Processor> 
     491    </Compile> 
     492  </ItemGroup> 
     493  <ItemGroup> 
     494    <Compile Include="ydinpommi.png"> 
     495      <Name>ydinpommi</Name> 
     496      <Importer>TextureImporter</Importer> 
     497      <Processor>TextureProcessor</Processor> 
     498    </Compile> 
     499  </ItemGroup> 
     500  <ItemGroup> 
     501    <Compile Include="kentta19.png"> 
     502      <Name>kentta19</Name> 
     503      <Importer>TextureImporter</Importer> 
     504      <Processor>TextureProcessor</Processor> 
     505    </Compile> 
     506  </ItemGroup> 
     507  <ItemGroup> 
     508    <Compile Include="kentta19pohja.png"> 
     509      <Name>kentta19pohja</Name> 
     510      <Importer>TextureImporter</Importer> 
     511      <Processor>TextureProcessor</Processor> 
    491512    </Compile> 
    492513  </ItemGroup> 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Muokattu Jypeli/Game/Game.cs

    r6440 r6472  
    13681368            if ( Level.Background.Image != null && !Level.Background.MovesWithCamera ) 
    13691369            { 
    1370                 Renderer.LightingEnabled = true; 
    13711370                SpriteBatch spriteBatch = Jypeli.Graphics.SpriteBatch; 
    13721371                spriteBatch.Begin( SpriteSortMode.Deferred, BlendState.AlphaBlend ); 
    13731372                spriteBatch.Draw( Level.Background.Image.XNATexture, new XnaRectangle( 0, 0, (int)screen.Width, (int)screen.Height ), XnaColor.White ); 
    13741373                spriteBatch.End(); 
    1375                 Renderer.LightingEnabled = false; 
    13761374            } 
    13771375 
     
    13811379                * Matrix.CreateScale( (float)Camera.ZoomFactor, (float)Camera.ZoomFactor, 1f ); 
    13821380 
     1381            Renderer.LightingEnabled = true; 
    13831382            // If the background should move with camera, draw it here. 
    13841383            Level.Background.Draw( worldMatrix, Matrix.Identity ); 
     1384            Renderer.LightingEnabled = false; 
    13851385 
    13861386            if ( DrawPerimeter ) 
Note: See TracChangeset for help on using the changeset viewer.