- Timestamp:
- 2015-06-23 22:41:48 (8 years ago)
- Location:
- 2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun
- Files:
-
- 126 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRun.cs
r6216 r6217 72 72 73 73 private Image cartImage = LoadImage("cart"); 74 private Image milkImage = LoadImage("tonkka ");74 private Image milkImage = LoadImage("tonkkaitem"); 75 75 76 76 private Image cartWheelImage = LoadImage("cartwheel"); … … 79 79 private Image smokeImage2 = LoadImage("smoke2"); 80 80 81 private Image forestBackgroundImage = LoadImage("forestbackground"); 82 81 83 private Animation crawl; 82 84 private Animation blaze; 85 86 private Animation pitchforkAttack; 87 private Animation pitchforkWalk; 88 private Animation milkThrow; 89 private Animation milkWalk; 90 private Animation normalWalk; 91 private Animation playerIdle; 83 92 #endregion 84 93 … … 91 100 public override void Begin() 92 101 { 93 IntroSequence();102 //IntroSequence(); 94 103 //MainMenu(); 95 //StartGame();104 StartGame(); 96 105 } 97 106 … … 221 230 CreateLevel(); 222 231 ScreenSettings(); 232 233 // Taustatestailua. 234 GameObject forestBackground = new GameObject(Level.Width, Level.Height); 235 forestBackground.Image = forestBackgroundImage; 236 forestBackground.TextureWrapSize = new Vector(5, 1); 237 Add(forestBackground, -3); 238 Layers[-3].RelativeTransition = new Vector(0.5, 1.0); 239 Level.Background.CreateGradient(Color.Black, Color.SkyBlue); 223 240 224 241 // Testailen tässä kärryn luomista. … … 243 260 crawl = LoadAnimation("crawl"); 244 261 blaze = LoadAnimation("flame"); 262 pitchforkAttack = LoadAnimation("attack"); 263 pitchforkWalk = LoadAnimation("hanko"); 264 milkThrow = LoadAnimation("heitto"); 265 milkWalk = LoadAnimation("tonkka"); 266 normalWalk = LoadAnimation("pwalk"); 267 playerIdle = LoadAnimation("idle"); 245 268 } 246 269 … … 285 308 //level.SetTileMethod(Color.Azure, CreateDummy, Color.Azure); //TODO: CreateSmoke 286 309 //level.SetTileMethod(Color.Orange, CreateDummy, Color.Orange); //TODO: CreateTombstone 310 level.Optimize(Color.Black, Color.Brown); 287 311 level.Execute(TILE_SIZE, TILE_SIZE); 288 level.Optimize(Color.Black, Color.Brown);312 289 313 290 314 //TileMap level = TileMap.FromLevelAsset("level" + levelNumber); … … 419 443 player.Position = position + new Vector(0, height * 0.5); 420 444 player.Color = Color.White; 445 player.AnimWalk = new Animation(normalWalk); 446 player.AnimIdle = new Animation(playerIdle); 421 447 players.Add(player); 422 448 startingPlayers.Add(player); … … 427 453 billy.Life.Value--; 428 454 429 } 430 ); 455 }); 431 456 432 457 player.Life.LowerLimit += delegate … … 460 485 if (wheat) 461 486 { 462 GameObject wheatBlock = new GameObject(width * 1.5, height * 3);487 GameObject wheatBlock = new GameObject(width * 1.5, height * 2); 463 488 wheatBlock.Image = foregroundDecorations[0]; 464 wheatBlock.Position = visibleGround.Position; 489 wheatBlock.X = visibleGround.X; 490 wheatBlock.Bottom = visibleGround.Bottom; 491 wheatBlock.TextureWrapSize = new Vector(width / TILE_SIZE, height / TILE_SIZE); 465 492 Add(wheatBlock, 2); 466 493 } … … 479 506 void SetControls() 480 507 { 481 Keyboard.Listen(Key.A, ButtonState.Down, delegate { startingPlayers[0].Walk(-300); }, "Player 1 moves left"); 482 Keyboard.Listen(Key.D, ButtonState.Down, delegate { startingPlayers[0].Walk(300); }, "Player 1 moves right"); 508 double speed = 180; // TODO: Siirrä tämä johonkin. 509 Keyboard.Listen(Key.A, ButtonState.Down, delegate { startingPlayers[0].Walk(-speed); }, "Player 1 moves left"); 510 Keyboard.Listen(Key.D, ButtonState.Down, delegate { startingPlayers[0].Walk(speed); }, "Player 1 moves right"); 483 511 Keyboard.Listen(Key.W, ButtonState.Down, delegate { startingPlayers[0].Jump(1000); }, "Player 1 jumps"); 484 512 485 Keyboard.Listen(Key.Left, ButtonState.Down, delegate { startingPlayers[1].Walk(- 300); }, "Player 2 moves left");486 Keyboard.Listen(Key.Right, ButtonState.Down, delegate { startingPlayers[1].Walk( 300); }, "Player 2 moves right");513 Keyboard.Listen(Key.Left, ButtonState.Down, delegate { startingPlayers[1].Walk(-speed); }, "Player 2 moves left"); 514 Keyboard.Listen(Key.Right, ButtonState.Down, delegate { startingPlayers[1].Walk(speed); }, "Player 2 moves right"); 487 515 Keyboard.Listen(Key.Up, ButtonState.Down, delegate { startingPlayers[1].Jump(1000); }, "Player 2 jumps"); 488 516 -
2015/26/ohjaajat/HillbillyRun/HillbillyRun/HillbillyRun/HillbillyRunContent/HillbillyRunContent.contentproj
r6216 r6217 122 122 </ItemGroup> 123 123 <ItemGroup> 124 <Compile Include="tonkka .png">125 <Name>tonkka </Name>124 <Compile Include="tonkkaitem.png"> 125 <Name>tonkkaitem</Name> 126 126 <Importer>TextureImporter</Importer> 127 127 <Processor>TextureProcessor</Processor> … … 150 150 <Compile Include="smoke2.png"> 151 151 <Name>smoke2</Name> 152 <Importer>TextureImporter</Importer> 153 <Processor>TextureProcessor</Processor> 154 </Compile> 155 </ItemGroup> 156 <ItemGroup> 157 <Compile Include="attack.anim"> 158 <Name>attack</Name> 159 <Importer>AnimationImporter</Importer> 160 <Processor>AnimationContentProcessor</Processor> 161 </Compile> 162 <Compile Include="hanko.anim"> 163 <Name>hanko</Name> 164 <Importer>AnimationImporter</Importer> 165 <Processor>AnimationContentProcessor</Processor> 166 </Compile> 167 <Compile Include="heitto.anim"> 168 <Name>heitto</Name> 169 <Importer>AnimationImporter</Importer> 170 <Processor>AnimationContentProcessor</Processor> 171 </Compile> 172 <Compile Include="pwalk.anim"> 173 <Name>pwalk</Name> 174 <Importer>AnimationImporter</Importer> 175 <Processor>AnimationContentProcessor</Processor> 176 </Compile> 177 <Compile Include="tonkka.anim"> 178 <Name>tonkka</Name> 179 <Importer>AnimationImporter</Importer> 180 <Processor>AnimationContentProcessor</Processor> 181 </Compile> 182 </ItemGroup> 183 <ItemGroup> 184 <Compile Include="box2.png"> 185 <Name>box2</Name> 186 <Importer>TextureImporter</Importer> 187 <Processor>TextureProcessor</Processor> 188 </Compile> 189 </ItemGroup> 190 <ItemGroup> 191 <Compile Include="idle.anim"> 192 <Name>idle</Name> 193 <Importer>AnimationImporter</Importer> 194 <Processor>AnimationContentProcessor</Processor> 195 </Compile> 196 </ItemGroup> 197 <ItemGroup> 198 <Compile Include="forestbackground.png"> 199 <Name>forestbackground</Name> 152 200 <Importer>TextureImporter</Importer> 153 201 <Processor>TextureProcessor</Processor>
Note: See TracChangeset
for help on using the changeset viewer.