- Timestamp:
- 2017-06-15 15:09:10 (4 years ago)
- Location:
- 2017/24/AaronL
- Files:
-
- 34 added
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/24/AaronL/AdventureLunk/AdventureLunk/AdventureLunk/AdventureLunk.cs
r8674 r8749 17 17 18 18 Image linkYlos = LoadImage("link4"); 19 Image linkLyoVasemmalle = LoadImage("link3"); 20 21 Image hirviökuva = LoadImage("hirvio"); 19 22 public override void Begin() 20 23 { … … 32 35 Keyboard.Listen(Key.Up, ButtonState.Down, LiikutaLink, null, new Vector(0, 500)); 33 36 Keyboard.Listen(Key.Down, ButtonState.Down, LiikutaLink, null, new Vector(0, -500)); 37 Keyboard.Listen(Key.A, ButtonState.Pressed, LyoMiekalla, null); 34 38 { 35 39 Keyboard.Listen(Key.Left, ButtonState.Released, PysaytaLink, null); … … 67 71 void Paika() 68 72 { 69 Level.Background.Image = LoadImage(" paika1"); Level.Background.FitToLevel();73 Level.Background.Image = LoadImage("aloitus"); Level.Background.FitToLevel(); 70 74 } 71 75 void LuoKentta() 72 76 { 73 77 //1. Luetaan kuva uuteen ColorTileMappiin, kuvan nimen perässä ei .png-päätettä. 74 ColorTileMap ruudut = ColorTileMap.FromLevelAsset(" paika1");78 ColorTileMap ruudut = ColorTileMap.FromLevelAsset("aloitus"); 75 79 76 80 //2. Kerrotaan mitä aliohjelmaa kutsutaan, kun tietyn värinen pikseli tulee vastaan kuvatiedostossa. 77 81 78 82 //ruudut.SetTileMethod(Color.Green, LuoPelaaja); 79 83 ruudut.SetTileMethod(Color.FromHexCode("28FFA5"), LuoTaso); 84 ruudut.SetTileMethod(Color.FromHexCode("2857FF"), LuoLohko); 85 ruudut.SetTileMethod(Color.FromHexCode("51A2FF"), LuoPainike); 86 80 87 81 88 LuoPelaaja(Vector.Zero, 100, 100); … … 103 110 Add(taso); 104 111 } 112 113 void LuoLohko(Vector paikka, double leveys, double korkeus) 114 { 115 PhysicsObject lohko = new PhysicsObject(leveys*5.0, korkeus*5.0); 116 lohko.CanRotate = false; 117 lohko.Mass = 100.0; 118 lohko.Position = paikka; 119 lohko.Color = Color.Green; 120 121 // TODO: 122 // tee tähän AddCollisionHandler, joka määrää että: 123 // kun tämä lohko törmää mihin tahansa olioon, jonka täginä on "painike", 124 // niin mennään johonkin tiettyyn aliohjelmaan 125 126 AddCollisionHandler(lohko, "painike", LohkoOsuu); 127 128 Add(lohko); 129 } 130 131 void LuoPainike(Vector paikka, double leveys, double korkeus) 132 { 133 PhysicsObject painike = new PhysicsObject(leveys * 5.0, korkeus * 5.0); 134 painike.CanRotate = false; 135 painike.Mass = 100.0; 136 painike.Position = paikka; 137 painike.Color = Color.Green; 138 Add(painike); 139 painike.Tag = "painike"; 140 } 105 141 106 142 void PysaytaLink() … … 108 144 LiikutaLink(Vector.Zero); 109 145 } 146 void LohkoOsuu(PhysicsObject lohko, PhysicsObject painike) 147 { 148 KutsuHirvio(); 149 KutsuMieka(); 150 } 151 void KutsuHirvio() 152 { 153 PhysicsObject hirviö = new PhysicsObject(100.0, 100.0); 154 hirviö.Tag = "vihollinen"; 155 Add(hirviö); 156 hirviö.Image = hirviökuva; 157 } 158 void KutsuMieka() 159 { 110 160 111 161 } 162 void LyoMiekalla() 163 { 164 link.Image = linkLyoVasemmalle; 165 List<GameObject> lista = GetObjectsBetween(link.Position + new Vector(-150.0, 0.0), link.Position); 166 if (lista.Count > 0) 167 { 168 foreach(GameObject olio in lista) 169 { 170 if (olio.Tag.Equals("vihollinen")) 171 { 172 olio.Destroy(); 173 } 174 } 175 } 176 Timer.SingleShot(1.0, delegate 177 { 178 link.Image = linkKuva; 179 }); 180 } 112 181 113 182 -
2017/24/AaronL/AdventureLunk/AdventureLunk/AdventureLunk/AdventureLunk.csproj.Debug.cachefile
r8674 r8749 4 4 Content\link4.xnb 5 5 Content\paika1.xnb 6 Content\aloitus.xnb 7 Content\hirvio4.xnb 8 Content\hirvio3.xnb 9 Content\hirvio2.xnb 10 Content\hirvio.xnb 11 Content\kivi.xnb 12 Content\mieka.xnb 13 Content\link3.xnb 14 Content\link6.xnb -
2017/24/AaronL/AdventureLunk/AdventureLunk/AdventureLunk/obj/x86/Debug/AdventureLunk.csproj.FileListAbsolute.txt
r8674 r8749 12 12 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\link4.xnb 13 13 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\paika1.xnb 14 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\aloitus.xnb 15 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio4.xnb 16 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio3.xnb 17 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio2.xnb 18 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio.xnb 19 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\kivi.xnb 20 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\mieka.xnb 21 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\link3.xnb 22 C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\link6.xnb -
2017/24/AaronL/AdventureLunk/AdventureLunk/AdventureLunk/obj/x86/Debug/ContentPipeline-{C6BDA7BB-565D-484A-9401-0AF2E0C44BAC}.xml
r8674 r8749 46 46 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\paika1.xnb</Output> 47 47 <Time>2017-06-14T13:45:48.1341252+03:00</Time> 48 </Item> 49 <Item> 50 <Source>aloitus.png</Source> 51 <Name>aloitus</Name> 52 <Importer>TextureImporter</Importer> 53 <Processor>TextureProcessor</Processor> 54 <Options>None</Options> 55 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\aloitus.xnb</Output> 56 <Time>2017-06-15T11:34:44.3204783+03:00</Time> 57 </Item> 58 <Item> 59 <Source>hirvio4.png</Source> 60 <Name>hirvio4</Name> 61 <Importer>TextureImporter</Importer> 62 <Processor>TextureProcessor</Processor> 63 <Options>None</Options> 64 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio4.xnb</Output> 65 <Time>2017-06-15T13:36:23.9614748+03:00</Time> 66 </Item> 67 <Item> 68 <Source>hirvio3.png</Source> 69 <Name>hirvio3</Name> 70 <Importer>TextureImporter</Importer> 71 <Processor>TextureProcessor</Processor> 72 <Options>None</Options> 73 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio3.xnb</Output> 74 <Time>2017-06-15T13:36:02.5334021+03:00</Time> 75 </Item> 76 <Item> 77 <Source>hirvio2.png</Source> 78 <Name>hirvio2</Name> 79 <Importer>TextureImporter</Importer> 80 <Processor>TextureProcessor</Processor> 81 <Options>None</Options> 82 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio2.xnb</Output> 83 <Time>2017-06-15T13:35:32.8852121+03:00</Time> 84 </Item> 85 <Item> 86 <Source>hirvio.png</Source> 87 <Name>hirvio</Name> 88 <Importer>TextureImporter</Importer> 89 <Processor>TextureProcessor</Processor> 90 <Options>None</Options> 91 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\hirvio.xnb</Output> 92 <Time>2017-06-15T13:34:09.7686864+03:00</Time> 93 </Item> 94 <Item> 95 <Source>kivi.png</Source> 96 <Name>kivi</Name> 97 <Importer>TextureImporter</Importer> 98 <Processor>TextureProcessor</Processor> 99 <Options>None</Options> 100 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\kivi.xnb</Output> 101 <Time>2017-06-15T14:10:18.6152368+03:00</Time> 102 </Item> 103 <Item> 104 <Source>mieka.png</Source> 105 <Name>mieka</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 <Options>None</Options> 109 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\mieka.xnb</Output> 110 <Time>2017-06-15T12:47:32.4667948+03:00</Time> 111 </Item> 112 <Item> 113 <Source>link3.png</Source> 114 <Name>link3</Name> 115 <Importer>TextureImporter</Importer> 116 <Processor>TextureProcessor</Processor> 117 <Options>None</Options> 118 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\link3.xnb</Output> 119 <Time>2017-06-15T14:34:18.8998271+03:00</Time> 120 </Item> 121 <Item> 122 <Source>link6.png</Source> 123 <Name>link6</Name> 124 <Importer>TextureImporter</Importer> 125 <Processor>TextureProcessor</Processor> 126 <Options>None</Options> 127 <Output>C:\MyTemp\AaronL\AdventureLunk\AdventureLunk\AdventureLunk\bin\x86\Debug\Content\link6.xnb</Output> 128 <Time>2017-06-15T14:34:29.4624684+03:00</Time> 48 129 </Item> 49 130 <BuildSuccessful>true</BuildSuccessful> -
2017/24/AaronL/AdventureLunk/AdventureLunk/AdventureLunk/obj/x86/Debug/cachefile-{C6BDA7BB-565D-484A-9401-0AF2E0C44BAC}-targetpath.txt
r8674 r8749 4 4 Content\link4.xnb 5 5 Content\paika1.xnb 6 Content\aloitus.xnb 7 Content\hirvio4.xnb 8 Content\hirvio3.xnb 9 Content\hirvio2.xnb 10 Content\hirvio.xnb 11 Content\kivi.xnb 12 Content\mieka.xnb 13 Content\link3.xnb 14 Content\link6.xnb -
2017/24/AaronL/AdventureLunk/AdventureLunk/AdventureLunkContent/AdventureLunkContent.contentproj
r8674 r8749 80 80 </Compile> 81 81 </ItemGroup> 82 <ItemGroup> 83 <Compile Include="aloitus.png"> 84 <Name>aloitus</Name> 85 <Importer>TextureImporter</Importer> 86 <Processor>TextureProcessor</Processor> 87 </Compile> 88 </ItemGroup> 89 <ItemGroup> 90 <Compile Include="hirvio4.png"> 91 <Name>hirvio4</Name> 92 <Importer>TextureImporter</Importer> 93 <Processor>TextureProcessor</Processor> 94 </Compile> 95 </ItemGroup> 96 <ItemGroup> 97 <Compile Include="hirvio3.png"> 98 <Name>hirvio3</Name> 99 <Importer>TextureImporter</Importer> 100 <Processor>TextureProcessor</Processor> 101 </Compile> 102 </ItemGroup> 103 <ItemGroup> 104 <Compile Include="hirvio2.png"> 105 <Name>hirvio2</Name> 106 <Importer>TextureImporter</Importer> 107 <Processor>TextureProcessor</Processor> 108 </Compile> 109 </ItemGroup> 110 <ItemGroup> 111 <Compile Include="hirvio.png"> 112 <Name>hirvio</Name> 113 <Importer>TextureImporter</Importer> 114 <Processor>TextureProcessor</Processor> 115 </Compile> 116 </ItemGroup> 117 <ItemGroup> 118 <Compile Include="kivi.png"> 119 <Name>kivi</Name> 120 <Importer>TextureImporter</Importer> 121 <Processor>TextureProcessor</Processor> 122 </Compile> 123 </ItemGroup> 124 <ItemGroup> 125 <Compile Include="mieka.png"> 126 <Name>mieka</Name> 127 <Importer>TextureImporter</Importer> 128 <Processor>TextureProcessor</Processor> 129 </Compile> 130 </ItemGroup> 131 <ItemGroup> 132 <Compile Include="link3.png"> 133 <Name>link3</Name> 134 <Importer>TextureImporter</Importer> 135 <Processor>TextureProcessor</Processor> 136 </Compile> 137 </ItemGroup> 138 <ItemGroup> 139 <Compile Include="link6.png"> 140 <Name>link6</Name> 141 <Importer>TextureImporter</Importer> 142 <Processor>TextureProcessor</Processor> 143 </Compile> 144 </ItemGroup> 82 145 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 83 146 <!-- 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.