Changeset 6686 for 2015/27/EemilI/infected - Copy
- Timestamp:
- 2015-07-01 14:56:42 (8 years ago)
- Location:
- 2015/27/EemilI/infected - Copy
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/27/EemilI/infected - Copy/infected/infected/infected.cs
r6671 r6686 12 12 Image mieskuva = LoadImage("mieskuva"); 13 13 Image seinakuva = LoadImage("seina"); 14 Image zombikuva = LoadImage("zombi"); 15 16 List<Vector> spawnipaikat = new List<Vector>(); 14 17 15 18 public override void Begin() … … 18 21 kontrollit(); 19 22 LuoAikaLaskuri(); 23 //LuoZombi(); 20 24 MessageDisplay.Add("SELVIÄ MAHDOLLISIMMAN PITKÄÄN"); 21 25 MessageDisplay.MessageTime = new TimeSpan(0, 0, 10); … … 32 36 33 37 } 34 void LuoKentta() 38 void LuoKentta() 35 39 { 36 40 ColorTileMap mappi = ColorTileMap.FromLevelAsset("mappi"); 41 mappi.SetTileMethod(Color.FromHexCode("4CFF00"), LuoSpawn); 37 42 mappi.SetTileMethod(Color.Black, LuoTaso); 38 43 mappi.SetTileMethod(Color.Red, LuoHahmo); 39 44 mappi.Execute(40, 40); 45 46 for (int i = 0; i < 6; i++) 47 { 48 LuoUusiZombi(); 49 50 } 51 40 52 41 53 Level.CreateBorders(); … … 57 69 void kontrollit() 58 70 { 59 Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaajaa, "Pelaaja liikkuu ylos", 3000.0, 1);60 Keyboard.Listen(Key.S, ButtonState.Down, LiikutaPelaajaa, "l", 3000.0, 2);61 Keyboard.Listen(Key.D, ButtonState.Down, LiikutaPelaajaa, "l", 3000.0, 3);62 Keyboard.Listen(Key.A, ButtonState.Down, LiikutaPelaajaa, "l", 3000.0,4);71 Keyboard.Listen(Key.W, ButtonState.Down, LiikutaPelaajaa, null, 3000.0, 1); 72 Keyboard.Listen(Key.S, ButtonState.Down, LiikutaPelaajaa, null, 3000.0, 2); 73 Keyboard.Listen(Key.D, ButtonState.Down, LiikutaPelaajaa, null, 3000.0, 3); 74 Keyboard.Listen(Key.A, ButtonState.Down, LiikutaPelaajaa, null, 3000.0, 4); 63 75 Mouse.ListenMovement(0.0, Tahtays, null); 64 76 Mouse.IsCursorVisible = true; … … 94 106 { 95 107 Timer aikaLaskuri = new Timer(); 108 109 110 aikaLaskuri.Interval = 4; 111 aikaLaskuri.Timeout += LuoUusiZombi; 96 112 aikaLaskuri.Start(); 97 113 98 114 Label aikaNaytto = new Label(); 99 115 aikaNaytto.X = Screen.Left + 100; 100 aikaNaytto.Y = Screen.Top -100;116 aikaNaytto.Y = Screen.Top - 100; 101 117 aikaNaytto.TextColor = Color.White; 102 118 aikaNaytto.DecimalPlaces = 1; … … 104 120 Add(aikaNaytto); 105 121 } 122 void LuoZombi(Vector paikka) 123 { 124 PhysicsObject zombi = new PhysicsObject(40, 40); 125 zombi.Position = paikka; 126 zombi.Image = zombikuva; 106 127 128 Add(zombi); 129 130 } 131 void LuoUusiZombi() 132 { 133 int indeksi = RandomGen.NextInt(0, spawnipaikat.Count - 1); 134 Vector paikka = spawnipaikat[indeksi]; 135 FollowerBrain seuraajanAivot = new FollowerBrain(mies); 136 seuraajanAivot.Speed = 1500; 137 seuraajanAivot.DistanceFar = 500; 138 seuraajanAivot.TargetClose += mitaTapahtuuKunOllaanLahella; 139 LuoZombi(paikka); 140 141 } 142 void LuoSpawn(Vector paikka, double leveys, double korkeus) 143 { 144 spawnipaikat.Add(paikka); 145 146 } 147 void mitaTapahtuuKunOllaanLahella() 148 { 149 mies.Destroy(); 150 } 107 151 } -
2015/27/EemilI/infected - Copy/infected/infected/obj/x86/Debug/ContentPipeline-{B898C966-80ED-44D3-9FBA-1E981C2850D4}.xml
r6671 r6686 18 18 <Options>None</Options> 19 19 <Output>C:\MyTemp\EemilI\infected - Copy\infected\infected\bin\x86\Debug\Content\mappi.xnb</Output> 20 <Time>2015-07-01T1 2:33:01.9250934+03:00</Time>20 <Time>2015-07-01T14:17:18.6995934+03:00</Time> 21 21 </Item> 22 22 <Item>
Note: See TracChangeset
for help on using the changeset viewer.