Changeset 6406


Ignore:
Timestamp:
2015-06-25 22:55:23 (4 years ago)
Author:
mikrkana
Message:
 
Location:
2014/30/MitjaK/Attack to Agora/Attack to Agora
Files:
7 edited

Legend:

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

    r6334 r6406  
    1313                DebugVisualize|x86 = DebugVisualize|x86 
    1414                Release|x86 = Release|x86 
     15                Visualize|x86 = Visualize|x86 
    1516        EndGlobalSection 
    1617        GlobalSection(ProjectConfigurationPlatforms) = postSolution 
     
    2122                {DDF55303-D454-45BC-81E0-ED7879E29D5C}.Release|x86.ActiveCfg = Release|x86 
    2223                {DDF55303-D454-45BC-81E0-ED7879E29D5C}.Release|x86.Build.0 = Release|x86 
     24                {DDF55303-D454-45BC-81E0-ED7879E29D5C}.Visualize|x86.ActiveCfg = Visualize|x86 
     25                {DDF55303-D454-45BC-81E0-ED7879E29D5C}.Visualize|x86.Build.0 = Visualize|x86 
    2326                {2930AD0E-5824-4386-8008-3C0C45D1DA86}.Debug|x86.ActiveCfg = Debug|x86 
    2427                {2930AD0E-5824-4386-8008-3C0C45D1DA86}.DebugVisualize|x86.ActiveCfg = Debug|x86 
    2528                {2930AD0E-5824-4386-8008-3C0C45D1DA86}.Release|x86.ActiveCfg = Release|x86 
     29                {2930AD0E-5824-4386-8008-3C0C45D1DA86}.Visualize|x86.ActiveCfg = Release|x86 
    2630                {74DD1DDD-283D-45D7-A79D-3DCB120708A6}.Debug|x86.ActiveCfg = Debug|x86 
    2731                {74DD1DDD-283D-45D7-A79D-3DCB120708A6}.Debug|x86.Build.0 = Debug|x86 
     
    3034                {74DD1DDD-283D-45D7-A79D-3DCB120708A6}.Release|x86.ActiveCfg = Release|x86 
    3135                {74DD1DDD-283D-45D7-A79D-3DCB120708A6}.Release|x86.Build.0 = Release|x86 
     36                {74DD1DDD-283D-45D7-A79D-3DCB120708A6}.Visualize|x86.ActiveCfg = Visualize|x86 
     37                {74DD1DDD-283D-45D7-A79D-3DCB120708A6}.Visualize|x86.Build.0 = Visualize|x86 
    3238        EndGlobalSection 
    3339        GlobalSection(SolutionProperties) = preSolution 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora.csproj

    r6334 r6406  
    6060    <PlatformTarget>x86</PlatformTarget> 
    6161    <XnaCompressContent>true</XnaCompressContent> 
     62  </PropertyGroup> 
     63  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Visualize|x86'"> 
     64    <DebugSymbols>true</DebugSymbols> 
     65    <OutputPath>bin\x86\Visualize\</OutputPath> 
     66    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants> 
     67    <NoStdLib>true</NoStdLib> 
     68    <DebugType>full</DebugType> 
     69    <PlatformTarget>x86</PlatformTarget> 
     70    <CodeAnalysisLogFile>bin\x86\Debug\Attack to Agora.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile> 
     71    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> 
     72    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> 
     73    <UseVSHostingProcess>false</UseVSHostingProcess> 
     74    <ErrorReport>prompt</ErrorReport> 
     75    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 
     76    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 
     77    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 
    6278  </PropertyGroup> 
    6379  <ItemGroup> 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora.cs

    r6402 r6406  
    3939 
    4040    const double VIHOLLISEN_TORMAYSDMG = 4.0; 
    41     int kenttaNro = 1; 
     41    int kenttaNro = 9; 
    4242 
    4343    /// <summary> 
     
    5555    public override void Begin() 
    5656    { 
    57         Window.Width = 1024; 
    58         Window.Height = 768; 
    5957        FixCamera(); 
    6058 
     
    257255 
    258256 
    259     void Liikuta(PlatformCharacter pelaaja, double suunta) 
    260     { 
    261         pelaaja.Walk(suunta); 
     257    void Liikuta(PhysicsObject pelaaja, double suunta) 
     258    { 
     259        pelaaja.Velocity = new Vector(suunta, pelaaja.Velocity.Y); 
    262260 
    263261        if (!pelaaja.Animation.IsPlaying) 
     
    265263    } 
    266264 
    267     void LiikutaYlos(PlatformCharacter pelaaja) 
    268     { 
    269         pelaaja.Jump(HYPPYVOIMA); 
     265    void LiikutaYlos(PhysicsObject pelaaja) 
     266    { 
    270267        // pelaaja.Tag = "hyppy"; // PYRY MITÄ...rip 
     268 
     269        pelaaja.Hit(new Vector(0, HYPPYVOIMA * pelaaja.Mass)); 
     270 
    271271        Sound pelaajaHyppyAani = hyppy.CreateSound(); 
    272272        pelaajaHyppyAani.Pitch = 0.1; 
     
    464464        { 
    465465            case 10: 
    466                 TriggerAction += delegate { LuoJouniBoss(new Vector(Screen.Left - jouniBoss.Width / 2 - 20, 0.0), new Vector(Screen.Left + jouniBoss.Width * 1.3, 0.0)); }; 
     466                FixCamera(); 
     467                TriggerAction += delegate { LuoJouniBoss(new Vector(Screen.Left - jouniBoss.Width / 2 - 20, Screen.Bottom + (jouniBoss.Height / 2) - 100), Screen.Left + jouniBoss.Width / 2); }; 
    467468                break; 
    468469            case 18: 
     
    482483    } 
    483484 
    484     void LuoChromaCase() 
     485    void LuoChromaCase(ItemType forceItem) 
    485486    { 
    486487        Mouse.IsCursorVisible = true; 
     
    513514            GameObject cCaseFront = new GameObject(cCaseF); 
    514515 
    515             ChromaCase cCase = new ChromaCase(pItems, cCaseFront, null, 20); 
    516             cCase.Add(new Vector(0.0, Level.Bottom + cCaseFront.Height / 2), 2); 
    517             cCase.ItemReceived += delegate(GameObject o) { GotItemFromCase(o); }; 
    518             cCase.ItemRelativePosition = new Vector((472 - 467.5), (455 - 204)); 
    519             cCase.Start(); 
    520  
     516            if (forceItem == ItemType.Knife) 
     517            { 
     518                ChromaCase cCase = new ChromaCase(pItems, cCaseFront, knife, 20); 
     519                cCase.Add(new Vector(0.0, Level.Bottom + cCaseFront.Height / 2), 2); 
     520                cCase.ItemReceived += delegate(GameObject o) { GotItemFromCase(o); }; 
     521                cCase.ItemRelativePosition = new Vector((472 - 467.5), (455 - 204)); 
     522                cCase.Start(); 
     523            } 
     524            else 
     525            { 
     526                ChromaCase cCase = new ChromaCase(pItems, cCaseFront, avain, 20); 
     527                cCase.Add(new Vector(0.0, Level.Bottom + cCaseFront.Height / 2), 2); 
     528                cCase.ItemReceived += delegate(GameObject o) { GotItemFromCase(o); }; 
     529                cCase.ItemRelativePosition = new Vector((472 - 467.5), (455 - 204)); 
     530                cCase.Start(); 
     531            } 
    521532        }, null); 
    522533    } 
     
    550561        Keyboard.Listen(Key.LeftShift, ButtonState.Released, delegate { walkBackwards = false; }, null); 
    551562 
    552 #if DEBUG 
    553         Keyboard.Listen(Key.C, ButtonState.Pressed, LuoChromaCase, null); 
    554         Mouse.Listen(MouseButton.Left, ButtonState.Pressed, delegate { LuoJouniBoss(Mouse.PositionOnWorld, taistelija.Position); }, null); 
    555         Mouse.IsCursorVisible = true; 
    556 #endif 
    557563    } 
    558564 
     
    599605            kenttaNro = 1; 
    600606 
     607        paaseekoSeuraavaanKenttaan = true; 
     608 
     609        taistelija = null; 
     610        TriggerAction = null; 
     611        tActionTriggered = false; 
     612 
     613 
    601614        ClearAll(); 
    602615        LuoKentta(); 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Attack_to_Agora_mitja.cs

    r6402 r6406  
    1313public partial class Attack_to_Agora : PhysicsGame 
    1414{ 
    15     Image jouniBoss = LoadImage("jouniboss"); 
     15    Image jouniBoss = LoadImage("jouniboss1"); 
    1616    Animation jounibossArrive; 
    1717 
    1818    Elava currentBoss; 
    19     bool bossDefeated = false; 
     19    AssaultRifle currentBossWeapon; 
    2020    const double JOUNI_DMG = 25; 
    2121 
     
    9999    } 
    100100 
    101     void LuoJouniBoss(Vector luomisPaikka, Vector pysahtymisPaikka) 
    102     { 
    103         Elava jouni = new Elava(jouniBoss, 100.0); // 10000 
     101    void LuoJouniBoss(Vector luomisPaikka, double pysahtymisX) 
     102    { 
     103        Elava jouni = new Elava(jouniBoss, 5.0); // 10000 
    104104        jouni.Kuoli += JouniDefeated; 
    105105        jouni.Position = luomisPaikka; 
     
    107107        jouni.Tag = "jouni"; 
    108108        jouni.CollisionIgnoreGroup = 1; 
    109         jouni.Size *= 1.5; 
     109        jouni.IgnoresGravity = true; 
     110        jouni.IgnoresCollisionWith(taistelija); 
    110111        Add(jouni); 
    111112 
     
    114115 
    115116        currentBoss = jouni; 
    116         bossDefeated = false; 
    117117        paaseekoSeuraavaanKenttaan = false; 
    118118 
    119  
    120         PathFollowerBrain bBrain = new PathFollowerBrain(luomisPaikka, pysahtymisPaikka); 
    121         bBrain.Loop = false; 
    122         bBrain.Speed = 1500; 
    123         bBrain.WaypointRadius = jouni.Height / 2; 
    124         jouni.Brain = bBrain; 
    125  
    126         bBrain.ArrivedAtEnd += delegate { ActivateJouni(jouni, bBrain); }; 
    127     } 
    128  
    129     void ActivateJouni(Elava jouni, PathFollowerBrain brain) 
     119        jouni.NeedsUpdateCall = true; 
     120        jouni.IsUpdated = true; 
     121        jouni.Updated += delegate(PhysicsObject j) 
     122        { 
     123            Elava jP = j as Elava; 
     124 
     125            if (jP.X > pysahtymisX) 
     126            { 
     127                ActivateJouni(jP); 
     128                jouni.IsUpdated = false; 
     129                jouni.NeedsUpdateCall = false; 
     130            } 
     131            else jP.Velocity = new Vector(100.0, 0.0); 
     132        }; 
     133    } 
     134 
     135    void ActivateJouni(Elava jouni) 
    130136    { 
    131137        jouni.Animation = jounibossArrive; 
     
    135141 
    136142        jouni.MakeStatic(); 
    137  
    138         brain.Active = false; 
    139         jouni.Brain = null; // nothing personal 
     143        jouni.Stop(); 
    140144 
    141145        AssaultRifle jouninAse = new AssaultRifle(20, 10); 
     
    146150        jouninAse.Tag = "jouninase"; 
    147151        Add(jouninAse); 
    148         jouninAse.Position = jouni.Position + new Vector(jouni.Width / 3, 0.0); 
     152        jouninAse.Position = jouni.Position + new Vector(jouni.Width / 4, 0.0); 
     153        currentBossWeapon = jouninAse; 
    149154 
    150155        Timer ampumisAjastin = new Timer(); 
    151         ampumisAjastin.Interval = 0.2; 
     156        ampumisAjastin.Interval = 1.0; 
    152157        ampumisAjastin.Timeout += delegate  
    153158        { 
     
    162167 
    163168            ammus.IgnoresGravity = true; 
     169            ammus.IsVisible = false; 
     170            ammus.IsUpdated = true; 
     171            ammus.NeedsUpdateCall = true; 
     172            ammus.Updated += delegate(PhysicsObject a) { DrawTracers(a, Color.Red, 0.3, 2); }; 
    164173 
    165174            AddCollisionHandler(ammus, delegate(PhysicsObject a, PhysicsObject p) { 
     
    177186        }; 
    178187 
    179         // ampumisAjastin.Start(); 
     188        ampumisAjastin.Start(); 
    180189    } 
    181190 
    182191    void JouniDefeated() 
    183192    { 
    184         paaseekoSeuraavaanKenttaan = true; 
    185193        currentBoss.Destroy(); 
    186194        currentBoss = null; 
    187195        jounihaviaa.Play(); 
     196        currentBossWeapon.Destroy(); 
     197        currentBossWeapon = null; 
     198 
     199        Timer.SingleShot(2.0, delegate { LuoChromaCase(ItemType.Knife);}); 
    188200    } 
    189201     
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to Agora/Elava.cs

    r6402 r6406  
    88/// PlatformCharacter, jolla on elämälaskuri. 
    99/// </summary> 
    10 public class Elava : PlatformCharacter 
     10public class Elava : PhysicsObject 
    1111{ 
    1212    public DoubleMeter Elamat { get; private set; } 
     
    1515 
    1616    public Elava(double width, double height, double elamat) 
    17         :base(width, height) 
     17        : base(width, height) 
    1818    { 
    1919        Elamat = new DoubleMeter(elamat, 0, elamat); 
    20         Elamat.LowerLimit += delegate  
     20        Elamat.LowerLimit += delegate 
    2121        { 
    2222            if (Kuoli != null) Kuoli(); 
    2323        }; 
     24 
     25        KineticFriction = 0.0; 
     26        Restitution = 0.0; 
     27        CanRotate = false; 
     28 
     29        // This avoids high speeds, particularly when falling. This then avoids 
     30        // going through objects. 
     31        LinearDamping = 0.96; 
     32 
     33 
    2434    } 
    2535 
    2636    public Elava(Image kuva, double elamat) 
    27         :this(kuva.Width, kuva.Height, elamat) 
     37        : this(kuva.Width, kuva.Height, elamat) 
    2838    { 
    2939        this.Image = kuva; 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Attack to Agora/Attack to AgoraContent/Attack to AgoraContent.contentproj

    r6402 r6406  
    398398  </ItemGroup> 
    399399  <ItemGroup> 
    400     <Compile Include="jouniboss.png"> 
    401       <Name>jouniboss</Name> 
    402       <Importer>TextureImporter</Importer> 
    403       <Processor>TextureProcessor</Processor> 
     400    <Compile Include="jounihaviaa.wav"> 
     401      <Name>jounihaviaa</Name> 
     402      <Importer>WavImporter</Importer> 
     403      <Processor>SoundEffectProcessor</Processor> 
    404404    </Compile> 
    405405  </ItemGroup> 
     
    412412  </ItemGroup> 
    413413  <ItemGroup> 
    414     <Compile Include="jounihaviaa.wav"> 
    415       <Name>jounihaviaa</Name> 
    416       <Importer>WavImporter</Importer> 
    417       <Processor>SoundEffectProcessor</Processor> 
     414    <Compile Include="jouniboss1.png"> 
     415      <Name>jouniboss1</Name> 
     416      <Importer>TextureImporter</Importer> 
     417      <Processor>TextureProcessor</Processor> 
    418418    </Compile> 
    419419  </ItemGroup> 
  • 2014/30/MitjaK/Attack to Agora/Attack to Agora/Muokattu Jypeli/Jypeli.csproj

    r6337 r6406  
    6363    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> 
    6464    <CodeAnalysisRuleDirectories>;C:\Programs\Programming\Visual Studio 2010\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 
     65    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 
     66  </PropertyGroup> 
     67  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Visualize|x86'"> 
     68    <DebugSymbols>true</DebugSymbols> 
     69    <OutputPath>bin\x86\Visualize\</OutputPath> 
     70    <DefineConstants>TRACE;DEBUG;WINDOWS;UseDouble;JYPELI</DefineConstants> 
     71    <DocumentationFile>bin\x86\Debug\Jypeli.xml</DocumentationFile> 
     72    <NoStdLib>true</NoStdLib> 
     73    <DebugType>full</DebugType> 
     74    <PlatformTarget>x86</PlatformTarget> 
     75    <CodeAnalysisLogFile>bin\x86\Debug\Jypeli.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile> 
     76    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> 
     77    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> 
     78    <UseVSHostingProcess>false</UseVSHostingProcess> 
     79    <ErrorReport>prompt</ErrorReport> 
     80    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> 
     81    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 
     82    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> 
     83    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 
    6584    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 
    6685  </PropertyGroup> 
Note: See TracChangeset for help on using the changeset viewer.