Changeset 8677 for 2017/24


Ignore:
Timestamp:
2017-06-14 15:03:10 (2 years ago)
Author:
npo17_3
Message:
 
Location:
2017/24/ValtteriM/BallTag
Files:
26 added
14 edited

Legend:

Unmodified
Added
Removed
  • 2017/24/ValtteriM/BallTag/BallTag/BallTag/BallTag.cs

    r8601 r8677  
    99public class BallTag : PhysicsGame 
    1010{ 
     11    AxleJoint aj; 
     12 
    1113    PlatformCharacter naapuri; 
    1214    Image olionKuva = LoadImage("naapurileikattu"); 
     15 
     16    PhysicsObject pallo; 
    1317 
    1418    PlatformCharacter bonnie; 
     
    2327    private Image[] naapuriKavely = LoadImages("naapurileikattu1", "naapurileikattu2", "naapurileikattu3"); 
    2428    private Image[] bonnieKavely = LoadImages("bonnie1", "bonnie2", "bonnie3"); 
     29    private Image[] pika3Kavely = LoadImages("pika3", "pika4"); 
     30    private Image[] mei1Kavely = LoadImages("mei1", "mei2"); 
    2531    //Animation liike =  
    2632    public override void Begin() 
    2733    { 
     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; 
    2842        Gravity = new Vector(500.0, -500.0); 
    2943        luokentta(); 
     44        
    3045        Level.Background.Image = tas; 
    31         luohamo(); 
    32         luohamo2(); 
    33         luohamo3(); 
    34         luohamo4(); 
     46        //luohamo(); 
     47        //luohamo2(); 
     48        //luohamo3(); 
     49        //luohamo4(); 
    3550        naapuri.CollisionIgnoreGroup = 1; 
    3651        bonnie.CollisionIgnoreGroup = 1; 
    3752        mei1.CollisionIgnoreGroup = 1; 
    3853        pika3.CollisionIgnoreGroup = 1; 
     54        luopallo(); 
     55        //Camera.ZoomTo(new Vector(Level.Right+50, Level.Bottom+50), new Vector(Level.Left-50,Level.Top-50)); 
    3956 
    4057        PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    4158        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     59        Keyboard.Listen(Key.F1, ButtonState.Pressed, restart, "restart"); 
    4260 
    4361        Keyboard.Listen(Key.L, ButtonState.Down, Liikuoikealle, "Liikuoikealle", naapuri); 
     
    4664        Keyboard.Listen(Key.J, ButtonState.Released, Pysayta, "Liikuvasemmalle", naapuri); 
    4765        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 
    4871 
    4972        Keyboard.Listen(Key.D, ButtonState.Down, Liikuoikealle, "Liikuoikealle", bonnie); 
    5073        Keyboard.Listen(Key.A, ButtonState.Down, Liikuvasemmalle, "Liikuvasemmalle", bonnie); 
    5174        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 
    5282 
    5383        Keyboard.Listen(Key.NumPad6, ButtonState.Down, Liikuoikealle, "Liikuoikealle", mei1); 
    5484        Keyboard.Listen(Key.NumPad4, ButtonState.Down, Liikuvasemmalle, "Liikuvasemmalle", mei1); 
    5585        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); 
    5690 
    5791        Keyboard.Listen(Key.Right, ButtonState.Down, Liikuoikealle, "Liikuoikealle", pika3); 
    5892        Keyboard.Listen(Key.Left, ButtonState.Down, Liikuvasemmalle, "Liikuvasemmalle", pika3); 
    5993        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; 
    60108    } 
    61109    void Liikuoikealle(PlatformCharacter hamo) 
     
    64112 
    65113        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")) 
    70118        { 
    71119            hamo.AnimWalk.Resume(); 
     
    92140        TileMap ruudut = TileMap.FromLevelAsset("kentta1"); 
    93141        ruudut.SetTileMethod('#', LuoPalikka); 
    94  
     142        ruudut.SetTileMethod('N', luohamo); 
     143        ruudut.SetTileMethod('B', luohamo2); 
     144        ruudut.SetTileMethod('M', luohamo3); 
     145        ruudut.SetTileMethod('p', luohamo4); 
    95146        ruudut.Execute(50, 50); 
    96147    } 
     
    105156    } 
    106157 
    107     void luohamo() 
     158    void luohamo(Vector paikka, double leveys, double korkeus ) 
    108159    { 
    109160        naapuri = new PlatformCharacter(70, 70); 
    110161        naapuri.Image = olionKuva; 
    111162        naapuri.Tag = "naapuri"; 
     163        naapuri.Position = paikka; 
    112164        naapuri.AnimWalk = new Animation(naapuriKavely); 
     165        AddCollisionHandler(naapuri, "pallo", osuipalloon); 
    113166        //naapuri.Animation = new Animation(naapuriKavely); 
    114167        //naapuri.Animation.Start(); 
     
    117170 
    118171 
    119     void luohamo2() 
     172    void luohamo2(Vector paikka, double leveys, double korkeus ) 
    120173    { 
    121174        bonnie = new PlatformCharacter(70, 70); 
    122175        bonnie.Image = olionKuva2; 
    123176        bonnie.Tag = "bonnie"; 
     177        bonnie.Position = paikka; 
    124178        bonnie.AnimWalk = new Animation(bonnieKavely); 
    125179        Add(bonnie); 
     
    127181 
    128182    } 
    129     void luohamo3() 
     183    void luohamo3(Vector paikka, double leveys, double korkeus ) 
    130184    { 
    131185        mei1 = new PlatformCharacter(70, 70); 
    132186        mei1.Image = olionKuva3; 
     187        mei1.Tag = "mei1"; 
     188        mei1.Position = paikka; 
     189        mei1.AnimWalk = new Animation(mei1Kavely); 
    133190        Add(mei1); 
    134191 
    135192 
    136193    } 
    137     void luohamo4() 
     194    void luohamo4(Vector paikka, double leveys, double korkeus ) 
    138195    { 
    139196        pika3 = new PlatformCharacter(70, 70); 
    140197        pika3.Image = olionKuva4; 
     198        pika3.Tag = "pika3"; 
     199        pika3.Position = paikka; 
     200        pika3.AnimWalk = new Animation(pika3Kavely); 
    141201        Add(pika3); 
    142202 
    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  
    1515Content\naapuri\naapurileikattu2_0.xnb 
    1616Content\naapuri\naapurileikattu3_0.xnb 
     17Content\pika4.xnb 
     18Content\mei2.xnb 
     19Content\bonnie4.xnb 
     20Content\naapurileikattu4.xnb 
     21Content\pika5.xnb 
     22Content\mei3.xnb 
    1723Content\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  
    2424C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\bonnie2.xnb 
    2525C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\bonnie3.xnb 
     26C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\pika4.xnb 
     27C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\mei2.xnb 
     28C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\bonnie4.xnb 
     29C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\naapurileikattu4.xnb 
     30C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\pika5.xnb 
     31C:\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  
    99      <Options>None</Options> 
    1010      <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\kentta1.xnb</Output> 
    11       <Time>2017-06-13T09:47:30.5388563+03:00</Time> 
     11      <Time>2017-06-14T14:58:36.2900133+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    145145      <Output>C:\MyTemp\ValtteriM\BallTag\BallTag\BallTag\bin\x86\Debug\Content\naapuri\naapurileikattu3_0.xnb</Output> 
    146146      <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> 
    147201    </Item> 
    148202    <BuildSuccessful>true</BuildSuccessful> 
  • 2017/24/ValtteriM/BallTag/BallTag/BallTag/obj/x86/Debug/cachefile-{136D9D65-D806-4D90-A790-28D798B0E25A}-targetpath.txt

    r8601 r8677  
    1515Content\naapuri\naapurileikattu2_0.xnb 
    1616Content\naapuri\naapurileikattu3_0.xnb 
     17Content\pika4.xnb 
     18Content\mei2.xnb 
     19Content\bonnie4.xnb 
     20Content\naapurileikattu4.xnb 
     21Content\pika5.xnb 
     22Content\mei3.xnb 
    1723Content\kentta1.txt 
  • 2017/24/ValtteriM/BallTag/BallTag/BallTagContent/BallTagContent.contentproj

    r8601 r8677  
    132132    </Compile> 
    133133  </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> 
    134176  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    135177  <!--  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.