Changeset 3290 for 2012/26/EliasY
- Timestamp:
- 2012-06-27 15:03:49 (9 years ago)
- Location:
- 2012/26/EliasY/test1
- Files:
-
- 8 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/26/EliasY/test1/test1/test1/bin/x86/Debug/kentta.txt
r3247 r3290 24 24 = = 25 25 = = 26 = z=26 = z = 27 27 = = 28 28 = = -
2012/26/EliasY/test1/test1/test1/kentta.txt
r3247 r3290 24 24 = = 25 25 = = 26 = z=26 = z = 27 27 = = 28 28 = = -
2012/26/EliasY/test1/test1/test1/obj/x86/Debug/ContentPipeline-{BFB255A8-81A7-4A34-AF08-16AEFBF6C543}.xml
r3233 r3290 3 3 <Asset Type="Pipeline:BuildItemCollection"> 4 4 <Item> 5 <Source>pimeys .png</Source>6 <Name>pimeys </Name>5 <Source>pimeys2.png</Source> 6 <Name>pimeys2</Name> 7 7 <Importer>TextureImporter</Importer> 8 8 <Processor>TextureProcessor</Processor> 9 9 <Options>None</Options> 10 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pimeys.xnb</Output> 11 <Time>2012-06-26T14:52:20.9459765+03:00</Time> 10 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pimeys2.xnb</Output> 11 <Time>2012-06-27T10:30:42.619398+03:00</Time> 12 </Item> 13 <Item> 14 <Source>lattia.jpg</Source> 15 <Name>lattia</Name> 16 <Importer>TextureImporter</Importer> 17 <Processor>TextureProcessor</Processor> 18 <Options>None</Options> 19 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\lattia.xnb</Output> 20 <Time>2012-06-27T10:33:38.409198+03:00</Time> 21 </Item> 22 <Item> 23 <Source>seina.jpg</Source> 24 <Name>seina</Name> 25 <Importer>TextureImporter</Importer> 26 <Processor>TextureProcessor</Processor> 27 <Options>None</Options> 28 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\seina.xnb</Output> 29 <Time>2012-06-27T10:54:38.854198+03:00</Time> 30 </Item> 31 <Item> 32 <Source>zombi_1.png</Source> 33 <Name>zombi_1</Name> 34 <Importer>TextureImporter</Importer> 35 <Processor>TextureProcessor</Processor> 36 <Options>None</Options> 37 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\zombi_1.xnb</Output> 38 <Time>2012-06-27T11:54:36.418598+03:00</Time> 39 </Item> 40 <Item> 41 <Source>zombi_2.png</Source> 42 <Name>zombi_2</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\zombi_2.xnb</Output> 47 <Time>2012-06-27T11:52:59.901398+03:00</Time> 48 </Item> 49 <Item> 50 <Source>pelaaja_1.png</Source> 51 <Name>pelaaja_1</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pelaaja_1.xnb</Output> 56 <Time>2012-06-27T13:36:42.750798+03:00</Time> 57 </Item> 58 <Item> 59 <Source>pelaaja_2.png</Source> 60 <Name>pelaaja_2</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pelaaja_2.xnb</Output> 65 <Time>2012-06-27T13:36:48.840798+03:00</Time> 66 </Item> 67 <Item> 68 <Source>ase.png</Source> 69 <Name>ase</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\ase.xnb</Output> 74 <Time>2012-06-27T13:17:09.281798+03:00</Time> 12 75 </Item> 13 76 <BuildSuccessful>true</BuildSuccessful> -
2012/26/EliasY/test1/test1/test1/obj/x86/Debug/test1.csproj.FileListAbsolute.txt
r3233 r3290 8 8 C:\MyTemp\EliasY\test1\test1\test1\obj\x86\Debug\test1.exe 9 9 C:\MyTemp\EliasY\test1\test1\test1\obj\x86\Debug\test1.pdb 10 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pimeys.xnb 10 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pimeys2.xnb 11 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\lattia.xnb 12 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\seina.xnb 13 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\zombi_1.xnb 14 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\zombi_2.xnb 15 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pelaaja_1.xnb 16 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\pelaaja_2.xnb 17 C:\MyTemp\EliasY\test1\test1\test1\bin\x86\Debug\Content\ase.xnb -
2012/26/EliasY/test1/test1/test1/test1.cs
r3247 r3290 14 14 AssaultRifle kivaari; 15 15 GameObject pimeys; 16 16 IntMeter pelaajanterveys; 17 17 public override void Begin() 18 18 { … … 20 20 LuoKentta(); 21 21 Pimenna(); 22 // LuoViholliset();23 22 AsetaOhjaimet(); 24 23 24 LuoNaytto(500, 450, "Terveys: ", pelaajanterveys); 25 LuoNaytto(300, 450, "Ammukset: ", kivaari.Ammo); 25 26 Camera.Follow(pelaaja); 26 27 Camera.ZoomFactor = 1.7; 27 28 /*todo: 28 * Pimeyden tummennus29 29 * aseet 30 30 * vihut 31 * pistecountteri32 * tekstuurit33 31 * mapin parantelu 34 * wavet35 32 */ 36 33 } 37 34 35 protected override void Update(Time time) 36 { 37 pimeys.Position = pelaaja.Position; 38 pimeys.Angle = pelaaja.Angle + Angle.FromDegrees(-90); 39 //zombi.Angle = pelaaja.Angle.Degrees; 40 base.Update(time); 41 } 42 38 43 void AsetaOhjaimet() 39 44 { 40 Keyboard.Listen(Key.W, ButtonState.Down, Liiku, null, 0.0, 30.0);41 Keyboard.Listen(Key.A, ButtonState.Down, Liiku, null, - 30.0, 0.0);42 Keyboard.Listen(Key.S, ButtonState.Down, Liiku, null, 0.0, - 30.0);43 Keyboard.Listen(Key.D, ButtonState.Down, Liiku, null, 30.0, 0.0);45 Keyboard.Listen(Key.W, ButtonState.Down, Liiku, null, 0.0, 45.0); 46 Keyboard.Listen(Key.A, ButtonState.Down, Liiku, null, -45.0, 0.0); 47 Keyboard.Listen(Key.S, ButtonState.Down, Liiku, null, 0.0, -45.0); 48 Keyboard.Listen(Key.D, ButtonState.Down, Liiku, null, 45.0, 0.0); 44 49 45 50 Keyboard.Listen(Key.Left, ButtonState.Down, Kaanny, null, 2.0); … … 55 60 56 61 Keyboard.Listen(Key.Up, ButtonState.Down, Ammu, null); 62 63 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, null); 57 64 } 58 65 … … 63 70 if (ammus != null) 64 71 { 72 ammus.Position = pelaaja.Position + Vector.FromLengthAndAngle(25, pelaaja.Angle); 65 73 ammus.Size /= 3; 74 ammus.Mass = 30; 75 AddCollisionHandler<PhysicsObject, Zombi>(ammus, "zombi", ViholliseenOsuu); 76 AddCollisionHandler<PhysicsObject, Zombi>(ammus, "zombi", CollisionHandler.DestroyObject); 66 77 } 67 //reload-animaatio tähän?68 78 } 69 79 … … 71 81 { 72 82 pelaaja.AngularVelocity = suunta; 73 pimeys.Angle = pelaaja.Angle + Angle.FromDegrees(-90);74 83 } 75 84 … … 83 92 Vector pulssi = new Vector(x, y); 84 93 pelaaja.Velocity = pulssi; 85 pimeys.Position = pelaaja.Position;86 94 } 87 95 … … 94 102 { 95 103 pelaaja = new PhysicsObject(30, 30); 96 //poista pelaajan väri kun sillä on tekstuuri97 pelaaja.Color = Color.Red;98 104 pelaaja.X = 550; 99 105 pelaaja.Y = -550; 100 106 pelaaja.Mass = 10; 101 107 pelaaja.Angle = Angle.FromDegrees(90); 102 103 kivaari = new AssaultRifle(80, 20); 104 kivaari.TimeBetweenUse = TimeSpan.FromMilliseconds(700); 105 108 pelaaja.MomentOfInertia = 10000; 109 Animation pelaajaanimation = new Animation(LoadImage("pelaaja_1"), LoadImage("pelaaja_2")); 110 pelaajaanimation.FPS = 5; 111 pelaaja.Animation = pelaajaanimation; 112 pelaajaanimation.Start(); 113 AddCollisionHandler(pelaaja, "zombi", PelaajaanOsuu); 114 kivaari = new AssaultRifle(30, 7.5); 115 kivaari.X = 14; 116 kivaari.Image = LoadImage("ase"); 117 kivaari.TimeBetweenUse = TimeSpan.FromMilliseconds(1000); 118 kivaari.Ammo.Value = 30; 119 120 pelaajanterveys = new IntMeter(5, 0, 5); 106 121 pelaaja.Add(kivaari); 107 122 Add(pelaaja); … … 110 125 void Pimenna() 111 126 { 112 pimeys = new GameObject(new Animation(LoadImage("pimeys ")));113 pimeys.Width = 850;114 pimeys.Height = 850;127 pimeys = new GameObject(new Animation(LoadImage("pimeys2"))); 128 pimeys.Width = 1050; 129 pimeys.Height = 1050; 115 130 pimeys.Position = pelaaja.Position; 116 117 Add(pimeys); 131 Add(pimeys, 1); 118 132 } 119 133 120 134 void LuoKentta() 121 135 { 122 Level.BackgroundColor = Color.Black; 136 Level.BackgroundColor = Color.DarkBrown; 137 //Level.Background.Image = LoadImage("lattia"); 138 //Level.Background.TextureWrapSize = new Vector(100, 100); 139 //Level.Background.FitToLevel(); 123 140 // TODO: taustakuva pelin pohjaksi 124 141 TileMap ruudut = TileMap.FromFile("kentta.txt"); … … 130 147 PhysicsObject LuoZombi() 131 148 { 132 PhysicsObject zombi = new PhysicsObject(35.0, 35.0); 133 //zombi.Shape = Shape.FromImage(LoadImage("zombi")); 134 //zombi.Image = LoadImage("zombi"); 149 Zombi zombi = new Zombi(35.0, 35.0); 150 zombi.Tag = "zombi"; 135 151 FollowerBrain zombinaivot = new FollowerBrain(pelaaja); 136 152 zombinaivot.DistanceFar = 600; 153 zombinaivot.DistanceToTarget.Changed += delegate { zombi.Angle = (zombi.Position - zombinaivot.CurrentTarget.Position).Angle - Angle.RightAngle; }; 154 zombinaivot.Speed = 50; 137 155 zombi.Brain = zombinaivot; 156 Animation zombianimation = new Animation(LoadImage("zombi_1"), LoadImage("zombi_2")); 157 zombi.Animation = zombianimation; 158 zombianimation.FPS = 5; 159 zombianimation.Start(); 138 160 return zombi; 139 161 } … … 142 164 { 143 165 PhysicsObject seina = PhysicsObject.CreateStaticObject(50.0, 50.0); 166 seina.Image = LoadImage("seina"); 144 167 return seina; 145 168 } 169 170 void PelaajaanOsuu(PhysicsObject tormaaja, PhysicsObject kohde) 171 { 172 pelaajanterveys.AddValue(-1); 173 pelaajanterveys.LowerLimit += delegate { pelaaja.Destroy(); MessageDisplay.Add("Kuolit!"); }; 174 } 175 176 void ViholliseenOsuu(PhysicsObject tormaaja, Zombi kohde) 177 { 178 kohde.elamaLaskuri.Value--; 179 } 180 181 void LuoNaytto(double x, double y, String title, IntMeter mittari) 182 { 183 Label naytto = new Label(); 184 naytto.BindTo(mittari); 185 naytto.X = x; 186 naytto.Title = title; 187 naytto.Y = y; 188 naytto.TextColor = Color.Green; 189 naytto.BorderColor = Color.Green; 190 naytto.Color = Color.Black; 191 Add(naytto); 192 193 } 146 194 } 195 196 class Zombi : PhysicsObject 197 { 198 public IntMeter elamaLaskuri = new IntMeter(3, 0, 3); 199 200 public Zombi(double leveys, double korkeus) 201 : base(leveys, korkeus) 202 { 203 elamaLaskuri.LowerLimit += delegate { this.Destroy(); }; 204 } 205 } -
2012/26/EliasY/test1/test1/test1/test1.csproj.Debug.cachefile
r3233 r3290 1 Content\pimeys.xnb 1 Content\pimeys2.xnb 2 Content\lattia.xnb 3 Content\seina.xnb 4 Content\zombi_1.xnb 5 Content\zombi_2.xnb 6 Content\pelaaja_1.xnb 7 Content\pelaaja_2.xnb 8 Content\ase.xnb 2 9 kentta.txt -
2012/26/EliasY/test1/test1/test1Content/test1Content.contentproj
r3233 r3290 45 45 </ItemGroup> 46 46 <ItemGroup> 47 <Compile Include="pimeys.png"> 48 <Name>pimeys</Name> 47 <Compile Include="pimeys2.png"> 48 <Name>pimeys2</Name> 49 <Importer>TextureImporter</Importer> 50 <Processor>TextureProcessor</Processor> 51 </Compile> 52 </ItemGroup> 53 <ItemGroup> 54 <Compile Include="lattia.jpg"> 55 <Name>lattia</Name> 56 <Importer>TextureImporter</Importer> 57 <Processor>TextureProcessor</Processor> 58 </Compile> 59 </ItemGroup> 60 <ItemGroup> 61 <Compile Include="seina.jpg"> 62 <Name>seina</Name> 63 <Importer>TextureImporter</Importer> 64 <Processor>TextureProcessor</Processor> 65 </Compile> 66 </ItemGroup> 67 <ItemGroup> 68 <Compile Include="zombi_1.png"> 69 <Name>zombi_1</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 </Compile> 73 <Compile Include="zombi_2.png"> 74 <Name>zombi_2</Name> 75 <Importer>TextureImporter</Importer> 76 <Processor>TextureProcessor</Processor> 77 </Compile> 78 </ItemGroup> 79 <ItemGroup> 80 <Compile Include="pelaaja_1.png"> 81 <Name>pelaaja_1</Name> 82 <Importer>TextureImporter</Importer> 83 <Processor>TextureProcessor</Processor> 84 </Compile> 85 <Compile Include="pelaaja_2.png"> 86 <Name>pelaaja_2</Name> 87 <Importer>TextureImporter</Importer> 88 <Processor>TextureProcessor</Processor> 89 </Compile> 90 </ItemGroup> 91 <ItemGroup> 92 <Compile Include="ase.png"> 93 <Name>ase</Name> 49 94 <Importer>TextureImporter</Importer> 50 95 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.