Changeset 599
- Timestamp:
- 2010-06-09 11:57:01 (13 years ago)
- Location:
- 2010/23/jealmaki/Save The Civilians
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/jealmaki/Save The Civilians/Content/Content.contentproj
r558 r599 1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> 2 2 <PropertyGroup> 3 3 <ProjectGuid>c64ef9ad-40ab-4916-9f4a-7f3a5d3919dc</ProjectGuid> … … 18 18 <XnaPlatform>Windows</XnaPlatform> 19 19 </PropertyGroup> 20 <ItemGroup>20 <ItemGroup> 21 21 <Compile Include="norsu.png"> 22 22 <Name>norsu</Name> … … 47 47 <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d" /> 48 48 </ItemGroup> 49 <ItemGroup> 50 <Compile Include="Hymiö.png"> 51 <Name>Hymiö</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 </Compile> 55 </ItemGroup> 49 56 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 50 57 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2010/23/jealmaki/Save The Civilians/Peli.cs
r558 r599 10 10 { 11 11 const double nopeus = 200; 12 const double hyppyVoima = 40;12 const double hyppyVoima = 5000; 13 13 14 14 IntMeter pisteLaskuri; … … 22 22 protected override void Begin() 23 23 { 24 PhysicsObject pallo = new PhysicsObject( 10.0, 10.0);25 Add( pallo );26 24 kenttaNro = 0; 27 25 Level.Width = 2000; 28 26 Level.Height = 1000; 29 27 28 29 30 31 30 32 // Luodaan pistelaskuri 31 33 pisteLaskuri = new IntMeter(0); … … 46 48 seuraavaKentta(); 47 49 MessageDisplay.Add("Etsi olio!"); 50 } 51 52 void LuoKolmio(double leveys, double korkeus, int x, int y) 53 { 54 PhysicsObject kolmio = new PhysicsObject(leveys, korkeus); 55 kolmio.Shape = Shapes.Triangle; 56 kolmio.X = x; 57 kolmio.Y = y; 58 Add(kolmio); 48 59 } 49 60 … … 67 78 { 68 79 Level.CreateBorders(); 69 Level.Background.CreateGradient(Color.Green, Color.Red); 70 71 lisaaTaso(-200, -350); 80 Level.Background.CreateGradient(Color.Green, Color.Black); 81 lisaaTaso(100, -300); 82 lisaaTaso(100, -200); 83 lisaaTaso(100, -100); 84 lisaaTaso(-100, -300); 85 lisaaTaso(-300, -150); 86 lisaaTaso(0, -300); 72 87 lisaaTaso(0, -200); 73 88 lisaaTaso(0, -100); 89 lisaaTaso(100, -500); 90 lisaaTaso(100, -400); 74 91 lisaaMaali(); 75 92 lisaaPelaajat(); 93 lisaaEsine(); 94 } 95 96 void lisaaEsine() 97 { 98 PhysicsObject esine = new PhysicsObject(20, 10); 99 esine.Shape = Shapes.Rectangle; 100 101 Add(esine); 76 102 } 77 103 78 104 void lisaaTaso(double x, double y) 79 105 { 80 PhysicsObject taso = PhysicsObject.CreateStaticObject(100, 30);81 taso.Color = Color. Green;106 PhysicsObject taso = PhysicsObject.CreateStaticObject(100, 100); 107 taso.Color = Color.Brown; 82 108 taso.X = x; 83 109 taso.Y = y; 84 110 Add(taso); 85 111 } 86 112 void lisaaTaso1(double x, double y) 113 { 114 PhysicsObject taso = PhysicsObject.CreateStaticObject(500,10); 115 taso.Color = Color.Brown; 116 taso.X = x; 117 taso.Y = y; 118 Add(taso); 119 } 120 87 121 void lisaaPelaajat() 88 122 { 89 123 pelaaja1 = new PlatformCharacter(40, 40); 124 pelaaja1.Image = LoadImage("hymiö"); 90 125 pelaaja1.Mass = 4.0; 91 126 //pelaaja1.; 92 pelaaja1.X = 100;127 pelaaja1.X = -100; 93 128 pelaaja1.Y = Level.Bottom + 120; 94 129 … … 100 135 void lisaaMaali() 101 136 { 102 PhysicsObject maali = PhysicsObject.CreateStaticObject(50, 50, Shapes.Circle);103 maali.Tag = "maali";104 maali.IgnoresCollisionResponse = true;105 maali.X = 30;106 maali.Y = -60;107 137 108 Add(maali);109 138 } 110 139 … … 118 147 Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja1, hyppyVoima); 119 148 120 lisaaGamePadNappaimet(ControllerOne);121 149 } 122 150 123 void lisaaGamePadNappaimet(GamePad controller) 124 { 125 controller.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 126 127 controller.Listen(Button.DPadLeft, ButtonState.Down, liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 128 controller.Listen(Button.DPadRight, ButtonState.Down, liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 129 controller.Listen(Button.A, ButtonState.Pressed, hyppaa, "Pelaaja hyppää", pelaaja1, hyppyVoima); 130 } 151 152 153 154 131 155 132 156 void liikuta(PlatformCharacter hahmo, double nopeus)
Note: See TracChangeset
for help on using the changeset viewer.