- Timestamp:
- 2010-07-29 14:55:37 (13 years ago)
- Location:
- 2010/30/oteimatt/taistelu-jaska/taistelu-jaska
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/30/oteimatt/taistelu-jaska/taistelu-jaska/Content/Content.contentproj
r1389 r1417 132 132 </Compile> 133 133 </ItemGroup> 134 <ItemGroup> 135 <Compile Include="mini führerl1.png"> 136 <Name>mini führerl1</Name> 137 <Importer>TextureImporter</Importer> 138 <Processor>TextureProcessor</Processor> 139 </Compile> 140 </ItemGroup> 141 <ItemGroup> 142 <Compile Include="mini führerl2.png"> 143 <Name>mini führerl2</Name> 144 <Importer>TextureImporter</Importer> 145 <Processor>TextureProcessor</Processor> 146 </Compile> 147 </ItemGroup> 134 148 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 135 149 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/30/oteimatt/taistelu-jaska/taistelu-jaska/POHJA.txt
r1389 r1417 1 = = 2 = = 3 = = 4 = = 5 = = 6 = = 7 = = 8 = = 9 = = 10 = = 11 = = 12 = = 13 = = 14 = = 15 = = 16 = = 17 = = 18 = = 19 = = 20 = = 21 = ==== = 22 = = 23 = = 24 = = 25 = = 26 = = 27 = = 28 = = 29 = = 30 = = 31 = = 32 = = 33 = = 34 = = = 35 = = 36 = = 37 = = 38 = = 39 = = 40 = = 41 = = 42 = = 43 = = 44 = = 45 = = 46 = = 47 = = 48 = = 49 = T = 50 =V V = 51 ====================================================================================================================================================================================== 1 ==================================================== 2 = = 3 = = 4 === ==== === 5 = = 6 = = 7 = == = 8 = = 9 = ======= ========= 10 = = 11 = = 12 = ===== = 13 = = 14 = = 15 = T = 16 =V V= 17 ==================================================== -
2010/30/oteimatt/taistelu-jaska/taistelu-jaska/Peli.cs
r1389 r1417 14 14 15 15 PlatformCharacter pelaaja1; 16 PlatformCharacter miniführer;16 //PlatformCharacter miniführer; 17 17 18 18 Image[] jaskaKuvat = LoadImages("taistelu-jaska", "taistelu-jaska1"); … … 36 36 protected override void Begin() 37 37 { 38 //pelaaja1.FacingDirection == Direction.Left 39 38 40 Gravity = new Vector(0, -1000); 39 41 … … 42 44 luoKentta(); 43 45 lisaaNappaimet(); 46 47 Timer ajastin = new Timer(); 48 ajastin.Interval = 5.0; 49 ajastin.Trigger += lisaaMiniführer; 50 ajastin.Start(); 44 51 45 52 Camera.Follow(pelaaja1); … … 59 66 ruudut['='] = LuoSeina; 60 67 ruudut['T'] = LuoTaisteluJaska; 61 //ruudut['V'] = LuoVihollinen;68 ruudut['V'] = luoMiniFührer; 62 69 ruudut.Insert(ruudunLeveys, ruudunKorkeus); 63 70 … … 71 78 return taso; 72 79 } 80 81 82 void lisaaMiniführer(Timer ajastin) 83 { 84 PhysicsObject vihollinen = luoMiniFührer(); 85 if (RandomGen.NextBool()) 86 { 87 vihollinen.Position = new Vector(Level.Right - 50, -200); 88 } 89 else 90 { 91 vihollinen.Position = new Vector(Level.Left + 50, -200); 92 } 93 Add(vihollinen); 94 } 95 96 73 97 PhysicsObject luoMiniFührer() 74 98 { 75 miniführer = new PlatformCharacter(50, 90, Shapes.Circle);99 PlatformCharacter miniführer = new PlatformCharacter(50, 90, Shapes.Circle); 76 100 miniführer.Mass = 4.0; 77 101 miniführer.Color = Color.Black; 78 miniführer.RightIdleAnimation = new Animation(LoadImages("mini führer "));102 miniführer.RightIdleAnimation = new Animation(LoadImages("mini führer juoksu 1", "mini führer juoksu 2")); 79 103 miniführer.RightWalkingAnimation = new Animation(miniführerkuvat); 80 104 miniführerkuvatpeilattu = Image.Mirror(miniführerkuvat); 81 105 miniführer.LeftWalkingAnimation = new Animation(miniführerkuvatpeilattu); 106 107 FollowerBrain seuraajanAivot = new FollowerBrain(); 108 seuraajanAivot.Target = pelaaja1; 109 miniführer.Brain = seuraajanAivot; 110 111 Timer aikaLaskuri = new Timer(); 112 aikaLaskuri.Interval = 0.1; 113 aikaLaskuri.Trigger += Viholliskavely; 114 aikaLaskuri.Tag = miniführer; 115 //Add(aikaLaskuri); 116 aikaLaskuri.Start(); 82 117 return (PhysicsObject)miniführer; 83 118 } 119 120 void Viholliskavely(Timer ajastin) 121 { 122 PlatformCharacter vihollinen = ((PlatformCharacter)ajastin.Tag); 123 if (vihollinen.Velocity.X < 0) vihollinen.Animation = vihollinen.LeftWalkingAnimation; 124 if (vihollinen.Velocity.X > 0) vihollinen.Animation = vihollinen.RightWalkingAnimation; 125 if (Vector.Distance(vihollinen.Position 126 127 } 128 129 84 130 PhysicsObject LuoTaisteluJaska() 85 131 { … … 113 159 Add(pelaaja1); 114 160 } 115 161 116 162 void lisaaNappaimet() 117 163 { … … 133 179 void lyo(PlatformCharacter hahmo) 134 180 { 135 hahmo.Animation = new Animation(jaskaHyokkaa); 181 if (hahmo.FacingDirection == Direction.Left) 182 { 183 hahmo.Animation = new Animation(jaskaHyokkaaPeilattu); 184 } 185 if (hahmo.FacingDirection == Direction.Right) 186 { 187 hahmo.Animation = new Animation(jaskaHyokkaa); 188 } 189 136 190 hahmo.Animation.Start(1); 137 191 } -
2010/30/oteimatt/taistelu-jaska/taistelu-jaska/taistelu-jaska.csproj
r1389 r1417 132 132 </BootstrapperPackage> 133 133 </ItemGroup> 134 <ItemGroup>135 <None Include="ClassDiagram1.cd" />136 </ItemGroup>137 134 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 138 135 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
Note: See TracChangeset
for help on using the changeset viewer.