Changeset 2028 for 2011/24/JuusoP
- Timestamp:
- 2011-06-15 15:00:50 (11 years ago)
- Location:
- 2011/24/JuusoP
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/24/JuusoP/green Peace/green Peace/green Peace/Peli.cs
r1990 r2028 1 using System; 2 using System.Collections.Generic; 3 using Jypeli; 4 using Jypeli.Assets; 1 using Jypeli; 5 2 using Jypeli.Controls; 6 using Jypeli.Effects;7 using Jypeli.Widgets;8 3 9 4 public class Peli : PhysicsGame 10 5 { 6 Vector nopeusYlos = new Vector(0, 200); 7 Vector nopeusAlas = new Vector(0, -200); 8 Vector nopeusVasemmalle = new Vector(-200, 0); 9 Vector nopeusOikealle = new Vector(200, 0); 10 11 PhysicsObject hiirulainen; 12 13 Image hiiru = LoadImage("Hiiru"); 11 14 12 15 public override void Begin() 13 16 { 14 15 17 LuoKenttä(); 18 AsetaOhjaimet(); 16 19 } 17 20 18 21 void LuoKenttä() 19 22 { 20 //PhysicsObject hiirulainen = new PhysicsObject(20, 35);21 //hiirulainen.Shape = Shape.Triangle;22 //hiirulainen.Color = Color.Gray;23 //hiirulainen.X = 20;24 //hiirulainen.Y = 80;25 //Add(hiirulainen);23 hiirulainen = new PhysicsObject(20, 50); 24 hiirulainen.X = 0; 25 hiirulainen.Y = 0; 26 hiirulainen.Image = hiiru; 27 hiirulainen.CanRotate = false; 28 hiirulainen.Restitution = 0; 26 29 27 Luoseina(-170, -280); 28 Luoseina(170, -280); 29 Luoseina(170, 280); 30 Luoseina(-170, 280); 30 Add(hiirulainen); 31 31 32 Luoseina2(230, -170); 33 Luoseina2(-230, -170); 34 Luoseina2(230, 170); 35 Luoseina2(-230, 170); 32 AddCollisionHandler(hiirulainen, KasitteleHiirulaisenTormays); 33 34 Luoseina(-170, Level.Top - 300); 35 Luoseina(170, Level.Top - 300); 36 Luoseina(170, Level.Bottom + 300); 37 Luoseina(-170, Level.Bottom + 300); 38 39 Luoseina2(200, -170); 40 Luoseina2(-200, -170); 41 Luoseina2(200, 170); 42 Luoseina2(-200, 170); 43 Luoseina2(Level.Left + 50, 0); 44 Luoseina2(Level.Right - 50, 0); 45 36 46 37 38 //PhysicsObject mato = new PhysicsObject(10, 150); 39 //mato.Shape = Shape.Rectangle; 40 //mato.Color = Color.LimeGreen; 41 //Add(mato); 42 43 Level.CreateBorders(isVisible: true); 47 Level.CreateBorders(); 44 48 Level.BackgroundColor = Color.Pink; 45 49 46 Camera.Zoom ToLevel(+5);50 Camera.Zoom(1.25); 47 51 48 52 } 53 54 49 55 50 56 void Luoseina(double x, double y) … … 60 66 void Luoseina2(double x, double y) 61 67 { 62 PhysicsObject seina2 = PhysicsObject.CreateStaticObject( 400, 50);68 PhysicsObject seina2 = PhysicsObject.CreateStaticObject(300, 50); 63 69 seina2.X = x; 64 70 seina2.Y = y; … … 67 73 Add(seina2); 68 74 } 75 76 void AsetaOhjaimet() 77 { 78 Keyboard.Listen(Key.Escape, ButtonState.Pressed, Exit, "Poistu"); 79 Keyboard.Listen(Key.Up, ButtonState.Pressed, AsetaNopeus, "Pelaaja 1: Käännä hiirtä ylös", hiirulainen, nopeusYlos); 80 Keyboard.Listen(Key.Down, ButtonState.Pressed, AsetaNopeus, "Pelaaja 1: Käännä hiirtä alas", hiirulainen, nopeusAlas); 81 Keyboard.Listen(Key.Left, ButtonState.Pressed, AsetaNopeus, "Pelaaja 1: Käännä hiirtä vasemmalle", hiirulainen, nopeusVasemmalle); 82 Keyboard.Listen(Key.Right, ButtonState.Pressed, AsetaNopeus, "Pelaaja 1: Käännä hiirtä oikealle", hiirulainen, nopeusOikealle); 83 84 85 } 86 87 88 void AsetaNopeus(PhysicsObject hiirulainen, Vector nopeus) 89 { 90 hiirulainen.Velocity = nopeus; 91 } 92 93 void KasitteleHiirulaisenTormays(PhysicsObject hiirulainen, PhysicsObject kohde) 94 { 95 96 } 69 97 } -
2011/24/JuusoP/green Peace/green Peace/green Peace/green Peace.csproj
r1990 r2028 120 120 </ItemGroup> 121 121 <ItemGroup> 122 <ProjectReference Include="..\green_PeaceContent\green_PeaceContent.contentproj">123 <Name>green_PeaceContent</Name>124 <XnaReferenceType>Content</XnaReferenceType>125 </ProjectReference>126 </ItemGroup>127 <ItemGroup>128 122 <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client"> 129 123 <Visible>False</Visible> … … 152 146 </BootstrapperPackage> 153 147 </ItemGroup> 148 <ItemGroup> 149 <ProjectReference Include="..\green PeaceContent\green PeaceContent.contentproj"> 150 <Project>{4A0A1CAF-BE3F-43EB-B268-457EEF014905}</Project> 151 <Name>green PeaceContent %28Content%29</Name> 152 <XnaReferenceType>Content</XnaReferenceType> 153 </ProjectReference> 154 </ItemGroup> 154 155 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 155 156 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" /> -
2011/24/JuusoP/green Peace/green Peace/green PeaceContent/green PeaceContent.contentproj
r1990 r2028 42 42 </Reference> 43 43 </ItemGroup> 44 <ItemGroup> 45 <Compile Include="Hiiru.png"> 46 <Name>Hiiru</Name> 47 <Importer>TextureImporter</Importer> 48 <Processor>TextureProcessor</Processor> 49 </Compile> 50 </ItemGroup> 44 51 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 45 52 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.