- Timestamp:
- 2016-06-09 13:06:11 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2016/23/ohjaajat/Punasininen/Punasininen/Punasininen/Punasininen.cs
r7213 r7214 13 13 private const double JUMPSPEED = 1250; 14 14 private const int TILE_SIZE = 60; 15 private const int MATCH_LENGTH = 3 0;15 private const int MATCH_LENGTH = 3; 16 16 17 17 private Player blue; … … 95 95 }; 96 96 97 Func<double, double, Color, Label> createLabel; 98 createLabel = (double x, double y, Color color) => 97 Func<double, double, Color, Label> createLabel = (double x, double y, Color color) => 99 98 { 100 99 var label = new Label(); … … 176 175 } 177 176 178 void Restore(Player temp)179 { 180 temp.Position = temp.Spawn;177 void Restore(Player player) 178 { 179 player.Position = player.Spawn; 181 180 } 182 181 … … 203 202 } 204 203 205 void Win(Player player)204 void Win(Player winner) 206 205 { 207 206 Pause(); … … 209 208 // Haluaisin tehdä tähän jonkinlaisen hauskan ponnahdusefektin jossain vaiheessa. Sellaisen napakan zoomin ja sitten boing. Hurdur. 210 209 210 string victoryText = "Kiva homma hei"; 211 211 212 // Tekstille musta tausta, jotta sen näkee lukea. 212 Label announcementDark = new Label("Kiva homma hei") 213 { 214 Font = largeFont, // Vaihtoehtona smallFont myös 215 TextColor = Color.Black 216 }; 213 var announcementDark = new Label(victoryText) { Font = largeFont, TextColor = Color.Black }; 217 214 Add(announcementDark); 218 215 219 216 // Voittoteksti. 220 Label announcement = new Label("Kiva homma hei") 221 { 222 Font = largeFont, // Vaihtoehtona smallFont myös 223 TextColor = player.Color 224 }; 217 var announcement = new Label(victoryText) { Font = largeFont, TextColor = winner.Color }; 225 218 Add(announcement); 226 219 227 220 // Zoomaa voittajaan. 228 221 double targetZoomFactor = 1.5; 229 222 var zoomTimer = new Timer(); … … 231 224 zoomTimer.Timeout += () => 232 225 { 233 var targetPos = player.Position; 234 Camera.Position += (targetPos - Camera.Position) * 0.02; 226 Camera.Position += (winner.Position - Camera.Position) * 0.02; 235 227 Camera.ZoomFactor += (targetZoomFactor - Camera.ZoomFactor) * 0.01; 236 announcement.Position = Camera.WorldToScreen( player.Position + new Vector(0, 80));228 announcement.Position = Camera.WorldToScreen(winner.Position + new Vector(0, 80)); 237 229 announcementDark.Position = announcement.Position + new Vector(5, -5); 238 230 }; 239 231 zoomTimer.IgnorePause = true; 240 232 zoomTimer.Start(); 241 242 243 233 } 244 234 … … 269 259 ControllerTwo.ListenAnalog(AnalogControl.LeftStick, 0.1, Move, "Liikuta pelaajaa", blue); 270 260 ControllerTwo.Listen(Button.A, ButtonState.Pressed, Jump, "Pelaaja hyppää", blue, JUMPSPEED); 271 ControllerTwo.ListenAnalog(AnalogControl.RightStick, 0.1, Aim, null, blue);261 ControllerTwo.ListenAnalog(AnalogControl.RightStick, 0.1, Aim, "Tähtää", blue); 272 262 ControllerTwo.ListenAnalog(AnalogControl.RightTrigger, 0.1, Shoot, "", blue); 273 263 ControllerTwo.ListenAnalog(AnalogControl.LeftTrigger, 0.1, Shoot, "", blue);
Note: See TracChangeset
for help on using the changeset viewer.