- Timestamp:
- 2011-06-16 15:08:06 (12 years ago)
- Location:
- 2011/24/AkiR/Fight the Rambo
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/Fight the Rambo.csproj
r1998 r2053 121 121 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 122 122 </Content> 123 <Content Include="kentta2.txt"> 124 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 125 </Content> 123 126 </ItemGroup> 124 127 <ItemGroup> -
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/Fight the Rambo.csproj.Debug.cachefile
r2038 r2053 1 1 Content\maali.xnb 2 2 Content\Nuhasotilas.xnb 3 Content\rambo2.xnb 3 4 Content\shit.xnb 4 Content\rambo2.xnb 5 Content\kill.xnb 6 Content\goal.xnb 5 7 Content\shit.wma 8 Content\kill.wma 6 9 kentta1.txt 10 kentta2.txt -
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/Peli.cs
r2037 r2053 7 7 using Jypeli.Widgets; 8 8 9 9 10 public class Peli : PhysicsGame 10 11 { … … 12 13 const double hyppyNopeus = 1000; 13 14 const int RUUDUN_KOKO = 40; 14 15 15 PlatformCharacter pelaaja1; 16 PlatformCharacter vihollinen; 16 GameObject pelaajanpaikka; 17 //PlatformCharacter vihollinen; 18 PlatformCharacter Maali; 19 17 20 Image pelaajanKuva = LoadImage("rambo2"); 18 21 Image vihollisenkuva = LoadImage("Nuhasotilas"); 19 22 Image maalinkuva = LoadImage("goal"); 20 23 SoundEffect maaliAani = LoadSoundEffect("maali"); 24 21 25 Image paikallaanVasemmalle = LoadImage("rambo2"); 22 26 Image paikallaanOikealle; 23 24 27 Image[] kavelyVasemmalle = LoadImages("rambo2"); 25 28 Image[] kavelyOikealle; 26 29 30 Image VihollinenpaikallaanVasemmalle = LoadImage("Nuhasotilas"); 31 Image VihollinenpaikallaanOikealle; 32 Image[] VihollinenKavelyVasemmalle = LoadImages("Nuhasotilas"); 33 Image[] VihollinenKavelyOikealle; 34 35 int kenttaNro = 1; 27 36 28 37 public override void Begin() 29 38 { 39 30 40 ClearAll(); 31 41 … … 33 43 kavelyOikealle = Image.Mirror(kavelyVasemmalle); 34 44 35 Gravity = new Vector(0, -100); 36 37 luoKentta(); 38 lisaaNappaimet(); 39 40 Camera.Follow(pelaaja1); 41 Camera.ZoomFactor = 0.0; 42 Camera.StayInLevel = true; 43 44 } 45 46 void luoKentta() 47 { 45 VihollinenpaikallaanOikealle = Image.Mirror(VihollinenpaikallaanVasemmalle); 46 VihollinenKavelyOikealle = Image.Mirror(VihollinenKavelyVasemmalle); 47 SeuraavaKentta(kenttaNro); 48 49 50 } 51 52 void SeuraavaKentta(int kentanNro) 53 { 54 ClearAll(); 55 Gravity = new Vector(0, -900); 56 57 if(kentanNro == 1) luoKentta1(); 58 else if(kentanNro == 2) LuoKentta2(); 59 //else if(kentanNro == 3) LuoKentta3(); 60 //else if(kentanNro > 3) Exit(); 61 lisaaNappaimet(); 62 63 Camera.Follow(pelaaja1); 64 Camera.ZoomFactor = 0.0; 65 Camera.StayInLevel = true; 66 67 68 } 69 70 71 72 73 74 75 void luoKentta1() 76 { 77 lisaaPelaaja(); 78 48 79 TileMap kentta = TileMap.FromFile("kentta1.txt"); 80 kentta['G'] = lisaaMaali; 49 81 kentta['E'] = lisaaVihollinen; 50 82 kentta['#'] = lisaaTaso; 51 kentta['N'] = lisaa Pelaaja;83 kentta['N'] = lisaapelaajanPaikka; 52 84 kentta.Insert(RUUDUN_KOKO, RUUDUN_KOKO); 85 86 pelaaja1.Position = pelaajanpaikka.Position; 87 53 88 Level.CreateBorders(); 54 89 Level.Background.CreateGradient(Color.DarkRed, Color.ForestGreen); 55 } 90 } 91 void LuoKentta2() 92 { 93 lisaaPelaaja(); 94 95 TileMap kentta = TileMap.FromFile("kentta2.txt"); 96 kentta['G'] = lisaaMaali; 97 kentta['E'] = lisaaVihollinen; 98 kentta['#'] = lisaaTaso; 99 kentta['N'] = lisaapelaajanPaikka; 100 kentta.Insert(RUUDUN_KOKO, RUUDUN_KOKO); 101 102 pelaaja1.Position = pelaajanpaikka.Position; 103 104 Level.CreateBorders(); 105 Level.Background.CreateGradient(Color.DarkRed, Color.ForestGreen); 106 } 107 GameObject lisaapelaajanPaikka() 108 { 109 pelaajanpaikka = new GameObject(RUUDUN_KOKO, RUUDUN_KOKO); 110 111 return pelaajanpaikka; 112 } 56 113 57 114 PhysicsObject lisaaTaso() … … 71 128 pelaaja1.Weapon.Y = -20; 72 129 pelaaja1.Weapon.X = 0.5; 130 73 131 pelaaja1.RightIdleAnimation = new Animation(paikallaanVasemmalle); 74 132 pelaaja1.LeftIdleAnimation = new Animation(paikallaanOikealle); 75 76 133 pelaaja1.RightWalkingAnimation = new Animation(kavelyVasemmalle); 77 134 pelaaja1.LeftWalkingAnimation = new Animation(kavelyOikealle); 78 79 80 81 135 Add(pelaaja1); 82 136 83 137 return pelaaja1; … … 120 174 Ammus.Size *= 2; 121 175 Ammus.MaximumLifetime = TimeSpan.FromSeconds(3.1); 122 176 AddCollisionHandler(Ammus, KasitteleVihollinenKuoli); 123 177 } 124 178 } … … 128 182 Explosion rajahdys = new Explosion(10); 129 183 rajahdys.Position = Ammus.Position; 184 130 185 } 131 186 … … 134 189 PlatformCharacter lisaaVihollinen() 135 190 { 136 vihollinen = new PlatformCharacter(70, 70);137 vihollinen.Mass = 4.0;191 PlatformCharacter vihollinen = new PlatformCharacter(70, 70); 192 vihollinen.Mass = 1.0; 138 193 vihollinen.Image = vihollisenkuva; 194 vihollinen.Tag = ("vihollinen"); 195 196 vihollinen.LeftIdleAnimation = new Animation(VihollinenpaikallaanVasemmalle); 197 vihollinen.RightIdleAnimation = new Animation(VihollinenpaikallaanOikealle); 198 vihollinen.LeftWalkingAnimation = new Animation(VihollinenKavelyVasemmalle); 199 vihollinen.RightWalkingAnimation = new Animation(VihollinenKavelyOikealle); 139 200 140 201 141 202 FollowerBrain seuraajanAivot = new FollowerBrain(); 142 vihollinen.Brain = seuraajanAivot;143 203 seuraajanAivot.Target = pelaaja1; 144 204 seuraajanAivot.Speed = 100; 145 seuraajanAivot.TargetFollowDistance = 600; 205 seuraajanAivot.StopWhenTargetClose = false; 206 //seuraajanAivot.TargetFollowDistance = 600; 146 207 seuraajanAivot.FollowAlways = true; 208 seuraajanAivot.Active = true; 209 vihollinen.Brain = seuraajanAivot; 210 147 211 AddCollisionHandler(vihollinen, VihollinenOsui); 148 149 212 return vihollinen; 150 213 } … … 158 221 Begin(); 159 222 } 160 161 { 162 } 163 } 164 } 223 } 224 void KasitteleVihollinenKuoli(PhysicsObject Ammus, PhysicsObject kohde) 225 { 226 if (kohde.Tag.ToString() == "vihollinen" ) 227 { 228 MediaPlayer.Play("kill"); 229 kohde.Destroy(); 230 ; 231 } 232 } 233 PhysicsObject lisaaMaali() 234 { 235 PhysicsObject Maali = PhysicsObject.CreateStaticObject(RUUDUN_KOKO, RUUDUN_KOKO); 236 Maali.Image = maalinkuva; 237 AddCollisionHandler( Maali, KasitteleMaaliinTulo ); 238 return Maali; 239 240 } 241 242 void KasitteleMaaliinTulo(PhysicsObject Maali, PhysicsObject kohde) 243 { 244 if(kohde == pelaaja1) 245 { 246 kenttaNro++; 247 SeuraavaKentta(kenttaNro); 248 } 249 } 250 251 252 } 253 254 255 256 257 165 258 166 259 -
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/bin/x86/Debug/kentta1.txt
r2038 r2053 6 6 7 7 8 9 ####### ################## #############10 ######### ####### ############################## ##############11 N ###################### EEEEEEE ###################################### E ##############12 ############################################################################################################## ##################8 # E E 9 ####### ################## 10 ######### ###################### 11 N ############# E ############################## E G 12 ############################################################################################################## -
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/kentta1.txt
r2038 r2053 6 6 7 7 8 9 ####### ################## #############10 ######### ####### ############################## ##############11 N ###################### EEEEEEE ###################################### E ##############12 ############################################################################################################## ##################8 # E E 9 ####### ################## 10 ######### ###################### 11 N ############# E ############################## E G 12 ############################################################################################################## -
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/obj/x86/Debug/Fight the Rambo.csproj.FileListAbsolute.txt
r2038 r2053 9 9 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Fight the Rambo.pdb 10 10 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\maali.xnb 11 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\rambo1.xnb12 11 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\Nuhasotilas.xnb 13 12 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\shit.xnb … … 27 26 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\obj\x86\Debug\Fight the Rambo.pdb 28 27 C:\MyTemp\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\rambo2.xnb 28 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\rambo2.xnb 29 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\kill.xnb 30 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\kill.wma 31 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\Content\goal.xnb 32 C:\MyTemp\AkiR\Fight the Rambo\Fight the Rambo\Fight the Rambo\bin\x86\Debug\kentta2.txt -
2011/24/AkiR/Fight the Rambo/Fight the Rambo/Fight the Rambo/obj/x86/Debug/cachefile-{B0E0BEF2-BE44-4A05-9208-56A1391AC4FE}-targetpath.txt
r2038 r2053 1 1 Content\maali.xnb 2 2 Content\Nuhasotilas.xnb 3 Content\rambo2.xnb 3 4 Content\shit.xnb 4 5 Content\shit.wma 5 Content\rambo2.xnb 6 Content\kill.xnb 7 Content\kill.wma 8 Content\goal.xnb
Note: See TracChangeset
for help on using the changeset viewer.