Changeset 8677
- Timestamp:
- 2017-06-14 15:03:10 (4 years ago)
- Location:
- 2017/24/ValtteriM/BallTag
- Files:
-
- 26 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
2017/24/ValtteriM/BallTag/BallTag/BallTag/BallTag.cs
r8601 r8677 9 9 public class BallTag : PhysicsGame 10 10 { 11 AxleJoint aj; 12 11 13 PlatformCharacter naapuri; 12 14 Image olionKuva = LoadImage("naapurileikattu"); 15 16 PhysicsObject pallo; 13 17 14 18 PlatformCharacter bonnie; … … 23 27 private Image[] naapuriKavely = LoadImages("naapurileikattu1", "naapurileikattu2", "naapurileikattu3"); 24 28 private Image[] bonnieKavely = LoadImages("bonnie1", "bonnie2", "bonnie3"); 29 private Image[] pika3Kavely = LoadImages("pika3", "pika4"); 30 private Image[] mei1Kavely = LoadImages("mei1", "mei2"); 25 31 //Animation liike = 26 32 public override void Begin() 27 33 { 34 //Window.Width = 1800; 35 //Window.Height = 1000; 36 Level.Width = Screen.Width; 37 Level.Height = Screen.Height; 38 Level.Width = Window.Width; 39 Level.Height = Window.Height; 40 41 //IsFullScreen = true; 28 42 Gravity = new Vector(500.0, -500.0); 29 43 luokentta(); 44 30 45 Level.Background.Image = tas; 31 luohamo();32 luohamo2();33 luohamo3();34 luohamo4();46 //luohamo(); 47 //luohamo2(); 48 //luohamo3(); 49 //luohamo4(); 35 50 naapuri.CollisionIgnoreGroup = 1; 36 51 bonnie.CollisionIgnoreGroup = 1; 37 52 mei1.CollisionIgnoreGroup = 1; 38 53 pika3.CollisionIgnoreGroup = 1; 54 luopallo(); 55 //Camera.ZoomTo(new Vector(Level.Right+50, Level.Bottom+50), new Vector(Level.Left-50,Level.Top-50)); 39 56 40 57 PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 41 58 Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 59 Keyboard.Listen(Key.F1, ButtonState.Pressed, restart, "restart"); 42 60 43 61 Keyboard.Listen(Key.L, ButtonState.Down, Liikuoikealle, "Liikuoikealle", naapuri); … … 46 64 Keyboard.Listen(Key.J, ButtonState.Released, Pysayta, "Liikuvasemmalle", naapuri); 47 65 Keyboard.Listen(Key.I, ButtonState.Pressed, hyppaa, "hyppaa", naapuri); 66 Keyboard.Listen(Key.K, ButtonState.Down, kyykky, "Liikuvasemmalle", naapuri); 67 Keyboard.Listen(Key.K, ButtonState.Released, nouse, "Liikuvasemmalle", naapuri); 68 69 Keyboard.Listen(Key.O, ButtonState.Pressed, heita, "heita", naapuri); 70 48 71 49 72 Keyboard.Listen(Key.D, ButtonState.Down, Liikuoikealle, "Liikuoikealle", bonnie); 50 73 Keyboard.Listen(Key.A, ButtonState.Down, Liikuvasemmalle, "Liikuvasemmalle", bonnie); 51 74 Keyboard.Listen(Key.W, ButtonState.Pressed, hyppaa, "hyppaa", bonnie); 75 Keyboard.Listen(Key.A, ButtonState.Released, Pysayta, "Liikuvasemmalle", bonnie); 76 Keyboard.Listen(Key.D, ButtonState.Released, Pysayta, "Liikuoikealle", bonnie); 77 Keyboard.Listen(Key.S, ButtonState.Down, kyykky, "kyykky", bonnie); 78 Keyboard.Listen(Key.S, ButtonState.Released, nouse, "nouse", bonnie); 79 80 81 52 82 53 83 Keyboard.Listen(Key.NumPad6, ButtonState.Down, Liikuoikealle, "Liikuoikealle", mei1); 54 84 Keyboard.Listen(Key.NumPad4, ButtonState.Down, Liikuvasemmalle, "Liikuvasemmalle", mei1); 55 85 Keyboard.Listen(Key.NumPad8, ButtonState.Pressed, hyppaa, "hyppaa", mei1); 86 Keyboard.Listen(Key.NumPad4, ButtonState.Released, Pysayta, "Liikuvasemmalle", mei1); 87 Keyboard.Listen(Key.NumPad6, ButtonState.Released, Pysayta, "Liikuoikealle", mei1); 88 Keyboard.Listen(Key.NumPad5, ButtonState.Down, kyykky, "kyykky", mei1); 89 Keyboard.Listen(Key.NumPad5, ButtonState.Released, nouse, "nouse", mei1); 56 90 57 91 Keyboard.Listen(Key.Right, ButtonState.Down, Liikuoikealle, "Liikuoikealle", pika3); 58 92 Keyboard.Listen(Key.Left, ButtonState.Down, Liikuvasemmalle, "Liikuvasemmalle", pika3); 59 93 Keyboard.Listen(Key.Up, ButtonState.Pressed, hyppaa, "hyppaa", pika3); 94 Keyboard.Listen(Key.Left, ButtonState.Released, Pysayta, "Liikuvasemmalle", pika3); 95 Keyboard.Listen(Key.Right, ButtonState.Released, Pysayta, "Liikuoikealle", pika3); 96 Keyboard.Listen(Key.Down, ButtonState.Down, kyykky, "kyykky", pika3); 97 Keyboard.Listen(Key.Down, ButtonState.Released, nouse, "nouse", pika3); 98 } 99 void kyykky(PlatformCharacter hamo) 100 {if (hamo.Height > 65) 101 { 102 hamo.Height = hamo.Height / 2; 103 } 104 } 105 void nouse(PlatformCharacter hamo) 106 { 107 hamo.Height = hamo.Height *2; 60 108 } 61 109 void Liikuoikealle(PlatformCharacter hamo) … … 64 112 65 113 hamo.Walk(500.0); 66 67 68 69 if (hamo.Tag.Equals("naapuri"))114 115 116 // if (hamo.Tag.Equals("bonnie")) 117 // if (hamo.Tag.Equals("naapuri")) 70 118 { 71 119 hamo.AnimWalk.Resume(); … … 92 140 TileMap ruudut = TileMap.FromLevelAsset("kentta1"); 93 141 ruudut.SetTileMethod('#', LuoPalikka); 94 142 ruudut.SetTileMethod('N', luohamo); 143 ruudut.SetTileMethod('B', luohamo2); 144 ruudut.SetTileMethod('M', luohamo3); 145 ruudut.SetTileMethod('p', luohamo4); 95 146 ruudut.Execute(50, 50); 96 147 } … … 105 156 } 106 157 107 void luohamo( )158 void luohamo(Vector paikka, double leveys, double korkeus ) 108 159 { 109 160 naapuri = new PlatformCharacter(70, 70); 110 161 naapuri.Image = olionKuva; 111 162 naapuri.Tag = "naapuri"; 163 naapuri.Position = paikka; 112 164 naapuri.AnimWalk = new Animation(naapuriKavely); 165 AddCollisionHandler(naapuri, "pallo", osuipalloon); 113 166 //naapuri.Animation = new Animation(naapuriKavely); 114 167 //naapuri.Animation.Start(); … … 117 170 118 171 119 void luohamo2( )172 void luohamo2(Vector paikka, double leveys, double korkeus ) 120 173 { 121 174 bonnie = new PlatformCharacter(70, 70); 122 175 bonnie.Image = olionKuva2; 123 176 bonnie.Tag = "bonnie"; 177 bonnie.Position = paikka; 124 178 bonnie.AnimWalk = new Animation(bonnieKavely); 125 179 Add(bonnie); … … 127 181 128 182 } 129 void luohamo3( )183 void luohamo3(Vector paikka, double leveys, double korkeus ) 130 184 { 131 185 mei1 = new PlatformCharacter(70, 70); 132 186 mei1.Image = olionKuva3; 187 mei1.Tag = "mei1"; 188 mei1.Position = paikka; 189 mei1.AnimWalk = new Animation(mei1Kavely); 133 190 Add(mei1); 134 191 135 192 136 193 } 137 void luohamo4( )194 void luohamo4(Vector paikka, double leveys, double korkeus ) 138 195 { 139 196 pika3 = new PlatformCharacter(70, 70); 140 197 pika3.Image = olionKuva4; 198 pika3.Tag = "pika3"; 199 pika3.Position = paikka; 200 pika3.AnimWalk = new Animation(pika3Kavely); 141 201 Add(pika3); 142 202 143 144 } 145 146 } 147 148 149 150 151 152 153 203 204 } 205 void restart() 206 { 207 208 ClearAll(); 209 luokentta(); 210 Begin(); 211 }void luopallo() 212 { 213 pallo = new PhysicsObject(40, 40,Shape.Circle); 214 pallo.Tag = "pallo"; 215 Add(pallo); 216 }void osuipalloon(PhysicsObject hamo,PhysicsObject kohde) 217 { 218 aj = new AxleJoint(hamo, kohde); 219 Add(aj); 220 }void heita(PlatformCharacter heittaja) 221 { 222 aj.Destroy(); 223 pallo.Hit(new Vector(1000,1000)); 224 } 225 } 226 227 228 229 230 231 232 -
2017/24/ValtteriM/BallTag/BallTag/BallTag/BallTag.csproj.Debug.cachefile
r8601 r8677 15 15 Content\naapuri\naapurileikattu2_0.xnb 16 16 Content\naapuri\naapurileikattu3_0.xnb 17 Content\pika4.xnb 18 Content\mei2.xnb 19 Content\bonnie4.xnb 20 Content\naapurileikattu4.xnb 21 Content\pika5.xnb 22 Content\mei3.xnb 17 23 Content\kentta1.txt -
2017/24/ValtteriM/BallTag/BallTag/BallTag/bin/x86/Debug/Content/kentta1.txt
r8530 r8677 1 ###################### 2 #....................# 3 #....................# 4 #....................# 5 #....................# 6 #...###.....###......# 7 #....................# 8 #....................# 9 #.............####...# 10 #.....##......#..#...# 11 #...........##....#..# 12 #....................# 13 #....................# 14 ###################### 1 ############################### 2 #.............................# 3 #....##.......................# 4 #..................##.........# 5 #.##..........................# 6 #....M..................##....# 7 #...###.....###...............# 8 #........................p....# 9 #........................##...# 10 #.............####............# 11 #.....##......#..#............# 12 ###.........##....#...##.....## 13 #......N......................# 14 #.....##.................#.B..# 15 ############################### -
2017/24/ValtteriM/BallTag/BallTag/BallTag/obj/x86/Debug/BallTag.csproj.FileListAbsolute.txt
r8601 r8677 24 24 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\bonnie2.xnb 25 25 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\bonnie3.xnb 26 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\pika4.xnb 27 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\mei2.xnb 28 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\bonnie4.xnb 29 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\naapurileikattu4.xnb 30 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\pika5.xnb 31 C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\mei3.xnb -
2017/24/ValtteriM/BallTag/BallTag/BallTag/obj/x86/Debug/ContentPipeline-{136D9D65-D806-4D90-A790-28D798B0E25A}.xml
r8601 r8677 9 9 <Options>None</Options> 10 10 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\kentta1.xnb</Output> 11 <Time>2017-06-1 3T09:47:30.5388563+03:00</Time>11 <Time>2017-06-14T14:58:36.2900133+03:00</Time> 12 12 </Item> 13 13 <Item> … … 145 145 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\naapuri\naapurileikattu3_0.xnb</Output> 146 146 <Time>2017-06-13T12:41:10.1522611+03:00</Time> 147 </Item> 148 <Item> 149 <Source>pika4.png</Source> 150 <Name>pika4</Name> 151 <Importer>TextureImporter</Importer> 152 <Processor>TextureProcessor</Processor> 153 <Options>None</Options> 154 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\pika4.xnb</Output> 155 <Time>2017-06-14T10:04:24.4057012+03:00</Time> 156 </Item> 157 <Item> 158 <Source>mei2.png</Source> 159 <Name>mei2</Name> 160 <Importer>TextureImporter</Importer> 161 <Processor>TextureProcessor</Processor> 162 <Options>None</Options> 163 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\mei2.xnb</Output> 164 <Time>2017-06-14T10:17:04.796167+03:00</Time> 165 </Item> 166 <Item> 167 <Source>bonnie4.png</Source> 168 <Name>bonnie4</Name> 169 <Importer>TextureImporter</Importer> 170 <Processor>TextureProcessor</Processor> 171 <Options>None</Options> 172 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\bonnie4.xnb</Output> 173 <Time>2017-06-14T10:35:15.3630646+03:00</Time> 174 </Item> 175 <Item> 176 <Source>naapurileikattu4.png</Source> 177 <Name>naapurileikattu4</Name> 178 <Importer>TextureImporter</Importer> 179 <Processor>TextureProcessor</Processor> 180 <Options>None</Options> 181 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\naapurileikattu4.xnb</Output> 182 <Time>2017-06-14T11:19:20.2882863+03:00</Time> 183 </Item> 184 <Item> 185 <Source>pika5.png</Source> 186 <Name>pika5</Name> 187 <Importer>TextureImporter</Importer> 188 <Processor>TextureProcessor</Processor> 189 <Options>None</Options> 190 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\pika5.xnb</Output> 191 <Time>2017-06-14T11:56:00.5046145+03:00</Time> 192 </Item> 193 <Item> 194 <Source>mei3.png</Source> 195 <Name>mei3</Name> 196 <Importer>TextureImporter</Importer> 197 <Processor>TextureProcessor</Processor> 198 <Options>None</Options> 199 <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\mei3.xnb</Output> 200 <Time>2017-06-14T11:59:49.4347183+03:00</Time> 147 201 </Item> 148 202 <BuildSuccessful>true</BuildSuccessful> -
2017/24/ValtteriM/BallTag/BallTag/BallTag/obj/x86/Debug/cachefile-{136D9D65-D806-4D90-A790-28D798B0E25A}-targetpath.txt
r8601 r8677 15 15 Content\naapuri\naapurileikattu2_0.xnb 16 16 Content\naapuri\naapurileikattu3_0.xnb 17 Content\pika4.xnb 18 Content\mei2.xnb 19 Content\bonnie4.xnb 20 Content\naapurileikattu4.xnb 21 Content\pika5.xnb 22 Content\mei3.xnb 17 23 Content\kentta1.txt -
2017/24/ValtteriM/BallTag/BallTag/BallTagContent/BallTagContent.contentproj
r8601 r8677 132 132 </Compile> 133 133 </ItemGroup> 134 <ItemGroup> 135 <Compile Include="pika4.png"> 136 <Name>pika4</Name> 137 <Importer>TextureImporter</Importer> 138 <Processor>TextureProcessor</Processor> 139 </Compile> 140 </ItemGroup> 141 <ItemGroup> 142 <Compile Include="mei2.png"> 143 <Name>mei2</Name> 144 <Importer>TextureImporter</Importer> 145 <Processor>TextureProcessor</Processor> 146 </Compile> 147 </ItemGroup> 148 <ItemGroup> 149 <Compile Include="bonnie4.png"> 150 <Name>bonnie4</Name> 151 <Importer>TextureImporter</Importer> 152 <Processor>TextureProcessor</Processor> 153 </Compile> 154 </ItemGroup> 155 <ItemGroup> 156 <Compile Include="naapurileikattu4.png"> 157 <Name>naapurileikattu4</Name> 158 <Importer>TextureImporter</Importer> 159 <Processor>TextureProcessor</Processor> 160 </Compile> 161 </ItemGroup> 162 <ItemGroup> 163 <Compile Include="pika5.png"> 164 <Name>pika5</Name> 165 <Importer>TextureImporter</Importer> 166 <Processor>TextureProcessor</Processor> 167 </Compile> 168 </ItemGroup> 169 <ItemGroup> 170 <Compile Include="mei3.png"> 171 <Name>mei3</Name> 172 <Importer>TextureImporter</Importer> 173 <Processor>TextureProcessor</Processor> 174 </Compile> 175 </ItemGroup> 134 176 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 135 177 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2017/24/ValtteriM/BallTag/BallTag/BallTagContent/kentta1.txt
r8530 r8677 1 ###################### 2 #....................# 3 #....................# 4 #....................# 5 #....................# 6 #...###.....###......# 7 #....................# 8 #....................# 9 #.............####...# 10 #.....##......#..#...# 11 #...........##....#..# 12 #....................# 13 #....................# 14 ###################### 1 ############################### 2 #.............................# 3 #....##.......................# 4 #..................##.........# 5 #.##..........................# 6 #....M..................##....# 7 #...###.....###...............# 8 #........................p....# 9 #........................##...# 10 #.............####............# 11 #.....##......#..#............# 12 ###.........##....#...##.....## 13 #......N......................# 14 #.....##.................#.B..# 15 ###############################
Note: See TracChangeset
for help on using the changeset viewer.