Changeset 7323


Ignore:
Timestamp:
2016-06-15 14:26:55 (3 years ago)
Author:
armahiek
Message:
 
Location:
2016/24/ArttuH
Files:
14 added
13 edited

Legend:

Unmodified
Added
Removed
  • 2016/24/ArttuH/anythin/anythin/anythin/Ohjelma.cs

    r7290 r7323  
    99        { 
    1010#if !DEBUG 
    11             game.IsFullScreen = true; 
     11             
    1212#endif 
    13             game.Run(); 
     13           game.Run(); 
    1414        } 
    1515    } 
  • 2016/24/ArttuH/anythin/anythin/anythin/anythin.cs

    r7290 r7323  
    1010{ 
    1111    PhysicsObject Player1; 
    12     LaserGun Zapper; 
     12    LaserGun Zapper0; 
     13    LaserGun Zapper1; 
     14    LaserGun Zapper2; 
     15    LaserGun Zapper3; 
     16    PlasmaCannon Sidecannon1; 
     17    PlasmaCannon Sidecannon2; 
    1318    Image playerim = LoadImage("Rocket"); 
     19    Image Asteroid10 = LoadImage("asteroid"); 
     20    Image Asteroid20 = LoadImage("aasteroid"); 
     21    Image Asteroid30 = LoadImage("Aaasteroid"); 
     22    Image Asteroid40 = LoadImage("aaaasteroid"); 
     23    DoubleMeter Plasmameter; 
    1424 
    1525    public override void Begin() 
    1626    { 
    17          
     27 
    1828        Assets(); //enemies 
    1929        Things(); //Players n stuff 
    2030        Controll(); //Controls 
     31        //Plasmatimer(); 
     32        //PlasmaGo(); //Plasmameter 
     33 
     34        Level.Background.CreateStars(30000); 
    2135        IsFullScreen = false; 
    2236 
    23          
    2437    } 
    2538    void Things() 
     
    2841        Player1 = new PhysicsObject(50.0, 50.0); 
    2942        Player1.Mass = 0.10; 
    30         Player1.LinearDamping = 0.95; 
    3143        Player1.MomentOfInertia = 50; 
    32         Player1.MaxAngularVelocity = 15; 
    33         Player1.Image = playerim;  
     44        Player1.IgnoresGravity = true; 
     45        Player1.MaxAngularVelocity = 10; 
     46        Player1.LinearDamping = 0.96; 
     47        Player1.Image = playerim; 
    3448        Add(Player1); 
    3549 
    36         //Creating Gun 
    37         Zapper = new LaserGun(0,0); 
    38         Zapper.InfiniteAmmo = true;  
    39         Zapper.ProjectileCollision = Hits; 
    40         Zapper.CanHitOwner = false; 
    41         Zapper.Image = null; 
    42         Zapper.FireRate = 1; 
    43         Player1.Add(Zapper); 
    44  
    45     } 
    46     void Hits(PhysicsObject Laser, PhysicsObject Target)//Laser collicion detection 
    47     { 
     50        //Creating Guns 
     51        //Laser 1 
     52        Zapper0 = new LaserGun(0, 0); 
     53        Zapper0.InfiniteAmmo = true; 
     54        Zapper0.ProjectileCollision = Hits; 
     55        Zapper0.CanHitOwner = false; 
     56        Zapper0.Image = null; 
     57        Zapper0.FireRate = 1.0; 
     58        Player1.Add(Zapper0); 
     59        //Laser 2 
     60        Zapper1 = new LaserGun(0, 0); 
     61        Zapper1.InfiniteAmmo = true; 
     62        Zapper1.ProjectileCollision = Hits; 
     63        Zapper1.CanHitOwner = false; 
     64        Zapper1.Image = null; 
     65        Zapper1.FireRate = 1.0; 
     66        Zapper1.Angle += Angle.FromDegrees(20); 
     67        Player1.Add(Zapper1); 
     68        //Laser 3 
     69        Zapper2 = new LaserGun(0, 0); 
     70        Zapper2.InfiniteAmmo = true; 
     71        Zapper2.ProjectileCollision = Hits; 
     72        Zapper2.CanHitOwner = false; 
     73        Zapper2.Image = null; 
     74        Zapper2.FireRate = 1.0; 
     75        Zapper2.Angle += Angle.FromDegrees(-20); 
     76        Player1.Add(Zapper2); 
     77        //Side Plasmacannon 1 
     78        Sidecannon1 = new PlasmaCannon(0, 0); 
     79        Sidecannon1.InfiniteAmmo = true; 
     80        Sidecannon1.ProjectileCollision = Cannonhits; 
     81        Sidecannon1.CanHitOwner = false; 
     82        Sidecannon1.Image = null; 
     83        Sidecannon1.FireRate = 0.3; 
     84        Sidecannon1.Angle += Angle.FromDegrees(90); 
     85        Player1.Add(Sidecannon1); 
     86        //Side Plasmacannon 2 
     87        Sidecannon2 = new PlasmaCannon(0, 0); 
     88        Sidecannon2.InfiniteAmmo = true; 
     89        Sidecannon2.ProjectileCollision = Cannonhits; 
     90        Sidecannon2.CanHitOwner = false; 
     91        Sidecannon2.Image = null; 
     92        Sidecannon2.FireRate = 0.3; 
     93        Sidecannon2.Angle += Angle.FromDegrees(-90); 
     94        Player1.Add(Sidecannon2); 
     95    } 
     96    void Hits(PhysicsObject Laser, PhysicsObject Target) 
     97    {   //laser hit detection 
    4898        Laser.Destroy(); 
     99         
     100         
     101            Target.Destroy(); 
     102         
     103         
     104    } 
     105    void Cannonhits(PhysicsObject Plasma, PhysicsObject Target) 
     106    {   //Plasmacannon hit detection 
     107        Plasma.Destroy(); 
     108        Target.Destroy(); 
    49109    } 
    50110    void Assets() 
    51111    { 
    52  
    53     } 
    54     void Controll()//Controls 
    55     { 
    56         Keyboard.Listen(Key.W, ButtonState.Down, MoveSomewhere, null); 
    57         Keyboard.Listen(Key.S, ButtonState.Down, MoveSomewhere1, null); 
     112        //Random generators 
     113        Vector RandomPoint = Level.GetRandomPosition(); 
     114        Vector Randompoint2 = Level.GetRandomPosition(); 
     115 
     116        //Asteroids 
     117        PhysicsObject Asteroid1 = new PhysicsObject(100.0, 100.0); 
     118        Asteroid1.Mass = 1.0; 
     119        Asteroid1.Position = RandomPoint; 
     120        Asteroid1.Image = Asteroid10; 
     121        Asteroid1.Shape = Shape.Hexagon; 
     122        Asteroid1.Tag = "Target"; 
     123        Add(Asteroid1); 
     124 
     125        PhysicsObject Asteroid2 = new PhysicsObject(100.0, 100.0); 
     126        Asteroid2.Mass = 1.0; 
     127        Asteroid2.Image = Asteroid30; 
     128        Asteroid2.Shape = Shape.Hexagon; 
     129        Asteroid2.Position = Randompoint2; 
     130        Asteroid2.Tag = "Target"; 
     131        Add(Asteroid2); 
     132    } 
     133    void Controll() 
     134    { 
     135        //Controls 
     136        Keyboard.Listen(Key.W, ButtonState.Down, MoveSomewhere1, null); 
     137        Keyboard.Listen(Key.S, ButtonState.Down, MoveSomewhere2, null); 
    58138        Keyboard.Listen(Key.A, ButtonState.Down, RotateSomewhere1, null); 
    59139        Keyboard.Listen(Key.D, ButtonState.Down, RotateSomewhere2, null); 
    60         Keyboard.Listen(Key.Space, ButtonState.Down, Shoot1, null, Zapper); 
     140        Keyboard.Listen(Key.Space, ButtonState.Down, Shoot1, null, Zapper0); 
     141        Keyboard.Listen(Key.Space, ButtonState.Down, Shoot1, null, Zapper1); 
     142        Keyboard.Listen(Key.Space, ButtonState.Down, Shoot1, null, Zapper2); 
     143        Keyboard.Listen(Key.Space, ButtonState.Down, Shoot1, null, Zapper3); 
     144        Keyboard.Listen(Key.C, ButtonState.Down, Shoot2, null, Sidecannon1); 
     145        Keyboard.Listen(Key.C, ButtonState.Down, Shoot2, null, Sidecannon2); 
    61146        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    62147    } 
    63148    void Shoot1(LaserGun Gun) 
    64149    { 
    65  
    66150        PhysicsObject Laser = Gun.Shoot(); 
    67  
    68        
    69  
    70          
    71     } 
    72     void MoveSomewhere() 
     151    } 
     152    void Shoot2(PlasmaCannon Gun) 
     153    { 
     154        PhysicsObject Plasma = Gun.Shoot(); 
     155    } 
     156    void MoveSomewhere1() 
    73157    { 
    74158        Vector Forward = Vector.FromLengthAndAngle(100.0, Player1.Angle); 
    75159        Player1.Push(Forward); 
    76160    } 
    77     void MoveSomewhere1() 
     161    void MoveSomewhere2() 
    78162    { 
    79163        Vector Backwards = Vector.FromLengthAndAngle(-100.0, Player1.Angle); 
     
    88172        Player1.ApplyTorque(-500.0); 
    89173    } 
    90 }    
     174    void PlasmaGo() 
     175    { 
     176        Plasmameter = new DoubleMeter(0); 
     177        Plasmameter.MaxValue = 3; 
     178 
     179 
     180        ProgressBar Thingy = new ProgressBar(200, 20); 
     181        Thingy.BindTo(Plasmameter); 
     182        Thingy.X = Screen.Left + 150; 
     183        Thingy.Y = Screen.Top - 20; 
     184        Thingy.Color = Color.Gray; 
     185        Thingy.BarColor = Color.DarkGreen; 
     186        Thingy.BorderColor = Color.White; 
     187        Add(Thingy); 
     188 
     189   } 
     190   void Plasmatimer() 
     191   { 
     192        Timer Time1 = new Timer(); 
     193        Time1.Interval = 1; 
     194        Time1.Timeout += Addone; 
     195   } 
     196    void Addone() 
     197    { 
     198        Plasmameter.Value += 1; 
     199    } 
     200} 
     201 
  • 2016/24/ArttuH/anythin/anythin/anythin/anythin.csproj.Debug.cachefile

    r7290 r7323  
    11Content\rocket.xnb 
    22Content\RocketRocket.xnb 
     3Content\asteroid.xnb 
     4Content\aasteroid.xnb 
     5Content\Aaasteroid.xnb 
     6Content\aaaasteroid.xnb 
  • 2016/24/ArttuH/anythin/anythin/anythin/obj/x86/Debug/ContentPipeline-{2BA92B91-4288-46A0-A639-6267FE61C00B}.xml

    r7290 r7323  
    1919      <Output>C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\RocketRocket.xnb</Output> 
    2020      <Time>2016-06-14T11:12:23.6249797+03:00</Time> 
     21    </Item> 
     22    <Item> 
     23      <Source>asteroid.png</Source> 
     24      <Name>asteroid</Name> 
     25      <Importer>TextureImporter</Importer> 
     26      <Processor>TextureProcessor</Processor> 
     27      <Options>None</Options> 
     28      <Output>C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\asteroid.xnb</Output> 
     29      <Time>2016-06-15T10:14:09.2116831+03:00</Time> 
     30    </Item> 
     31    <Item> 
     32      <Source>aasteroid.png</Source> 
     33      <Name>aasteroid</Name> 
     34      <Importer>TextureImporter</Importer> 
     35      <Processor>TextureProcessor</Processor> 
     36      <Options>None</Options> 
     37      <Output>C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\aasteroid.xnb</Output> 
     38      <Time>2016-06-15T10:14:15.6078471+03:00</Time> 
     39    </Item> 
     40    <Item> 
     41      <Source>Aaasteroid.png</Source> 
     42      <Name>Aaasteroid</Name> 
     43      <Importer>TextureImporter</Importer> 
     44      <Processor>TextureProcessor</Processor> 
     45      <Options>None</Options> 
     46      <Output>C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\Aaasteroid.xnb</Output> 
     47      <Time>2016-06-15T10:14:23.4080471+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>aaaasteroid.png</Source> 
     51      <Name>aaaasteroid</Name> 
     52      <Importer>TextureImporter</Importer> 
     53      <Processor>TextureProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\aaaasteroid.xnb</Output> 
     56      <Time>2016-06-15T10:14:29.0241911+03:00</Time> 
    2157    </Item> 
    2258    <BuildSuccessful>true</BuildSuccessful> 
  • 2016/24/ArttuH/anythin/anythin/anythin/obj/x86/Debug/anythin.csproj.FileListAbsolute.txt

    r7290 r7323  
    99C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\RocketRocket.xnb 
    1010C:\MyTemp\ArttuH\anythin\anythin\anythin\obj\x86\Debug\anythin.csprojResolveAssemblyReference.cache 
     11C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\asteroid.xnb 
     12C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\aasteroid.xnb 
     13C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\Aaasteroid.xnb 
     14C:\MyTemp\ArttuH\anythin\anythin\anythin\bin\x86\Debug\Content\aaaasteroid.xnb 
  • 2016/24/ArttuH/anythin/anythin/anythin/obj/x86/Debug/cachefile-{2BA92B91-4288-46A0-A639-6267FE61C00B}-targetpath.txt

    r7290 r7323  
    11Content\rocket.xnb 
    22Content\RocketRocket.xnb 
     3Content\asteroid.xnb 
     4Content\aasteroid.xnb 
     5Content\Aaasteroid.xnb 
     6Content\aaaasteroid.xnb 
  • 2016/24/ArttuH/anythin/anythin/anythinContent/anythinContent.contentproj

    r7290 r7323  
    5959    </Compile> 
    6060  </ItemGroup> 
     61  <ItemGroup> 
     62    <Compile Include="asteroid.png"> 
     63      <Name>asteroid</Name> 
     64      <Importer>TextureImporter</Importer> 
     65      <Processor>TextureProcessor</Processor> 
     66    </Compile> 
     67  </ItemGroup> 
     68  <ItemGroup> 
     69    <Compile Include="aasteroid.png"> 
     70      <Name>aasteroid</Name> 
     71      <Importer>TextureImporter</Importer> 
     72      <Processor>TextureProcessor</Processor> 
     73    </Compile> 
     74  </ItemGroup> 
     75  <ItemGroup> 
     76    <Compile Include="Aaasteroid.png"> 
     77      <Name>Aaasteroid</Name> 
     78      <Importer>TextureImporter</Importer> 
     79      <Processor>TextureProcessor</Processor> 
     80    </Compile> 
     81  </ItemGroup> 
     82  <ItemGroup> 
     83    <Compile Include="aaaasteroid.png"> 
     84      <Name>aaaasteroid</Name> 
     85      <Importer>TextureImporter</Importer> 
     86      <Processor>TextureProcessor</Processor> 
     87    </Compile> 
     88  </ItemGroup> 
    6189  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6290  <!--  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.