- Timestamp:
- 2010-07-09 12:21:46 (13 years ago)
- Location:
- 2010/27/Vekakart
- Files:
-
- 7 added
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/Vekakart/Catch The Rainbow/Catch The Rainbow/Catch The Rainbow.csproj
r1186 r1217 89 89 </ItemGroup> 90 90 <ItemGroup> 91 <Content Include="Crossword_hand.png">92 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>93 </Content>94 91 <Content Include="Game.ico" /> 95 92 <Content Include="GameThumbnail.png" /> -
2010/27/Vekakart/Catch The Rainbow/Catch The Rainbow/Content/Content.contentproj
r1186 r1217 41 41 </Compile> 42 42 </ItemGroup> 43 <ItemGroup> 44 <Compile Include="Crossword.png"> 45 <Name>Crossword</Name> 46 <Importer>TextureImporter</Importer> 47 <Processor>TextureProcessor</Processor> 48 </Compile> 49 </ItemGroup> 50 <ItemGroup> 51 <Compile Include="Knife1.png"> 52 <Name>Knife1</Name> 53 <Importer>TextureImporter</Importer> 54 <Processor>TextureProcessor</Processor> 55 </Compile> 56 </ItemGroup> 57 <ItemGroup> 58 <Compile Include="Max Mechanic D.png"> 59 <Name>Max Mechanic D</Name> 60 <Importer>TextureImporter</Importer> 61 <Processor>TextureProcessor</Processor> 62 </Compile> 63 </ItemGroup> 43 64 </Project> -
2010/27/Vekakart/Catch The Rainbow/Catch The Rainbow/Peli.cs
r1186 r1217 13 13 14 14 PhysicsObject Crossword; 15 PhysicsObject Chandler; 15 16 16 17 PlatformCharacter Max; … … 18 19 protected override void Begin() 19 20 { 20 LuoMax(); 21 ClearAll(); 22 //LuoMax(); 21 23 AsetaOhjaimet(); 22 24 LuoKentta(); … … 25 27 void LuoKentta() 26 28 { 27 Camera.FollowedObject = Max;29 28 30 29 31 TileMap ruudut = TileMap.FromFile("Kentta 1.txt"); … … 31 33 ruudut['C'] = LuoRainbow; 32 34 ruudut['J'] = LuoCrossword; 35 ruudut['9'] = LuoChandler; 36 ruudut['1'] = LuoMax; 33 37 ruudut.Insert(ruudunleveys, ruudunkorkeus); 34 38 35 39 Gravity = new Vector(0.0, -800.0); 36 40 Camera.FollowedObject = Max; 37 41 } 38 42 PhysicsObject LuoPalikka() … … 49 53 } 50 54 51 voidLuoMax()55 PhysicsObject LuoMax() 52 56 { 53 57 Max = new PlatformCharacter(35,45); 54 58 Max.Restitution = 0.0; 55 59 Max.CanRotate = false; 56 Max.X = -450;57 Max.Y = -365;58 60 Max.Image = Image.FromFile("Max Mechanic.png"); 59 61 Max.KineticFriction = 0.0; 60 Add (Max); 61 return; 62 Max.Tag = "Max"; 63 // Add(Max); 64 return Max; 62 65 } 63 66 … … 98 101 { 99 102 Crossword = new PhysicsObject(35.0, 45.0); 100 Crossword.Image = Image.FromFile("Crossword _hand.png");103 Crossword.Image = Image.FromFile("Crossword.png"); 101 104 102 105 Timer ajastin = new Timer(); 103 106 ajastin.Tag = Crossword; 104 ajastin.Interval = 1;107 ajastin.Interval = 0.1; 105 108 ajastin.Trigger += Tekoaly; 106 109 Add (ajastin); … … 116 119 etaisyys = etaisyys * -1; 117 120 } 118 if (etaisyys < 150)121 if (etaisyys < 200 && voiheittaa && vihollinen.Y > Max.Y) 119 122 { 120 vihollinen.Image = LoadImage("Crossword2"); 123 if (vihollinen.X < Max.X) 124 { 125 vihollinen.Image = LoadImage("Crossword2"); 126 PhysicsObject Ase = LuoPuukko(); 127 Ase.Image = LoadImage("knife1"); 128 Ase.X = vihollinen.X+20; 129 Ase.Y = vihollinen.Y; 130 Ase.Hit(new Vector(500, 0)); 131 Add(Ase); 132 133 134 } 135 else 136 { 137 vihollinen.Image = LoadImage("Crossword"); 138 PhysicsObject Ase = LuoPuukko(); 139 Ase.Image = LoadImage("knife1"); 140 Ase.X = vihollinen.X-20; 141 Ase.Y = vihollinen.Y; 142 Ase.Hit(new Vector(-500, 0)); 143 Add(Ase); 144 } 145 voiheittaa = false; 146 Timer.SingleShot(1, saaheittaa); 121 147 } 122 148 sender.Start(); 123 149 } 150 PhysicsObject LuoChandler() 151 { 152 Chandler = new PhysicsObject(20, 45); 153 //Chandler.Image = LoadImage ("Chandler1") 154 return Chandler; 155 } 156 PhysicsObject LuoPuukko() 157 { 158 PhysicsObject Puukko = new PhysicsObject(20.0, 5.0); 159 Puukko.MaximumLifetime = TimeSpan.FromSeconds(1); 160 AddCollisionHandler(Puukko, KasittelePuukonTormays); 161 Puukko.Tag = "p"; 162 return Puukko; 163 } 124 164 165 void KasittelePuukonTormays(PhysicsObject puukko, PhysicsObject kohde) 166 { 167 if (kohde.Tag.ToString() == "Max") 168 { 169 Timer.SingleShot(1.5, Begin); 170 Max.Image = LoadImage("Max Mechanic D"); 171 ClearControls(); 172 } 173 174 } 175 bool voiheittaa = true; 176 177 void saaheittaa() 178 { 179 voiheittaa = true; 180 } 125 181 }
Note: See TracChangeset
for help on using the changeset viewer.