- Timestamp:
- 2010-07-07 14:50:13 (13 years ago)
- Location:
- 2010/27/alelaho/Insane Darkness
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/alelaho/Insane Darkness/Content/Content.contentproj
r1126 r1140 49 49 </ItemGroup> 50 50 <ItemGroup> 51 <Compile Include="Animaatio1.png">52 <Name>Animaatio1</Name>53 <Importer>TextureImporter</Importer>54 <Processor>TextureProcessor</Processor>55 </Compile>56 51 <Compile Include="Animaatio2.png"> 57 52 <Name>Animaatio2</Name> … … 65 60 </Compile> 66 61 </ItemGroup> 62 <ItemGroup> 63 <Compile Include="Animaatio1.png"> 64 <Name>Animaatio1</Name> 65 <Importer>TextureImporter</Importer> 66 <Processor>TextureProcessor</Processor> 67 </Compile> 68 </ItemGroup> 69 <ItemGroup> 70 <Compile Include="Tulipallo.png"> 71 <Name>Tulipallo</Name> 72 <Importer>TextureImporter</Importer> 73 <Processor>TextureProcessor</Processor> 74 </Compile> 75 </ItemGroup> 76 <ItemGroup> 77 <Compile Include="NINJA.png"> 78 <Name>NINJA</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 </Compile> 82 </ItemGroup> 67 83 </Project> -
2010/27/alelaho/Insane Darkness/Insane Darkness.csproj
r1126 r1140 89 89 <Content Include="Game.ico" /> 90 90 <Content Include="GameThumbnail.png" /> 91 <Content Include="Taso.txt"> 92 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 93 </Content> 91 94 </ItemGroup> 92 95 <ItemGroup> -
2010/27/alelaho/Insane Darkness/Peli.cs
r1126 r1140 4 4 using Jypeli.Assets; 5 5 6 7 6 public class Peli : PhysicsGame 8 7 { 8 9 const double nopeus = 200; 10 const double hyppyVoima = 400; 11 12 const int ruudunLeveys = 50; 13 const int ruudunKorkeus = 50; 9 14 10 15 Vector nopeusOikea = new Vector(200, 0); … … 12 17 13 18 PhysicsObject loota; 19 PhysicsObject ninja; 14 20 15 21 … … 17 23 protected override void Begin() 18 24 { 25 26 LuoKentta(); 19 27 Peliohjaus(); 20 28 PelaajaYksi(); 29 PelaajaKaksi(); 21 30 Gravity = new Vector(0.0, -800.0); 22 Level.CreateBorders(0.0, false); 31 Camera.Zoom(0.80); 32 23 33 24 34 25 35 } 26 36 27 void PelaajaYksi() 37 void PelaajaYksi() //Samurain luonti 28 38 { 29 39 loota = new PhysicsObject(266.0, 688.0); … … 34 44 loota.CanRotate = false; 35 45 Add(loota); 46 Gravity = new Vector(0.0, -800.0); 36 47 } 37 48 38 void Pel iohjaus()49 void PelaajaKaksi() //Ninjan luonti 39 50 { 40 Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-1000, 0)); 41 Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa, null, new Vector(1000, 0)); 42 Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, 1000)); 43 Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -1000)); 51 ninja = new PhysicsObject(107, 326); 52 ninja.X = -100; 53 ninja.Y = 0; 54 ninja.Image = LoadImage("ninja"); 55 ninja.KineticFriction = 0.0; 56 ninja.CanRotate = false; 57 Add(ninja); 58 } 44 59 45 ControllerOne.Listen(Button.LeftStick, ButtonPosition.Up, LiikutaPelaajaa, "Liikuta pelaajaa tattia pyörittämällä."); 60 void Peliohjaus() //Pelaajien 1 ja 2 ohjauskomennot! 61 { 62 Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(-1000, 0)); 63 Keyboard.Listen(Key.Right, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(1000, 0)); 64 Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(0, 4000)); 65 46 66 47 //ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, LiikutaPelaajaa, null, new Vector(-1000, 0)); 48 //ControllerOne.Listen(Button.DPadRight, ButtonState.Down, LiikutaPelaajaa, null, new Vector(1000, 0)); 49 //ControllerOne.Listen(Button.DPadUp, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, 1000)); 50 //ControllerOne.Listen(Button.DPadDown, ButtonState.Down, LiikutaPelaajaa, null, new Vector(0, -1000)); 67 68 69 Keyboard.Listen(Key.A, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(-1000, 0)); 70 Keyboard.Listen(Key.D, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(1000, 0)); 71 Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(0, 4000)); 72 73 74 75 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(-1000, 0)); 76 ControllerOne.Listen(Button.DPadRight, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(1000, 0)); 77 ControllerOne.Listen(Button.DPadUp, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(0, 4000)); 78 79 80 81 82 ControllerTwo.Listen(Button.DPadLeft, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(-1000, 0)); 83 ControllerTwo.Listen(Button.DPadRight, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(1000, 0)); 84 ControllerTwo.Listen(Button.DPadUp, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(0, 4000)); 85 86 87 Vector tatinAsento = ControllerOne.LeftThumbDirection; 88 89 90 ControllerOne.Vibrate(1.5, 1.5, 1.0, 1.0, 1); 91 } 92 93 void LiikutaPelaajaa1(Vector vektori) 94 { 95 loota.Push(vektori); 96 } 97 98 void LiikutaPelaajaa2(Vector vektori) 99 { 100 ninja.Push(vektori); 101 } 102 103 void LuoKentta() 104 { 105 106 TileMap ruudut = TileMap.FromFile("Taso.txt"); 107 ruudut['='] = LuoPalikka; 108 ruudut.Insert(ruudunLeveys, ruudunKorkeus); 51 109 52 110 } 53 111 54 void LiikutaPelaajaa(Vector vektori)112 PhysicsObject LuoPalikka() 55 113 { 56 loota.Push(vektori); 114 PhysicsObject palikka = PhysicsObject.CreateStaticObject(50.0, 50.0); 115 palikka.Shape = Shapes.Rectangle; 116 palikka.Color = Color.Gray; 117 return palikka; 57 118 } 58 119 } 59 120 60 61 62 }63
Note: See TracChangeset
for help on using the changeset viewer.