- Timestamp:
- 2010-07-08 14:14:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/27/Vekakart/Catch The Rainbow/Catch The Rainbow/Peli.cs
r1171 r1186 11 11 12 12 Vector NopeusEteen = new Vector(200, 0); 13 14 PhysicsObject Crossword; 13 15 14 16 PlatformCharacter Max; … … 25 27 Camera.FollowedObject = Max; 26 28 27 TileMap ruudut = TileMap.FromFile("Kentta 1.txt");29 TileMap ruudut = TileMap.FromFile("Kentta 1.txt"); 28 30 ruudut ['='] = LuoPalikka; 29 31 ruudut['C'] = LuoRainbow; 32 ruudut['J'] = LuoCrossword; 30 33 ruudut.Insert(ruudunleveys, ruudunkorkeus); 31 34 … … 92 95 Max.Jump(1000); 93 96 } 97 PhysicsObject LuoCrossword() 98 { 99 Crossword = new PhysicsObject(35.0, 45.0); 100 Crossword.Image = Image.FromFile("Crossword_hand.png"); 101 102 Timer ajastin = new Timer(); 103 ajastin.Tag = Crossword; 104 ajastin.Interval = 1; 105 ajastin.Trigger += Tekoaly; 106 Add (ajastin); 107 ajastin.Start(); 108 return Crossword; 109 } 110 void Tekoaly(Timer sender) 111 { 112 PhysicsObject vihollinen = (PhysicsObject)sender.Tag; 113 double etaisyys = vihollinen.X - Max.X; 114 if (etaisyys < 0) 115 { 116 etaisyys = etaisyys * -1; 117 } 118 if (etaisyys < 150) 119 { 120 vihollinen.Image = LoadImage("Crossword2"); 121 } 122 sender.Start(); 123 } 124 94 125 }
Note: See TracChangeset
for help on using the changeset viewer.