Changeset 1177
- Timestamp:
- 2010-07-08 11:30:58 (13 years ago)
- Location:
- 2010/27/alelaho/Insane Darkness
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/alelaho/Insane Darkness/Content/Content.contentproj
r1140 r1177 68 68 </ItemGroup> 69 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 70 <Compile Include="NINJA.png"> 78 71 <Name>NINJA</Name> -
2010/27/alelaho/Insane Darkness/Peli.cs
r1140 r1177 3 3 using Jypeli.ScreenObjects; 4 4 using Jypeli.Assets; 5 using Jypeli.Widgets; 5 6 6 7 public class Peli : PhysicsGame … … 29 30 PelaajaKaksi(); 30 31 Gravity = new Vector(0.0, -800.0); 31 Camera.Zoom(0.80); 32 Camera.Zoom(0.50); 33 LuoAikaLaskuri(); 34 Camera.StayInLevel = false; 32 35 33 34 35 36 } 36 37 … … 43 44 loota.KineticFriction = 0.0; 44 45 loota.CanRotate = false; 46 loota.Mass = 1.0; 45 47 Add(loota); 46 Gravity = new Vector(0.0, -800.0);48 47 49 } 48 50 49 51 void PelaajaKaksi() //Ninjan luonti 50 52 { 51 ninja = new PhysicsObject( 107, 326);53 ninja = new PhysicsObject(214, 652); 52 54 ninja.X = -100; 53 55 ninja.Y = 0; … … 62 64 Keyboard.Listen(Key.Left, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(-1000, 0)); 63 65 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));66 Keyboard.Listen(Key.Up, ButtonState.Pressed, HypytaPelaajaa1, null, new Vector(0, 1500)); 65 67 66 68 … … 69 71 Keyboard.Listen(Key.A, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(-1000, 0)); 70 72 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));73 Keyboard.Listen(Key.W, ButtonState.Pressed, LiikutaPelaajaa2, null, new Vector(0, 1500)); 72 74 73 75 … … 75 77 ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, LiikutaPelaajaa1, null, new Vector(-1000, 0)); 76 78 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));79 ControllerOne.Listen(Button.DPadUp, ButtonState.Pressed, LiikutaPelaajaa1, null, new Vector(0, 1500)); 78 80 79 81 ControllerOne.ListenAnalog(AnalogControl.LeftStick, 0.1, LiikutaPelaajaa, "Liikuta pelaajaa tattia pyörittämällä."); 80 82 81 83 82 84 ControllerTwo.Listen(Button.DPadLeft, ButtonState.Down, LiikutaPelaajaa2, null, new Vector(-1000, 0)); 83 85 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)); 86 ControllerTwo.Listen(Button.DPadUp, ButtonState.Pressed, LiikutaPelaajaa2, null, new Vector(0, 1500)); 87 88 ControllerTwo.ListenAnalog(AnalogControl.LeftStick, 0.1, LiikutaPelaajaaX2, "Liikuta pelaajaa tattia pyörittämällä."); 85 89 86 90 87 Vector tatinAsento = ControllerOne.LeftThumbDirection;88 89 90 ControllerOne.Vibrate(1.5, 1.5, 1.0, 1.0, 1);91 91 } 92 92 … … 107 107 ruudut['='] = LuoPalikka; 108 108 ruudut.Insert(ruudunLeveys, ruudunKorkeus); 109 109 110 110 } 111 111 … … 117 117 return palikka; 118 118 } 119 120 121 122 DoubleMeter alaspainLaskuri; 123 124 void LuoAikaLaskuri() 125 { 126 alaspainLaskuri = new DoubleMeter(120); 127 128 Timer aikaLaskuri = new Timer(); 129 aikaLaskuri.Interval = 0.1; 130 aikaLaskuri.Trigger += LaskeAlaspain; 131 Add(aikaLaskuri); 132 aikaLaskuri.Start(); 133 134 Label aikaNaytto = new Label(); 135 aikaNaytto.TextColor = Color.White; 136 aikaNaytto.DecimalPlaces = 0; 137 aikaNaytto.BindTo(alaspainLaskuri); 138 Add(aikaNaytto); 139 } 140 141 void LaskeAlaspain(Timer timer) 142 { 143 alaspainLaskuri.Value -= 0.1; 144 145 if (alaspainLaskuri.Value <= 0) 146 { 147 MessageDisplay.Add("TIME"); 148 timer.Stop(); 149 150 // täydennä mitä tapahtuu, kun aika loppuu 151 152 } 153 } 154 155 void LiikutaPelaajaa(AnalogState tatinTila) 156 { 157 Vector tatinAsento = tatinTila.StateVector; 158 tatinAsento.X = tatinAsento.X * 1000; 159 tatinAsento.Y = tatinAsento.Y * 1000; 160 loota.Push(tatinAsento); 161 } 162 163 void LiikutaPelaajaaX2(AnalogState tatinTila) 164 { 165 Vector tatinAsento = tatinTila.StateVector; 166 tatinAsento.X = tatinAsento.X * 1000; 167 tatinAsento.Y = tatinAsento.Y * 1000; 168 ninja.Push(tatinAsento); 169 } 170 171 void HypytaPelaajaa1(Vector pomppu1) 172 { 173 if (loota.Y - 400 < Level.Bottom) 174 { 175 loota.Hit(pomppu1); 176 } 177 } 178 179 void HypytaPelaajaaX2(Vector pomppu1) 180 { 181 if (ninja.Y - 318 < Level.Bottom) 182 { 183 ninja.Hit(pomppu1); 184 } 185 } 186 187 188 189 190 191 119 192 } 120 193 -
2010/27/alelaho/Insane Darkness/Taso.txt
r1141 r1177 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 ================================ 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 =======================================================
Note: See TracChangeset
for help on using the changeset viewer.