Changeset 5256
- Timestamp:
- 2014-07-01 22:08:24 (9 years ago)
- Location:
- 2014/27/AleksanteriV
- Files:
-
- 8 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Player.cs
r5254 r5256 9 9 public class Player : PhysicsObject 10 10 { 11 GameObject thrusterEffect; 11 12 public void rotate(double rotSpeed) 12 13 { 13 this.Ang le += Angle.FromDegrees(rotSpeed);14 this.AngularVelocity = rotSpeed; 14 15 } 15 public void thr ottle()16 public void thrusterStart(double speed) 16 17 { 17 this.Push(Vector.FromLengthAndAngle(100, this.Angle + Angle.RightAngle)); 18 this.thrusterEffect.IsVisible = true; 19 this.Push(Vector.FromLengthAndAngle(speed*800, this.Angle + Angle.RightAngle)); 20 } 21 public void thrusterEnd() 22 { 23 this.thrusterEffect.IsVisible = false; 24 //if this.ids, enable ids 18 25 } 19 26 public Player() … … 21 28 { 22 29 this.Image = Proto236b.images["player"]; 23 this.AngularDamping = 0.5; 30 bool IDS = true; //inertial dampening system, katsotaan pistetäänkö ostettavaksi peliin 31 if (IDS == true) 32 { 33 this.LinearDamping = 0.97; 34 } 35 else 36 { 37 this.LinearDamping = 1; 38 } 39 this.AngularDamping = 0.7; 40 41 this.thrusterEffect = new GameObject(40,40); 42 thrusterEffect.Image = Proto236b.images["player_thruster"]; 43 thrusterEffect.IsVisible = false; 44 thrusterEffect.Y -= 20; 45 Add(thrusterEffect); 24 46 } 25 47 } -
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.cs
r5254 r5256 16 16 { 17 17 Keyboard.Listen(Key.Escape, ButtonState.Down, Exit, "Lopeta Peli"); 18 Keyboard.Listen(Key.Up, ButtonState.Down, player.throttle, "Lento"); 19 Keyboard.Listen(Key.Left, ButtonState.Down, player.rotate, "Lento", 2.8); 20 Keyboard.Listen(Key.Right, ButtonState.Down, player.rotate, "Lento", -2.8); 18 Keyboard.Listen(Key.Up, ButtonState.Down, player.thrusterStart, "Lento", 1.0); 19 Keyboard.Listen(Key.Up, ButtonState.Up, player.thrusterEnd, "Lento"); 20 Keyboard.Listen(Key.Down, ButtonState.Down, player.thrusterStart, "Lento", -0.2); 21 Keyboard.Listen(Key.Down, ButtonState.Up, player.thrusterEnd, "Lento"); 22 Keyboard.Listen(Key.Left, ButtonState.Down, player.rotate, "Lento", 4.0); 23 Keyboard.Listen(Key.Right, ButtonState.Down, player.rotate, "Lento", -4.0); 21 24 } 22 25 void LoadAllImages() 23 26 { 24 images["background0"] = LoadImage("graphics/backgrounds/space_background"); 25 images["player"] = LoadImage("graphics/ships/player"); 26 images["tile0"] = LoadImage("graphics/tiles/tile0.png"); 27 images["background0"] = LoadImage("graphics/backgrounds/space_background"); 28 images["player"] = LoadImage("graphics/ships/player"); 29 images["player_thruster"] = LoadImage("graphics/effects/thrusters/thruster0.1"); 30 images["tile0"] = LoadImage("graphics/tiles/tile0.png"); 27 31 } 28 32 void LoadLevel(string level) … … 30 34 ClearAll(); 31 35 Add(this.player); 36 Camera.Follow(this.player); 32 37 AssignKeys(); 33 38 LevelFromImage("graphics/levels/" + level); -
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor.csproj.Debug.cachefile
r5254 r5256 3 3 Content\graphics\ships\player.xnb 4 4 Content\graphics\levels\test.xnb 5 Content\graphics\effects\thrusters\thruster0.1.xnb 6 Content\graphics\effects\thrusters\thruster0.2.xnb -
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/obj/x86/Debug/Protokolla236TrueSurvivor.csproj.FileListAbsolute.txt
r5254 r5256 22 22 D:\Csharp feat jypeli\AleksanteriV2014\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\obj\x86\Debug\Protokolla236TrueSurvivor.pdb 23 23 D:\Csharp feat jypeli\AleksanteriV2014\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\levels\test.xnb 24 D:\Csharp feat jypeli\AleksanteriV2014\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\effects\thrusters\thruster0.1.xnb 25 D:\Csharp feat jypeli\AleksanteriV2014\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\effects\thrusters\thruster0.2.xnb -
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/obj/x86/Debug/cachefile-{5156C658-EF8C-4216-BA6D-9928D133FE72}-targetpath.txt
r5254 r5256 3 3 Content\graphics\ships\player.xnb 4 4 Content\graphics\levels\test.xnb 5 Content\graphics\effects\thrusters\thruster0.1.xnb 6 Content\graphics\effects\thrusters\thruster0.2.xnb -
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivorContent/Protokolla236TrueSurvivorContent.contentproj
r5254 r5256 76 76 </Compile> 77 77 </ItemGroup> 78 <ItemGroup> 79 <Compile Include="graphics\effects\thrusters\thruster0.1.png"> 80 <Name>thruster0.1</Name> 81 <Importer>TextureImporter</Importer> 82 <Processor>TextureProcessor</Processor> 83 </Compile> 84 <Compile Include="graphics\effects\thrusters\thruster0.2.png"> 85 <Name>thruster0.2</Name> 86 <Importer>TextureImporter</Importer> 87 <Processor>TextureProcessor</Processor> 88 </Compile> 89 </ItemGroup> 78 90 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 79 91 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivorContent/obj/x86/Debug/ContentPipeline.xml
r5254 r5256 36 36 <Options>None</Options> 37 37 <Output>D:\Csharp feat jypeli\AleksanteriV2014\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\levels\test.xnb</Output> 38 <Time>2014-07-01T21:19:39.9080298+03:00</Time> 38 <Time>2014-07-01T22:04:07.5999133+03:00</Time> 39 </Item> 40 <Item> 41 <Source>graphics\effects\thrusters\thruster0.1.png</Source> 42 <Name>graphics\effects\thrusters\thruster0.1</Name> 43 <Importer>TextureImporter</Importer> 44 <Processor>TextureProcessor</Processor> 45 <Options>None</Options> 46 <Output>D:\Csharp feat jypeli\AleksanteriV2014\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\effects\thrusters\thruster0.1.xnb</Output> 47 <Time>2014-07-01T20:02:35.7742205+03:00</Time> 48 </Item> 49 <Item> 50 <Source>graphics\effects\thrusters\thruster0.2.png</Source> 51 <Name>graphics\effects\thrusters\thruster0.2</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>D:\Csharp feat jypeli\AleksanteriV2014\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\Protokolla236TrueSurvivor\bin\x86\Debug\Content\graphics\effects\thrusters\thruster0.2.xnb</Output> 56 <Time>2014-07-01T20:02:35.7952206+03:00</Time> 39 57 </Item> 40 58 <BuildSuccessful>true</BuildSuccessful>
Note: See TracChangeset
for help on using the changeset viewer.