Changeset 8681 for 2017/24/SamuelN


Ignore:
Timestamp:
2017-06-14 15:07:23 (2 years ago)
Author:
npo17_6
Message:
 
Location:
2017/24/SamuelN
Files:
62 added
3 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • 2017/24/SamuelN/Bottleflip/Bottleflip/Bottleflip/Bottleflip.cs

    r8644 r8681  
    1313    PhysicsObject ylareuna; 
    1414    int y; 
     15    int i; 
     16    int hax; 
    1517 
    1618    public override void Begin() 
     
    2022        IsFullScreen = true; 
    2123        IsMouseVisible = true; 
    22         MultiSelectWindow alkuValikko = new MultiSelectWindow("Bottle Flip Sim 2.0", "Start", "Buy Bottles", "Exit"); 
     24        MultiSelectWindow alkuValikko = new MultiSelectWindow("Bottle Flip 2.0", "Start Game (Select Bottle)", "Exit"); 
    2325        alkuValikko.Image = LoadImage("pullo"); 
    2426        alkuValikko.IsVisible = false; 
    25         alkuValikko.AddItemHandler(0, AloitaPeli); 
    26         alkuValikko.AddItemHandler(1, OpenShop); 
    27         alkuValikko.AddItemHandler(2, Exit); 
     27        alkuValikko.AddItemHandler(0, OpenShop); 
     28        alkuValikko.AddItemHandler(1, Exit); 
    2829        Add(alkuValikko); 
    2930         
     
    3132    void OpenShop() 
    3233    { 
    33         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Exit"); 
    34  
    35         Widget ruutu1 = new Widget(120.0, 360.0); 
    36         ruutu1.X = Screen.LeftSafe + 200; 
    37         ruutu1.Y = Screen.TopSafe - 200; 
    38         ruutu1.Image = LoadImage("pullo"); 
    39         Add(ruutu1); 
    40  
    41         Widget ruutu2 = new Widget(120.0, 360.0); 
    42         ruutu2.X = Screen.LeftSafe + 450; 
    43         ruutu2.Y = Screen.TopSafe - 200; 
    44         ruutu2.Image = LoadImage("pullo2"); 
    45         Add(ruutu2); 
    46  
    47         Widget ruutu3 = new Widget(200.0, 300.0); 
    48         ruutu3.X = Screen.LeftSafe + 700; 
    49         ruutu3.Y = Screen.TopSafe - 200; 
    50         //ruutu3.Image = LoadImage("pullo3"); 
    51         Add(ruutu3); 
     34        InputWindow kysymysIkkuna = new InputWindow("Write bottle number"); 
     35        kysymysIkkuna.TextEntered += bottle; 
     36        Add(kysymysIkkuna); 
     37    } 
     38    void bottle(InputWindow ikkuna) 
     39    { 
     40        string vastaus = ikkuna.InputBox.Text; 
     41 
     42        if (vastaus == "1") 
     43        { 
     44            i = 1; 
     45        } 
     46        else if (vastaus == "2") 
     47        { 
     48            i = 2; 
     49        } 
     50        else if (vastaus == "exit") 
     51        { 
     52            Exit(); 
     53        } 
     54        Nimi(); 
     55    } 
     56    void Nimi () 
     57    { 
     58        InputWindow kysymysIkkuna = new InputWindow("Write your name"); 
     59        kysymysIkkuna.TextEntered += nim; 
     60        Add(kysymysIkkuna); 
     61    } 
     62    void nim (InputWindow h4x) 
     63    { 
     64        string vast = h4x.InputBox.Text; 
     65        if (vast == "admin") 
     66        { 
     67            hax = 1; 
     68            AloitaPeli(); 
     69        } 
     70        else 
     71            hax = 0; 
     72        AloitaPeli(); 
    5273    } 
    5374    void AloitaPeli() 
     
    6990        pullo = new PhysicsObject(40, 120); 
    7091        Camera.ZoomFactor = 1; 
    71         pullo.Image = LoadImage("pullo"); 
     92        if (i == 1) 
     93        { 
     94            pullo.Image = LoadImage("pullo"); 
     95        } 
     96        else if (i == 2) 
     97        { 
     98            pullo.Image = LoadImage("pullo2"); 
     99        } 
    72100        pullo.Y = 0; 
    73101        pullo.Shape = Shape.FromImage(LoadImage("pullo")); 
    74102        AddCollisionHandler(pullo, "alareuna", d); 
    75103        Add(pullo); 
    76  
    77         /*PhysicsObject pullonpohja = new PhysicsObject(20, 10); 
    78         pullonpohja.X = pullo.X; 
    79         pullonpohja.Y = pullo.Bottom + 10; 
    80         Add(pullonpohja); 
    81  
    82         AxleJoint aj = new AxleJoint(pullo, pullonpohja); 
    83          
    84         Add(aj);*/ 
    85104 
    86105        alareuna = PhysicsObject.CreateStaticObject(2000, 200); 
     
    130149        Pause(); 
    131150        string vastaus = ikkuna.InputBox.Text; 
    132         if (vastaus == "flip = true") 
     151        if (vastaus == "flip true") 
    133152        { 
    134153            pullo.Angle = Angle.FromDegrees(0); 
    135154        } 
    136         else if (vastaus == "   exit") 
     155        else if (vastaus == "exit") 
    137156        { 
    138157            Exit(); 
    139         } 
    140         else if (vastaus == "bottle1") 
    141         { 
    142             pullo.Image = LoadImage("pullo"); 
    143         } 
    144         else if (vastaus == "bottle2") 
    145         { 
    146             pullo.Image = LoadImage("pullo2"); 
    147158        } 
    148159    } 
     
    168179        pullo.Hit(new Vector(50, y)); 
    169180        pullo.AngularVelocity = 30; 
    170         MessageDisplay.Add(y.ToString()); 
     181        if (hax == 1) 
     182        { 
     183            MessageDisplay.Add(y.ToString()); 
     184        } 
    171185        aikaLaskuri.Reset(); 
    172186    } 
  • 2017/24/SamuelN/KurssiPeli2K17/KurssiPeli2K17/KurssiPeli2K17/KurssiPeli2K17.cs

    r8505 r8681  
    4545        kentta.SetTileMethod('t', LisaaTahti); 
    4646        kentta.SetTileMethod('p', LisaaPelaaja); 
    47         kentta.SetTileMethod('s', LisaaSpike); 
    4847        kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    4948        Level.CreateBorders(); 
     
    5756        taso.Color = vari; 
    5857        Add(taso); 
    59     } 
    60     void LisaaSpike(Vector paikka, double leveys, double korkeus) 
    61     { 
    62         PhysicsObject spike = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    63         spike.Position = paikka; 
    64         spike.Image = spikeKuva; 
    65         spike.Tag = "spike"; 
    66         Add(spike); 
    6758    } 
    6859 
     
    9081    void LisaaNappaimet() 
    9182    { 
    92         Keyboard.Listen(Key.F1, ButtonState.Pressed, ShowControlHelp, "Näytä ohjeet"); 
    9383        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    9484 
    9585         
    96         Keyboard.Listen(Key.Y, ButtonState.Up, Liikuta, "Liikkuu vasemmalle", pelaaja1, nopeus); 
     86        Keyboard.Listen(Key.A, ButtonState.Down, Liikuta, "", pelaaja1, -nopeus); 
     87        Keyboard.Listen(Key.D, ButtonState.Down, Liikuta, "", pelaaja1, nopeus); 
    9788        Keyboard.Listen(Key.Space, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    98         Keyboard.Listen(Key.Up, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    99  
    100         ControllerOne.Listen(Button.Back, ButtonState.Pressed, Exit, "Poistu pelistä"); 
    101  
    102         ControllerOne.Listen(Button.DPadLeft, ButtonState.Down, Liikuta, "Pelaaja liikkuu vasemmalle", pelaaja1, -nopeus); 
    103         ControllerOne.Listen(Button.DPadRight, ButtonState.Down, Liikuta, "Pelaaja liikkuu oikealle", pelaaja1, nopeus); 
    104         ControllerOne.Listen(Button.A, ButtonState.Pressed, Hyppaa, "Pelaaja hyppää", pelaaja1, hyppyNopeus); 
    105  
    106         PhoneBackButton.Listen(ConfirmExit, "Lopeta peli"); 
    10789    } 
    10890 
  • 2017/24/SamuelN/KurssiPeli2K17/KurssiPeli2K17/KurssiPeli2K17/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8505 r8681  
    88      <Processor>SoundEffectProcessor</Processor> 
    99      <Options>None</Options> 
    10       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\maali.xnb</Output> 
    11       <Time>2017-06-12T09:55:05.2957625+03:00</Time> 
     10      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\maali.xnb</Output> 
     11      <Time>2017-06-13T09:40:04.515401+03:00</Time> 
    1212    </Item> 
    1313    <Item> 
     
    1717      <Processor>TextFileContentProcessor</Processor> 
    1818      <Options>None</Options> 
    19       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\kentta1.xnb</Output> 
    20       <Time>2017-06-12T11:24:51.5746686+03:00</Time> 
     19      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\kentta1.xnb</Output> 
     20      <Time>2017-06-14T14:42:01.33899+03:00</Time> 
    2121    </Item> 
    2222    <Item> 
     
    2626      <Processor>TextureProcessor</Processor> 
    2727      <Options>None</Options> 
    28       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\coin.xnb</Output> 
    29       <Time>2017-06-12T10:10:33.6363824+03:00</Time> 
     28      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\coin.xnb</Output> 
     29      <Time>2017-06-13T09:40:04.8122783+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    3535      <Processor>TextureProcessor</Processor> 
    3636      <Options>None</Options> 
    37       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\taso.xnb</Output> 
    38       <Time>2017-06-12T10:11:48.004811+03:00</Time> 
     37      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\taso.xnb</Output> 
     38      <Time>2017-06-13T09:40:04.640404+03:00</Time> 
    3939    </Item> 
    4040    <Item> 
     
    4444      <Processor>TextureProcessor</Processor> 
    4545      <Options>None</Options> 
    46       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\31.xnb</Output> 
    47       <Time>2017-06-12T10:24:41.738279+03:00</Time> 
     46      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\31.xnb</Output> 
     47      <Time>2017-06-13T09:40:04.5310284+03:00</Time> 
    4848    </Item> 
    4949    <Item> 
     
    5353      <Processor>TextureProcessor</Processor> 
    5454      <Options>None</Options> 
    55       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\Cube25.xnb</Output> 
    56       <Time>2017-06-12T10:41:14.42342+03:00</Time> 
     55      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\Cube25.xnb</Output> 
     56      <Time>2017-06-13T09:40:04.5466515+03:00</Time> 
    5757    </Item> 
    5858    <Item> 
     
    6262      <Processor>TextureProcessor</Processor> 
    6363      <Options>None</Options> 
    64       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\tausta.xnb</Output> 
    65       <Time>2017-06-12T10:44:12.4300895+03:00</Time> 
     64      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\tausta.xnb</Output> 
     65      <Time>2017-06-13T09:40:04.515401+03:00</Time> 
    6666    </Item> 
    6767    <Item> 
     
    7171      <Processor>TextureProcessor</Processor> 
    7272      <Options>None</Options> 
    73       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\bg_12.xnb</Output> 
    74       <Time>2017-06-12T10:16:46.4933611+03:00</Time> 
     73      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\bg_12.xnb</Output> 
     74      <Time>2017-06-13T09:40:04.8122783+03:00</Time> 
    7575    </Item> 
    7676    <Item> 
     
    8080      <Processor>TextureProcessor</Processor> 
    8181      <Options>None</Options> 
    82       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\tausta2.xnb</Output> 
    83       <Time>2017-06-12T10:47:39.6596224+03:00</Time> 
     82      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\tausta2.xnb</Output> 
     83      <Time>2017-06-13T09:40:04.5310284+03:00</Time> 
    8484    </Item> 
    8585    <Item> 
     
    8989      <Processor>TextureProcessor</Processor> 
    9090      <Options>None</Options> 
    91       <Output>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\spike.xnb</Output> 
    92       <Time>2017-06-12T11:22:03.1328962+03:00</Time> 
     91      <Output>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\spike.xnb</Output> 
     92      <Time>2017-06-13T09:40:04.7966529+03:00</Time> 
    9393    </Item> 
    9494    <BuildSuccessful>true</BuildSuccessful> 
     
    9999      <BuildConfiguration>Debug</BuildConfiguration> 
    100100      <CompressContent>false</CompressContent> 
    101       <RootDirectory>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17Content\</RootDirectory> 
    102       <LoggerRootDirectory>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\</LoggerRootDirectory> 
    103       <IntermediateDirectory>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\obj\x86\Debug\</IntermediateDirectory> 
    104       <OutputDirectory>C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\</OutputDirectory> 
     101      <RootDirectory>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17Content\</RootDirectory> 
     102      <LoggerRootDirectory>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\</LoggerRootDirectory> 
     103      <IntermediateDirectory>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\obj\x86\Debug\</IntermediateDirectory> 
     104      <OutputDirectory>C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\</OutputDirectory> 
    105105    </Settings> 
    106106    <Assemblies> 
     
    139139      <Assembly> 
    140140        <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> 
    141         <Value>2017-06-07T09:21:00.3687337+03:00</Value> 
     141        <Value>2017-06-10T13:20:55.82404+03:00</Value> 
    142142      </Assembly> 
    143143    </Assemblies> 
  • 2017/24/SamuelN/KurssiPeli2K17/KurssiPeli2K17/KurssiPeli2K17/obj/x86/Debug/KurssiPeli2K17.csproj.FileListAbsolute.txt

    r8505 r8681  
    1717C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\tausta2.xnb 
    1818C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\spike.xnb 
     19C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\maali.xnb 
     20C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\kentta1.xnb 
     21C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\coin.xnb 
     22C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\taso.xnb 
     23C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\31.xnb 
     24C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\Cube25.xnb 
     25C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\tausta.xnb 
     26C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\bg_12.xnb 
     27C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\tausta2.xnb 
     28C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Content\spike.xnb 
     29C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\KurssiPeli2K17.exe 
     30C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\KurssiPeli2K17.pdb 
     31C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Jypeli.dll 
     32C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\bin\x86\Debug\Jypeli.xml 
     33C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\obj\x86\Debug\KurssiPeli2K17.csprojResolveAssemblyReference.cache 
     34C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
     35C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\obj\x86\Debug\KurssiPeli2K17.exe 
     36C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17\obj\x86\Debug\KurssiPeli2K17.pdb 
  • 2017/24/SamuelN/KurssiPeli2K17/KurssiPeli2K17/KurssiPeli2K17Content/kentta1.txt

    r8505 r8681  
    1616................................................. 
    1717................................................. 
     18............................t.tt................. 
     19.p.........................ttt..tt............... 
    1820................................................. 
    19 ................................................. 
    20 .p............................................... 
    21 ...................s........ss.....sss........... 
    2221################################################# 
    2322################################################# 
  • 2017/24/SamuelN/KurssiPeli2K17/KurssiPeli2K17/KurssiPeli2K17Content/obj/x86/Debug/KurssiPeli2K17Content.contentproj.FileListAbsolute.txt

    r8505 r8681  
    11C:\MyTemp\Samuel_N\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17Content\obj\x86\Debug\KurssiPeli2K17Content.contentprojResolveAssemblyReference.cache 
     2C:\MyTemp\SamuelN\KurssiPeli2K17\KurssiPeli2K17\KurssiPeli2K17Content\obj\x86\Debug\KurssiPeli2K17Content.contentprojResolveAssemblyReference.cache 
  • 2017/24/SamuelN/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17.cs

    r8644 r8681  
    1212    PhysicsObject bottom; 
    1313    PhysicsObject top; 
     14    PhysicsObject left; 
     15    PhysicsObject right; 
     16    Timer moveTimer2; 
    1417    Color vari = RandomGen.NextColor(); 
    15     Vector SpeedUp = new Vector(0, 300); 
    16     Vector SpeedDown = new Vector(0, -300); 
     18    Vector SpeedUp = new Vector(0, 500); 
     19    Vector SpeedDown = new Vector(0, -500); 
    1720    AssaultRifle playerGun; 
    18  
     21    private List<GameObject> movingObj = new List<GameObject>(); 
     22    private double way = -10; 
     23    private double destroyX; 
    1924    public override void Begin() 
    2025    { 
     
    2227        IsFullScreen = true; 
    2328        Level.Background.CreateStars(5000); 
     29        MediaPlayer.Play("PinballSpring"); 
     30        LuoPistelaskuri(); 
     31 
     32        Timer moveTimer = new Timer(); 
     33        moveTimer.Interval = 0.05; 
     34        moveTimer.Timeout += MoveObj; 
     35        moveTimer.Start(); 
     36 
     37        moveTimer2 = new Timer(); 
     38        moveTimer2.Interval = 1.5; 
     39        moveTimer2.Timeout += AddObj; 
     40        moveTimer2.Start(); 
    2441 
    2542        player = PhysicsObject.CreateStaticObject(88, 143); 
     
    2946        player.Restitution = 1.0; 
    3047 
    31         playerGun = new AssaultRifle(30, 10); 
     48        playerGun = new AssaultRifle(120, 40); 
    3249        playerGun.InfiniteAmmo = true; 
    33         playerGun.ProjectileCollision = AmmusOsui; 
     50        playerGun.ProjectileCollision = AmmoHit; 
     51        playerGun.X -= 60; 
     52        playerGun.Y = 0; 
     53        playerGun.IsVisible = false; 
     54        playerGun.AttackSound = null; //LoadSoundEffect("shoot"); 
     55        playerGun.FireRate = 2; 
    3456        player.Add(playerGun); 
    3557 
     
    4668        Add(bottom); 
    4769 
    48         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     70        left = PhysicsObject.CreateStaticObject(100, 1000); 
     71        left.X = -1000; 
     72        left.Color = Color.FromHexCode("00FF00"); 
     73        Add(left); 
     74 
     75        right = PhysicsObject.CreateStaticObject(100, 1000); 
     76        right.X = 1000; 
     77        right.Color = Color.FromHexCode("00FF00"); 
     78        Add(right); 
     79 
     80        destroyX = left.Right; 
     81 
     82        Keyboard.Listen(Key.Space, ButtonState.Down, Shoot, "Shoot", playerGun); 
    4983 
    5084        Keyboard.Listen(Key.Up, ButtonState.Down, SetSpeed, null, player, SpeedUp); 
     
    5387        Keyboard.Listen(Key.Down, ButtonState.Down, SetSpeed, null, player, SpeedDown); 
    5488        Keyboard.Listen(Key.Down, ButtonState.Released, SetSpeed, null, player, Vector.Zero); 
     89 
     90        Keyboard.Listen(Key.LeftShift, ButtonState.Pressed, AddObj, null); 
     91        Keyboard.Listen(Key.F12, ButtonState.Pressed, Input, null); 
    5592    } 
    56     void AmmusOsui(PhysicsObject ammus, PhysicsObject kohde) 
     93    void Input() 
    5794    { 
     95        InputWindow kysymysIkkuna = new InputWindow("Cheat Engine"); 
     96        kysymysIkkuna.TextEntered += ProcessInput; 
     97        Add(kysymysIkkuna); 
     98        Pause(); 
     99    } 
     100    void ProcessInput(InputWindow ikkuna) 
     101    { 
     102        Pause(); 
     103        string vastaus = ikkuna.InputBox.Text; 
     104        if (vastaus == "exit") 
     105        { 
     106            Exit(); 
     107        } 
     108        else if (vastaus == "mlgmode true") 
     109        { 
     110            playerGun.FireRate = 100; 
     111            moveTimer2.Interval = 0.1; 
     112        } 
     113        else if (vastaus == "mlgmode false") 
     114        { 
     115            playerGun.FireRate = 2; 
     116            moveTimer2.Interval = 1.5; 
     117        } 
     118    } 
     119        IntMeter pisteLaskuri; 
     120    void LuoPistelaskuri() 
     121    { 
     122        pisteLaskuri = new IntMeter(0); 
     123 
     124        Label pisteNaytto = new Label(); 
     125        pisteNaytto.X = Screen.Left + 100; 
     126        pisteNaytto.Y = Screen.Top - 100; 
     127        pisteNaytto.TextColor = Color.White; 
     128 
     129        pisteNaytto.BindTo(pisteLaskuri); 
     130        Add(pisteNaytto); 
     131    } 
     132    void AddObj() 
     133    { 
     134        double im = RandomGen.NextDouble(-400, 400); 
     135        PhysicsObject obj = PhysicsObject.CreateStaticObject(100, 100); 
     136        obj.Y = im; 
     137        obj.X = 900; 
     138        obj.Image = LoadImage("obj"); 
     139        obj.Shape = Shape.FromImage(LoadImage("obj")); 
     140        obj.Tag = "obj"; 
     141        Add(obj); 
     142        movingObj.Add(obj); 
     143    } 
     144    private void MoveObj() 
     145    { 
     146        for (int i = 0; i < movingObj.Count; i++) 
     147        { 
     148            GameObject obj = movingObj[i]; 
     149            obj.X += way; 
     150            if (obj.X <= destroyX) 
     151            { 
     152                obj.Destroy(); 
     153                movingObj.Remove(obj); 
     154            } 
     155        } 
     156    } 
     157    void AmmoHit(PhysicsObject ammus, PhysicsObject kohde) 
     158    { 
     159        ammus.Destroy(); 
     160        if (kohde.Tag == "obj") 
     161        { 
     162            kohde.Destroy(); 
     163            pisteLaskuri.Value += 1; 
     164        } 
     165    } 
     166    void Shoot(AssaultRifle gun) 
     167    { 
     168        PhysicsObject ammo = gun.Shoot(); 
    58169         
    59170    } 
  • 2017/24/SamuelN/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17.csproj.Debug.cachefile

    r8644 r8681  
    11Content\ship.xnb 
     2Content\shoot.xnb 
     3Content\ammo.xnb 
     4Content\shoot2.xnb 
     5Content\pullo.xnb 
     6Content\PinballSpring.xnb 
     7Content\obj.xnb 
     8Content\PinballSpring.wma 
  • 2017/24/SamuelN/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17/obj/x86/Debug/ContentPipeline-{9629B1B1-E6A7-4842-BC2D-569F01171E65}.xml

    r8644 r8681  
    1010      <Output>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\ship.xnb</Output> 
    1111      <Time>2017-06-14T10:18:10.8292286+03:00</Time> 
     12    </Item> 
     13    <Item> 
     14      <Source>shoot.wav</Source> 
     15      <Name>shoot</Name> 
     16      <Importer>WavImporter</Importer> 
     17      <Processor>SoundEffectProcessor</Processor> 
     18      <Options>None</Options> 
     19      <Output>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\shoot.xnb</Output> 
     20      <Time>2017-06-14T11:54:28.4703483+03:00</Time> 
     21    </Item> 
     22    <Item> 
     23      <Source>ammo.png</Source> 
     24      <Name>ammo</Name> 
     25      <Importer>TextureImporter</Importer> 
     26      <Processor>TextureProcessor</Processor> 
     27      <Options>None</Options> 
     28      <Output>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\ammo.xnb</Output> 
     29      <Time>2017-06-14T12:37:02.5732052+03:00</Time> 
     30    </Item> 
     31    <Item> 
     32      <Source>shoot2.wav</Source> 
     33      <Name>shoot2</Name> 
     34      <Importer>WavImporter</Importer> 
     35      <Processor>SoundEffectProcessor</Processor> 
     36      <Options>None</Options> 
     37      <Output>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\shoot2.xnb</Output> 
     38      <Time>2017-06-14T12:42:29.6665099+03:00</Time> 
     39    </Item> 
     40    <Item> 
     41      <Source>pullo.png</Source> 
     42      <Name>pullo</Name> 
     43      <Importer>TextureImporter</Importer> 
     44      <Processor>TextureProcessor</Processor> 
     45      <Options>None</Options> 
     46      <Output>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\pullo.xnb</Output> 
     47      <Time>2017-06-13T10:25:01.1873806+03:00</Time> 
     48    </Item> 
     49    <Item> 
     50      <Source>PinballSpring.mp3</Source> 
     51      <Name>PinballSpring</Name> 
     52      <Importer>Mp3Importer</Importer> 
     53      <Processor>SongProcessor</Processor> 
     54      <Options>None</Options> 
     55      <Output>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\PinballSpring.xnb</Output> 
     56      <Extra>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\PinballSpring.wma</Extra> 
     57      <Time>2017-06-13T14:19:24.6279234+03:00</Time> 
     58    </Item> 
     59    <Item> 
     60      <Source>obj.png</Source> 
     61      <Name>obj</Name> 
     62      <Importer>TextureImporter</Importer> 
     63      <Processor>TextureProcessor</Processor> 
     64      <Options>None</Options> 
     65      <Output>C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\obj.xnb</Output> 
     66      <Time>2017-06-14T14:01:06.7789887+03:00</Time> 
    1267    </Item> 
    1368    <BuildSuccessful>true</BuildSuccessful> 
  • 2017/24/SamuelN/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17/obj/x86/Debug/SpaceShooter2k17.csproj.FileListAbsolute.txt

    r8644 r8681  
    88C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\ship.xnb 
    99C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\obj\x86\Debug\SpaceShooter2k17.csprojResolveAssemblyReference.cache 
     10C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\shoot.xnb 
     11C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\ammo.xnb 
     12C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\shoot2.xnb 
     13C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\pullo.xnb 
     14C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\PinballSpring.xnb 
     15C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\PinballSpring.wma 
     16C:\MyTemp\SamuelN\SpaceShooter2k17\SpaceShooter2k17\SpaceShooter2k17\bin\x86\Debug\Content\obj.xnb 
  • 2017/24/SamuelN/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17/obj/x86/Debug/cachefile-{9629B1B1-E6A7-4842-BC2D-569F01171E65}-targetpath.txt

    r8644 r8681  
    11Content\ship.xnb 
     2Content\shoot.xnb 
     3Content\ammo.xnb 
     4Content\shoot2.xnb 
     5Content\pullo.xnb 
     6Content\PinballSpring.xnb 
     7Content\PinballSpring.wma 
     8Content\obj.xnb 
  • 2017/24/SamuelN/SpaceShooter2k17/SpaceShooter2k17/SpaceShooter2k17Content/SpaceShooter2k17Content.contentproj

    r8644 r8681  
    5959    </Compile> 
    6060  </ItemGroup> 
     61  <ItemGroup> 
     62    <Compile Include="ammo.png"> 
     63      <Name>ammo</Name> 
     64      <Importer>TextureImporter</Importer> 
     65      <Processor>TextureProcessor</Processor> 
     66    </Compile> 
     67  </ItemGroup> 
     68  <ItemGroup> 
     69    <Compile Include="shoot2.wav"> 
     70      <Name>shoot2</Name> 
     71      <Importer>WavImporter</Importer> 
     72      <Processor>SoundEffectProcessor</Processor> 
     73    </Compile> 
     74  </ItemGroup> 
     75  <ItemGroup> 
     76    <Compile Include="pullo.png"> 
     77      <Name>pullo</Name> 
     78      <Importer>TextureImporter</Importer> 
     79      <Processor>TextureProcessor</Processor> 
     80    </Compile> 
     81  </ItemGroup> 
     82  <ItemGroup> 
     83    <Compile Include="PinballSpring.mp3"> 
     84      <Name>PinballSpring</Name> 
     85      <Importer>Mp3Importer</Importer> 
     86      <Processor>SongProcessor</Processor> 
     87    </Compile> 
     88  </ItemGroup> 
     89  <ItemGroup> 
     90    <Compile Include="obj.png"> 
     91      <Name>obj</Name> 
     92      <Importer>TextureImporter</Importer> 
     93      <Processor>TextureProcessor</Processor> 
     94    </Compile> 
     95  </ItemGroup> 
    6196  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6297  <!--  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.