Changeset 8083 for 2016/30/TimoH


Ignore:
Timestamp:
2016-07-25 14:43:04 (7 years ago)
Author:
tihaapas
Message:
 
Location:
2016/30/TimoH
Files:
52 added
9 edited

Legend:

Unmodified
Added
Removed
  • 2016/30/TimoH/Ponki/Ponki/Ponki/Ponki.cs

    r8082 r8083  
    99public class Ponki : PhysicsGame 
    1010{ 
     11    Image oliokuva = LoadImage("kuva1"); 
    1112     
    1213     
    13     Vector nopeusylos = new Vector(0, 200); 
    14     Vector nopeusalas = new Vector(0, -200); 
     14    Vector nopeusYlos = new Vector(0, 200); 
     15    Vector nopeusAlas = new Vector(0, -200); 
    1516 
    1617    PhysicsObject pallo; 
    1718    PhysicsObject maila; 
    1819    PhysicsObject kapula; 
     20     
     21    IntMeter pelaajan1Pisteet; 
     22    IntMeter pelaajan2Pisteet; 
    1923 
    20      
     24 
    2125    public override void Begin() 
    2226    { 
     
    2428        asetaohjaimet(); 
    2529        aloitapeli(); 
     30        LisaaLaskurit(); 
    2631         
     32 
    2733 
    2834        // TODO: Kirjoita ohjelmakoodisi tähän 
    2935 
    30          
     36 
    3137    } 
    3238 
     
    3844        pallo.Color = Color.Red; 
    3945        pallo.Restitution = 1; 
     46        pallo.Image = oliokuva; 
    4047 
    41         maila = luomaila(Level.Left + 20, 0); 
    42         kapula = luomaila(Level.Right - 20, 0); 
     48        maila = luoKapulat(Level.Left + 20, 0); 
     49        kapula = luoKapulat(Level.Right - 20, 0); 
    4350 
    44          
     51        AddCollisionHandler(pallo, KasittelePallonTormays); 
     52 
     53 
     54        PhysicsObject vasenReuna = Level.CreateLeftBorder(); 
     55        vasenReuna.Restitution = 10.0; 
     56        vasenReuna.IsVisible = false; 
     57 
     58        PhysicsObject oikeaReuna = Level.CreateRightBorder(); 
     59        oikeaReuna.Restitution = 10.0; 
     60        oikeaReuna.KineticFriction = 0.0; 
     61        oikeaReuna.IsVisible = false; 
     62 
     63        PhysicsObject ylaReuna = Level.CreateTopBorder(); 
     64        ylaReuna.Restitution = 10.0; 
     65        ylaReuna.KineticFriction = 0.0; 
     66        ylaReuna.IsVisible = false; 
     67 
     68        PhysicsObject alaReuna = Level.CreateBottomBorder(); 
     69        alaReuna.Restitution = 10.0; 
     70        alaReuna.IsVisible = false; 
     71        alaReuna.KineticFriction = 0.0; 
    4572 
    4673 
     
    4875 
    4976        Level.Background.Color = Color.Green; 
    50         Level.CreateBorders(1, false); 
     77         
    5178 
    5279        Camera.ZoomToLevel(); 
     
    5481    } 
    5582 
     83    void KasittelePallonTormays(PhysicsObject pallo, PhysicsObject kohde) 
     84    { 
     85 
     86    } 
     87 
    5688    void aloitapeli() 
    5789    { 
    58         Vector Intussi = new Vector(1000, 0); 
     90        Vector Intussi = new Vector(500, 0); 
    5991        pallo.Hit(Intussi); 
    6092 
     
    78110    void asetaohjaimet() 
    79111    { 
    80         Keyboard.Listen(Key.W, ButtonState.Down, asetanopeus, "pelaaja 1 : Liikuta mailaa ylös", maila, nopeusYlos); 
    81         Keyboard.Listen(Key.W, ButtonState.Released, asetanopeus, null, maila, Vector.Zero); 
     112        Keyboard.Listen(Key.W, ButtonState.Down, AsetaNopeus, "pelaaja 1 : Liikuta mailaa ylös", maila, nopeusYlos); 
     113        Keyboard.Listen(Key.W, ButtonState.Released, AsetaNopeus, null, maila, Vector.Zero); 
    82114        Keyboard.Listen(Key.S, ButtonState.Down, AsetaNopeus, "Pelaaja 1: Liikuta mailaa alas", maila, nopeusAlas); 
    83115        Keyboard.Listen(Key.S, ButtonState.Released, AsetaNopeus, null, maila, Vector.Zero); 
     
    94126    } 
    95127 
    96     void asetanopeus(PhysicsObject maila, Vector nopeus) 
     128    void AsetaNopeus(PhysicsObject maila, Vector nopeus) 
    97129    { 
     130        if ((nopeus.Y < 0) && (maila.Bottom < Level.Bottom)) 
     131        { 
     132            maila.Velocity = Vector.Zero; 
     133            return; 
     134        } 
     135        if ((nopeus.Y > 0) && (maila.Top > Level.Top)) 
     136        { 
     137            maila.Velocity = Vector.Zero; 
     138            return; 
     139        } 
     140 
    98141        maila.Velocity = nopeus; 
     142    } 
    99143 
     144    void LisaaLaskurit() 
     145    { 
     146         
     147        pelaajan1Pisteet = LuoPisteLaskuri(Screen.Left + 100.0, Screen.Top - 100.0); 
     148        pelaajan2Pisteet = LuoPisteLaskuri(Screen.Right - 100.0, Screen.Top - 100.0); 
     149    } 
     150 
     151    IntMeter LuoPisteLaskuri(double x, double y) 
     152    { 
     153        IntMeter laskuri = new IntMeter(0); 
     154        laskuri.MaxValue = 10; 
     155        return laskuri; 
     156 
     157        Label naytto = new Label(); 
     158        naytto.BindTo(laskuri); 
     159        naytto.X = x; 
     160        naytto.Y = y; 
     161        naytto.TextColor = Color.White; 
     162        naytto.BorderColor = Level.Background.Color; 
     163        naytto.Color = Level.Background.Color; 
     164        Add(naytto); 
    100165    } 
    101166} 
  • 2016/30/TimoH/Ponki/Ponki/Ponki/obj/x86/Debug/ContentPipeline-{C8D4B25E-4416-496F-9869-BB2E7E5F486A}.xml

    r8082 r8083  
    22<XnaContent xmlns:Pipeline="Microsoft.Xna.Framework.Content.Pipeline"> 
    33  <Asset Type="Pipeline:BuildItemCollection"> 
     4    <Item> 
     5      <Source>kuva1.png</Source> 
     6      <Name>kuva1</Name> 
     7      <Importer>TextureImporter</Importer> 
     8      <Processor>TextureProcessor</Processor> 
     9      <Options>None</Options> 
     10      <Output>C:\MyTemp\TimoH\Ponki\Ponki\Ponki\bin\x86\Debug\Content\kuva1.xnb</Output> 
     11      <Time>2016-07-25T14:16:12.1626193+03:00</Time> 
     12    </Item> 
    413    <BuildSuccessful>true</BuildSuccessful> 
    514    <Settings> 
     
    1625    <Assemblies> 
    1726      <Assembly> 
     27        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
     28        <Value>2015-02-09T20:18:44+02:00</Value> 
     29      </Assembly> 
     30      <Assembly> 
     31        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.XImporter.dll</Key> 
     32        <Value>2011-09-01T16:22:30+03:00</Value> 
     33      </Assembly> 
     34      <Assembly> 
     35        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.VideoImporters.dll</Key> 
     36        <Value>2011-09-01T16:22:30+03:00</Value> 
     37      </Assembly> 
     38      <Assembly> 
     39        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.dll</Key> 
     40        <Value>2011-09-01T16:22:30+03:00</Value> 
     41      </Assembly> 
     42      <Assembly> 
     43        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll</Key> 
     44        <Value>2011-09-01T16:22:30+03:00</Value> 
     45      </Assembly> 
     46      <Assembly> 
     47        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.EffectImporter.dll</Key> 
     48        <Value>2011-09-01T16:22:30+03:00</Value> 
     49      </Assembly> 
     50      <Assembly> 
     51        <Key>C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Content.Pipeline.AudioImporters.dll</Key> 
     52        <Value>2011-09-01T16:22:30+03:00</Value> 
     53      </Assembly> 
     54      <Assembly> 
     55        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 
     56        <Value>2015-02-17T22:27:18+02:00</Value> 
     57      </Assembly> 
     58      <Assembly> 
    1859        <Key>C:\Windows\Microsoft.Net\assembly\GAC_32\Microsoft.Xna.Framework.Content.Pipeline\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Content.Pipeline.dll</Key> 
    1960        <Value>2015-09-16T19:26:07.6285999+03:00</Value> 
  • 2016/30/TimoH/Ponki/Ponki/Ponki/obj/x86/Debug/Ponki.csproj.FileListAbsolute.txt

    r8082 r8083  
    77C:\MyTemp\TimoH\Ponki\Ponki\Ponki\obj\x86\Debug\Ponki.exe 
    88C:\MyTemp\TimoH\Ponki\Ponki\Ponki\obj\x86\Debug\Ponki.pdb 
     9C:\MyTemp\TimoH\Ponki\Ponki\Ponki\bin\x86\Debug\Content\kuva1.xnb 
  • 2016/30/TimoH/Ponki/Ponki/PonkiContent/PonkiContent.contentproj

    r8082 r8083  
    4545    <Reference Include="AnimationExtension" /> 
    4646  </ItemGroup> 
     47  <ItemGroup> 
     48    <Compile Include="kuva1.png"> 
     49      <Name>kuva1</Name> 
     50      <Importer>TextureImporter</Importer> 
     51      <Processor>TextureProcessor</Processor> 
     52    </Compile> 
     53  </ItemGroup> 
    4754  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    4855  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
Note: See TracChangeset for help on using the changeset viewer.