Changeset 7677


Ignore:
Timestamp:
2016-07-04 11:29:04 (7 years ago)
Author:
juleppaa
Message:

skaala

Location:
2016/24/JustusL/Object_Ball/Object_Ball
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/JustusL/Object_Ball/Object_Ball/Object_Ball/Object_Ball.cs

    r7669 r7677  
    1818    Image[] painikeKuvat = LoadImages("kaariosa", "kyna", "palikka"); 
    1919 
     20    bool liikkes; 
    2021 
    2122    Label hiiri; 
     
    2324    PhysicsObject maali; 
    2425    PhysicsObject tahti; 
     26 
     27    GameObject haamu; 
    2528 
    2629    Timer ajastin; 
     
    7982        { 
    8083            tyokalu = paikka; 
     84 
     85            if (tyokalu == 0 || tyokalu == 2) 
     86            { 
     87                if (haamu != null) haamu.Destroy(); 
     88                haamu = new GameObject(100, 100); 
     89                Add(haamu); 
     90                if (tyokalu == 0) haamu.Image = kaarikuva; 
     91                if (tyokalu == 2) haamu.Color = Color.Black; 
     92            } 
    8193        }; 
    8294 
     
    97109        Keyboard.Listen(Key.Enter, ButtonState.Pressed, PalloLiikkeelle, "Start"); 
    98110 
    99         //Keyboard.Listen(Key.Right, ButtonState.Down, MuutaKulmaa, null); 
     111        Keyboard.Listen(Key.NumPad1, ButtonState.Down, MuutaKulmaa, null, 1); 
     112        Keyboard.Listen(Key.NumPad3, ButtonState.Down, MuutaKulmaa, null, -1); 
     113        Keyboard.Listen(Key.Right, ButtonState.Down, MuutaSkaalaa, null, new Vector(1,0)); 
     114        Keyboard.Listen(Key.Left, ButtonState.Down, MuutaSkaalaa, null, new Vector(-1, 0)); 
     115        Keyboard.Listen(Key.Up, ButtonState.Down, MuutaSkaalaa, null, new Vector(0, 1)); 
     116        Keyboard.Listen(Key.Down, ButtonState.Down, MuutaSkaalaa, null, new Vector(0, -1)); 
    100117    } 
    101118 
    102119    void HiiriPainettu() 
    103120    { 
    104         if (tyokalu == 0) 
    105         { 
    106  
    107             PhysicsObject kaari = PhysicsObject.CreateStaticObject(500, 200); 
     121        if (tyokalu == 0 && !liikkes) 
     122        { 
     123             
     124            PhysicsObject kaari = PhysicsObject.CreateStaticObject(haamu.Width, haamu.Height); 
    108125            kaari.Shape = Shape.FromImage(kaarikuva); 
    109             kaari.Angle = Angle.FromDegrees(160); 
     126            kaari.Angle = haamu.Angle; 
    110127            kaari.Image = kaarikuva; 
    111128            kaari.Position = Mouse.PositionOnWorld; 
    112129            Add(kaari); 
    113130        } 
    114         if (tyokalu == 2) 
    115         { 
    116             PhysicsObject kuutio = PhysicsObject.CreateStaticObject(40, 40); 
     131        if (tyokalu == 2 && !liikkes) 
     132        { 
     133            PhysicsObject kuutio = PhysicsObject.CreateStaticObject(haamu.Width, haamu.Height); 
    117134            kuutio.Shape = Shape.Rectangle; 
     135            kuutio.Angle = haamu.Angle; 
    118136            kuutio.Color = Color.Black; 
    119137            kuutio.Position = Mouse.PositionOnWorld; 
     
    153171    } 
    154172 
    155     void MuutaKulmaa(PhysicsObject kappale, int muutos) 
     173    void MuutaKulmaa( int muutos) 
    156174    { 
    157175        if(tyokalu == 0 || tyokalu == 2) 
    158176        { 
    159             //kappale.Angle += muutos; 
     177            haamu.Angle += Angle.FromDegrees(muutos); 
     178        } 
     179    } 
     180    void MuutaSkaalaa(Vector skaala) 
     181    { 
     182        if (haamu != null) 
     183        { 
     184            haamu.Size += skaala; 
    160185        } 
    161186    } 
     
    215240       hiiri.Image = kursori; 
    216241         
    217         Mouse.ListenMovement(0.1, HiirenSeuraus, null); 
     242        Mouse.ListenMovement(0.0, HiirenSeuraus, null); 
    218243        Add(hiiri); 
    219244 
     
    225250        hiiri.Position = Mouse.PositionOnScreen; 
    226251        Camera.StayInLevel = true; 
     252        if (haamu != null) 
     253        { 
     254            haamu.Position = hiiri.Position; 
     255        } 
     256 
    227257    } 
    228258    void PalloLiikkeelle() 
     
    233263        pallo.IgnoresPhysicsLogics = false; 
    234264 
     265        liikkes = true; 
     266 
    235267        ajastin = new Timer(); 
    236268        ajastin.Interval = 0.5; 
     
    242274    void TarkistaNopeus() 
    243275    { 
    244         if (pallo.Velocity.Magnitude < 0.01) 
     276        if (pallo.Velocity.Magnitude < 0.03) 
    245277        { 
    246278 
  • 2016/24/JustusL/Object_Ball/Object_Ball/Object_Ball/obj/x86/Debug/ContentPipeline-{CD347656-A8F2-48EE-8097-A4F9AF1242F0}.xml

    r7370 r7677  
    88      <Processor>TextureProcessor</Processor> 
    99      <Options>None</Options> 
    10       <Output>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kaarikakka.xnb</Output> 
    11       <Time>2016-06-16T11:35:20.4922466+03:00</Time> 
     10      <Output>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kaarikakka.xnb</Output> 
     11      <Time>2016-07-04T10:29:37.230784+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1717      <Processor>TextureProcessor</Processor> 
    1818      <Options>None</Options> 
    19       <Output>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kaariosa.xnb</Output> 
    20       <Time>2016-06-16T12:22:54.0854567+03:00</Time> 
     19      <Output>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kaariosa.xnb</Output> 
     20      <Time>2016-07-04T10:29:37.230784+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2626      <Processor>TextureProcessor</Processor> 
    2727      <Options>None</Options> 
    28       <Output>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kyna.xnb</Output> 
    29       <Time>2016-06-16T12:22:55.824712+03:00</Time> 
     28      <Output>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kyna.xnb</Output> 
     29      <Time>2016-07-04T10:29:37.090384+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3535      <Processor>TextureProcessor</Processor> 
    3636      <Options>None</Options> 
    37       <Output>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\maali_objectBall.xnb</Output> 
    38       <Time>2016-06-16T11:35:20.5217772+03:00</Time> 
     37      <Output>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\maali_objectBall.xnb</Output> 
     38      <Time>2016-07-04T10:29:37.090384+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4444      <Processor>TextureProcessor</Processor> 
    4545      <Options>None</Options> 
    46       <Output>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\palikka kursori.xnb</Output> 
    47       <Time>2016-06-16T11:35:20.5287781+03:00</Time> 
     46      <Output>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\palikka kursori.xnb</Output> 
     47      <Time>2016-07-04T10:29:37.230784+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5353      <Processor>TextureProcessor</Processor> 
    5454      <Options>None</Options> 
    55       <Output>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\palikka.xnb</Output> 
    56       <Time>2016-06-16T12:22:56.4812302+03:00</Time> 
     55      <Output>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\palikka.xnb</Output> 
     56      <Time>2016-07-04T10:29:37.090384+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6262      <Processor>TextureProcessor</Processor> 
    6363      <Options>None</Options> 
    64       <Output>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\ruutu.xnb</Output> 
    65       <Time>2016-06-16T11:35:20.5417776+03:00</Time> 
     64      <Output>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\ruutu.xnb</Output> 
     65      <Time>2016-07-04T10:29:37.105984+03:00</Time> 
    6666    </Item> 
    6767    <BuildSuccessful>true</BuildSuccessful> 
     
    7272      <BuildConfiguration>Debug</BuildConfiguration> 
    7373      <CompressContent>false</CompressContent> 
    74       <RootDirectory>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_BallContent\</RootDirectory> 
    75       <LoggerRootDirectory>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\</LoggerRootDirectory> 
    76       <IntermediateDirectory>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\</IntermediateDirectory> 
    77       <OutputDirectory>C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\</OutputDirectory> 
     74      <RootDirectory>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_BallContent\</RootDirectory> 
     75      <LoggerRootDirectory>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\</LoggerRootDirectory> 
     76      <IntermediateDirectory>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\</IntermediateDirectory> 
     77      <OutputDirectory>C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\</OutputDirectory> 
    7878    </Settings> 
    7979    <Assemblies> 
    8080      <Assembly> 
    81         <Key>C:\Users\Justus\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
    82         <Value>2015-04-01T18:41:16+03:00</Value> 
     81        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\TextFileContentExtension.dll</Key> 
     82        <Value>2015-02-09T20:18:44+02:00</Value> 
    8383      </Assembly> 
    8484      <Assembly> 
     
    107107      </Assembly> 
    108108      <Assembly> 
    109         <Key>C:\Users\Justus\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 
    110         <Value>2015-04-01T18:41:16+03:00</Value> 
     109        <Key>C:\Program Files (x86)\Jypeli\lib\ContentExtensions\AnimationExtension.dll</Key> 
     110        <Value>2015-02-17T22:27:18+02:00</Value> 
    111111      </Assembly> 
    112112      <Assembly> 
    113         <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> 
    114         <Value>2015-12-15T06:54:21.9346879+02:00</Value> 
     113        <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> 
     114        <Value>2015-09-16T19:42:13.6500946+03:00</Value> 
    115115      </Assembly> 
    116116    </Assemblies> 
  • 2016/24/JustusL/Object_Ball/Object_Ball/Object_Ball/obj/x86/Debug/Object_Ball.csproj.FileListAbsolute.txt

    r7370 r7677  
    2929C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\Object_Ball.exe 
    3030C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\Object_Ball.pdb 
     31C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kaarikakka.xnb 
     32C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kaariosa.xnb 
     33C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\kyna.xnb 
     34C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\maali_objectBall.xnb 
     35C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\palikka kursori.xnb 
     36C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\palikka.xnb 
     37C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Content\ruutu.xnb 
     38C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Object_Ball.exe 
     39C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Object_Ball.pdb 
     40C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Jypeli.dll 
     41C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\bin\x86\Debug\Jypeli.xml 
     42C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\Object_Ball.csprojResolveAssemblyReference.cache 
     43C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
     44C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\Object_Ball.exe 
     45C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_Ball\obj\x86\Debug\Object_Ball.pdb 
  • 2016/24/JustusL/Object_Ball/Object_Ball/Object_BallContent/obj/x86/Debug/Object_BallContent.contentproj.FileListAbsolute.txt

    r7370 r7677  
    11C:\Users\Justus\Documents\jypeli\Object_Ball\Object_Ball\Object_BallContent\obj\x86\Debug\Object_BallContent.contentprojResolveAssemblyReference.cache 
    22C:\Users\Justus\Documents\JustusL\Object_Ball\Object_Ball\Object_BallContent\obj\x86\Debug\Object_BallContent.contentprojResolveAssemblyReference.cache 
     3C:\MyTemp\JustusL\Object_Ball\Object_Ball\Object_BallContent\obj\x86\Debug\Object_BallContent.contentprojResolveAssemblyReference.cache 
Note: See TracChangeset for help on using the changeset viewer.