- Timestamp:
- 2010-06-09 15:00:18 (13 years ago)
- Location:
- 2010/23/jealmaki/Save The Civilians
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/jealmaki/Save The Civilians/Content/Content.contentproj
r599 r637 54 54 </Compile> 55 55 </ItemGroup> 56 <ItemGroup> 57 <Compile Include="Raha.png"> 58 <Name>Raha</Name> 59 <Importer>TextureImporter</Importer> 60 <Processor>TextureProcessor</Processor> 61 </Compile> 62 </ItemGroup> 56 63 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 57 64 <!-- 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
r599 r637 1 1 using System; 2 using System.Collections.Generic; 2 3 using Jypeli; 3 4 using Jypeli.ScreenObjects; … … 11 12 const double nopeus = 200; 12 13 const double hyppyVoima = 5000; 14 15 const int ruudunLeveys = 50; 16 const int ruudunKorkeus = 50; 13 17 14 18 IntMeter pisteLaskuri; … … 79 83 Level.CreateBorders(); 80 84 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); 87 lisaaTaso(0, -200); 88 lisaaTaso(0, -100); 89 lisaaTaso(100, -500); 90 lisaaTaso(100, -400); 85 86 var merkit = new Dictionary<char, ObjectCreator>(); 87 merkit['x'] = LuoPalikka; 88 merkit['d'] = LuoOlio; 89 merkit['r'] = LuoRaha; 91 90 lisaaMaali(); 92 91 lisaaPelaajat(); 93 92 lisaaEsine(); 94 93 } 95 94 95 PhysicsObject LuoOlio() 96 { 97 PhysicsObject olio = PhysicsObject.CreateStaticObject(30.0, 30.0); 98 olio.Shape = Shapes.Rectangle; 99 olio.Color = Color.Black; 100 return olio; 101 102 } 103 104 PhysicsObject LuoPalikka() 105 { 106 PhysicsObject palikka = PhysicsObject.CreateStaticObject(50.0, 50.0); 107 palikka.Shape = Shapes.Rectangle; 108 palikka.Color = Color.Gray; 109 return palikka; 110 111 } 112 113 PhysicsObject LuoRaha() 114 { 115 PhysicsObject Raha = PhysicsObject.CreateStaticObject(50.0, 50.0); 116 Raha.Shape = Shapes.Rectangle; 117 Raha.Color = Color.Green; 118 Raha.Image = LoadImage("Raha"); 119 return Raha; 120 } 121 96 122 void lisaaEsine() 97 123 { 98 124 PhysicsObject esine = new PhysicsObject(20, 10); 99 125 esine.Shape = Shapes.Rectangle; 126 esine.Image = LoadImage("Raha"); 100 127 101 128 Add(esine); 102 129 } 130 103 131 104 void lisaaTaso(double x, double y) 105 { 106 PhysicsObject taso = PhysicsObject.CreateStaticObject(100, 100); 107 taso.Color = Color.Brown; 108 taso.X = x; 109 taso.Y = y; 110 Add(taso); 111 } 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 } 132 120 133 121 134 void lisaaPelaajat() … … 129 142 130 143 AddCollisionHandler(pelaaja1, osuiMaaliin); 131 144 AddCollisionHandler(pelaaja1, osuiRahaan); 132 145 Add(pelaaja1); 133 146 } 147 void osuiRahaan(PhysicsObject Pelaaja1, PhysicsObject Raha); 134 148 135 149 void lisaaMaali() … … 143 157 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu pelistä"); 144 158 145 Keyboard.Listen(Key. Left, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus);146 Keyboard.Listen(Key. Right, ButtonState.Down, liikuta, "Liikkuu oikealle", pelaaja1, nopeus);147 Keyboard.Listen(Key. Up, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja1, hyppyVoima);159 Keyboard.Listen(Key.A, ButtonState.Down, liikuta, "Liikkuu vasemmalle", pelaaja1, -nopeus); 160 Keyboard.Listen(Key.D, ButtonState.Down, liikuta, "Liikkuu oikealle", pelaaja1, nopeus); 161 Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "Hyppää", pelaaja1, hyppyVoima); 148 162 149 163 } -
2010/23/jealmaki/Save The Civilians/Save The Civilians.csproj
r558 r637 89 89 <Content Include="Game.ico" /> 90 90 <Content Include="GameThumbnail.png" /> 91 <Content Include="TextFile1.txt" /> 91 92 </ItemGroup> 92 93 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.