Changeset 9004


Ignore:
Timestamp:
2017-07-07 11:56:36 (23 months ago)
Author:
npo17_32
Message:

Finished first finished version of GravityAssist?. Added ship selector and improved GUI a lot.

Location:
2017/27/PyryS
Files:
18 added
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/GravityAssist.cs

    r8978 r9004  
    2525 
    2626    // Load all images 
    27     Image starBackground = LoadImage("Stars"); 
    28  
    29     Image[] playerImages = LoadImages("Player0", "Player1"); 
     27    Image[] playerImages; 
     28    Image[] playerImages0 = LoadImages("Player0", "Player1"); 
     29    Image[] playerImages1 = LoadImages("PlayerB0", "PlayerB1"); 
    3030    Image wall0 = LoadImage("SpaceStationWall0"); 
    3131    Image wall1 = LoadImage("SpaceStationWall1"); 
    32  
     32    Image logoImage = LoadImage("Logo"); 
     33    Image pauseBackground = LoadImage("PauseBackground"); 
     34    Image mainMenuBackground = LoadImage("MainMenuBackground"); 
     35    Image ship1IconHover = LoadImage("GUI_Ship1IconHover"); 
     36    Image ship1Icon = LoadImage("GUI_Ship1Icon"); 
     37    Image ship2IconHover = LoadImage("GUI_Ship2IconHover"); 
     38    Image ship2Icon = LoadImage("GUI_Ship2Icon"); 
    3339    Image startGameImage = LoadImage("GUI_StartGame"); 
    3440    Image startGameImageHover = LoadImage("GUI_StartGameHover"); 
     
    4349    Image mainMenuImage = LoadImage("GUI_mainMenu"); 
    4450    Image mainMenuImageHover = LoadImage("GUI_mainMenuHover"); 
    45  
    4651    Image interiorWall0 = LoadImage("SpaceStationInteriorWall0"); 
    4752    Image interiorWallCorner0 = LoadImage("SpaceStationInteriorCornerWall0"); 
    48  
    4953    Image damagedWall0 = LoadImage("SpaceStationWallDamaged0"); 
    50  
    5154    Image[] obstacle0 = LoadImages("Obstacle0", "Obstacle1", "Obstacle2", "Obstacle0"); 
    5255    Image[] obstacle1 = LoadImages("ObstacleB0", "ObstacleB1", "ObstacleB2", "ObstacleB3", "ObstacleB0"); 
     
    6063    { 
    6164        SmoothTextures = false; 
     65        playerImages = playerImages0; 
     66        Gravity = new Vector(0, 0); 
    6267        MainMenu(); 
    6368    } 
     
    6772        speed = 150; 
    6873        backgroundLife = 25; 
    69         Gravity = new Vector(0, 0); 
    70          
     74        GravityDirection = false; 
     75 
     76 
    7177 
    7278        LuoKentta(); 
     
    7985 
    8086        // Background Creation 
    81         backgroundPosition = new Vector(-250, 0); 
     87        backgroundPosition = new Vector(-1000, 0); 
    8288        Level.Background.CreateStars(5000); 
     89 
     90        for (int i = 0; i < 10; i++) BackgroundCreator(); 
     91 
    8392        ajastin = new Timer(); 
    8493        ajastin.Interval = 0.5; 
     
    8695        ajastin.Start(); 
    8796 
     97        // Player Speed Up 
    8898        Timer ajastin1 = new Timer(); 
    8999        ajastin1.Interval = 0.2; 
     
    94104    void MainMenu() 
    95105    { 
    96         ClearAll(); 
    97  
    98         MultiSelectWindow mainMenu = new MultiSelectWindow("Gravity Assist", "                        ", "                        ", "                        "); 
     106        Level.Background.Color = Color.FromHexCode("4A4A4A"); 
     107 
     108        GameObject logo = new GameObject(512, 80); 
     109        logo.Image = logoImage; 
     110        logo.Y = 180; 
     111        Add(logo); 
     112   
     113        MultiSelectWindow mainMenu = new MultiSelectWindow("", "                        ", "                        ", "                        "); 
    99114        Add(mainMenu); 
    100115        mainMenu.Buttons[0].ImageHover = startGameImageHover; 
     
    104119        mainMenu.Buttons[2].ImageHover = quitGameImageHover; 
    105120        mainMenu.Buttons[2].ImageReleased = quitGameImage; 
    106  
     121        mainMenu.IsVisible = false; 
    107122 
    108123        mainMenu.AddItemHandler(0, StartGame); 
    109         // mainMenu.AddItemHandler(1, ShipChooser); 
     124        mainMenu.AddItemHandler(1, ShipSelector); 
    110125        mainMenu.AddItemHandler(2, Exit); 
    111126 
     
    117132        Pause(); 
    118133 
    119         MultiSelectWindow pauseMenu = new MultiSelectWindow("PAUSED", "                        ", "                        ", "                        ", "                        "); 
     134 
     135        MultiSelectWindow pauseMenu = new MultiSelectWindow("", "                        ", "                        ", "                        ", "                        "); 
    120136        Add(pauseMenu); 
    121137 
    122138        pauseMenu.AddItemHandler(0, delegate { pauseMenu.Destroy(); Pause(); }); 
    123139        pauseMenu.AddItemHandler(1, delegate { Restart(); Pause(); }); 
    124         pauseMenu.AddItemHandler(2, MainMenu); 
     140        pauseMenu.AddItemHandler(2, delegate { MainMenu(); Pause(); }); 
    125141        pauseMenu.AddItemHandler(3, Exit); 
    126142 
     
    133149        pauseMenu.Buttons[3].ImageHover = quitGameImageHover; 
    134150        pauseMenu.Buttons[3].ImageReleased = quitGameImage; 
     151        pauseMenu.Image = pauseBackground; 
    135152 
    136153        pauseMenu.DefaultCancel = 0; 
    137154    } 
    138     void BackgroundCreator() 
     155    // Ship Selector 
     156    void ShipSelector() 
     157    { 
     158        MultiSelectWindow shipSelector = new MultiSelectWindow("", "                        \n\n", "                         \n\n"); 
     159        Add(shipSelector); 
     160        shipSelector.Buttons[0].ImageHover = ship1IconHover; 
     161        shipSelector.Buttons[0].ImageReleased = ship1Icon; 
     162        shipSelector.Buttons[1].ImageHover = ship2IconHover; 
     163        shipSelector.Buttons[1].ImageReleased = ship2Icon; 
     164        shipSelector.IsVisible = false; 
     165 
     166 
     167        shipSelector.AddItemHandler(0, delegate { playerImages = playerImages0; MainMenu(); } ); 
     168        shipSelector.AddItemHandler(1, delegate { playerImages = playerImages1; MainMenu(); } ); 
     169    } 
     170        // Background Creation 
     171        void BackgroundCreator() 
    139172    { 
    140173        GameObject backgroundObject0 = new GameObject(128, 128); 
     
    146179        backgroundObject0.LifetimeLeft = TimeSpan.FromSeconds(backgroundLife); 
    147180        backgroundLife += 1; 
    148         ajastin.Interval /= 1.2; 
     181        if (ajastin != null) ajastin.Interval /= 1.2; 
    149182    } 
    150183 
     
    348381    { 
    349382        player = new PhysicsObject(32, 13); 
    350         player.Position = paikka; 
     383        player.Position = paikka + new Vector(175, 0); 
    351384        player.Mass = 0.1; 
    352385        player.CanRotate = false; 
     
    433466    { 
    434467        ClearAll(); 
    435         GravityDirection = false; 
    436468        StartGame(); 
    437469    } 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/GravityAssist.csproj.Debug.cachefile

    r8978 r9004  
    2323Content\BackgroundB0.xnb 
    2424Content\kentta4.xnb 
    25 Content\Stars.xnb 
    2625Content\GUI_StartGame.xnb 
    2726Content\GUI_StartGameHover.xnb 
     
    3635Content\GUI_mainMenu.xnb 
    3736Content\GUI_mainMenuHover.xnb 
     37Content\PlayerB0.xnb 
     38Content\PlayerB1.xnb 
     39Content\GUI_Ship1Icon.xnb 
     40Content\GUI_Ship1IconHover.xnb 
     41Content\GUI_Ship2Icon.xnb 
     42Content\GUI_Ship2IconHover.xnb 
     43Content\PauseBackground.xnb 
     44Content\Logo.xnb 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8978 r9004  
    219219    </Item> 
    220220    <Item> 
    221       <Source>Stars.png</Source> 
    222       <Name>Stars</Name> 
    223       <Importer>TextureImporter</Importer> 
    224       <Processor>TextureProcessor</Processor> 
    225       <Options>None</Options> 
    226       <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\Stars.xnb</Output> 
    227       <Time>2017-07-06T12:00:01.1360288+03:00</Time> 
    228     </Item> 
    229     <Item> 
    230221      <Source>GUI_StartGame.png</Source> 
    231222      <Name>GUI_StartGame</Name> 
     
    334325      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_mainMenuHover.xnb</Output> 
    335326      <Time>2017-07-06T14:43:23.9460683+03:00</Time> 
     327    </Item> 
     328    <Item> 
     329      <Source>PlayerB0.png</Source> 
     330      <Name>PlayerB0</Name> 
     331      <Importer>TextureImporter</Importer> 
     332      <Processor>TextureProcessor</Processor> 
     333      <Options>None</Options> 
     334      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\PlayerB0.xnb</Output> 
     335      <Time>2017-07-07T09:40:23.5545062+03:00</Time> 
     336    </Item> 
     337    <Item> 
     338      <Source>PlayerB1.png</Source> 
     339      <Name>PlayerB1</Name> 
     340      <Importer>TextureImporter</Importer> 
     341      <Processor>TextureProcessor</Processor> 
     342      <Options>None</Options> 
     343      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\PlayerB1.xnb</Output> 
     344      <Time>2017-07-07T09:41:07.484951+03:00</Time> 
     345    </Item> 
     346    <Item> 
     347      <Source>GUI_Ship1Icon.png</Source> 
     348      <Name>GUI_Ship1Icon</Name> 
     349      <Importer>TextureImporter</Importer> 
     350      <Processor>TextureProcessor</Processor> 
     351      <Options>None</Options> 
     352      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship1Icon.xnb</Output> 
     353      <Time>2017-07-07T09:59:37.5207598+03:00</Time> 
     354    </Item> 
     355    <Item> 
     356      <Source>GUI_Ship1IconHover.png</Source> 
     357      <Name>GUI_Ship1IconHover</Name> 
     358      <Importer>TextureImporter</Importer> 
     359      <Processor>TextureProcessor</Processor> 
     360      <Options>None</Options> 
     361      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship1IconHover.xnb</Output> 
     362      <Time>2017-07-07T10:18:39.7582799+03:00</Time> 
     363    </Item> 
     364    <Item> 
     365      <Source>GUI_Ship2Icon.png</Source> 
     366      <Name>GUI_Ship2Icon</Name> 
     367      <Importer>TextureImporter</Importer> 
     368      <Processor>TextureProcessor</Processor> 
     369      <Options>None</Options> 
     370      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship2Icon.xnb</Output> 
     371      <Time>2017-07-07T09:53:33.9803081+03:00</Time> 
     372    </Item> 
     373    <Item> 
     374      <Source>GUI_Ship2IconHover.png</Source> 
     375      <Name>GUI_Ship2IconHover</Name> 
     376      <Importer>TextureImporter</Importer> 
     377      <Processor>TextureProcessor</Processor> 
     378      <Options>None</Options> 
     379      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship2IconHover.xnb</Output> 
     380      <Time>2017-07-07T09:54:39.1279961+03:00</Time> 
     381    </Item> 
     382    <Item> 
     383      <Source>PauseBackground.png</Source> 
     384      <Name>PauseBackground</Name> 
     385      <Importer>TextureImporter</Importer> 
     386      <Processor>TextureProcessor</Processor> 
     387      <Options>None</Options> 
     388      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\PauseBackground.xnb</Output> 
     389      <Time>2017-07-07T11:19:04.7955222+03:00</Time> 
     390    </Item> 
     391    <Item> 
     392      <Source>Logo.png</Source> 
     393      <Name>Logo</Name> 
     394      <Importer>TextureImporter</Importer> 
     395      <Processor>TextureProcessor</Processor> 
     396      <Options>None</Options> 
     397      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\Logo.xnb</Output> 
     398      <Time>2017-07-07T11:39:24.215452+03:00</Time> 
    336399    </Item> 
    337400    <BuildSuccessful>true</BuildSuccessful> 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/obj/x86/Debug/GravityAssist.csproj.FileListAbsolute.txt

    r8978 r9004  
    3131C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\BackgroundB0.xnb 
    3232C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\kentta4.xnb 
    33 C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\Stars.xnb 
    3433C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_StartGame.xnb 
    3534C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_StartGameHover.xnb 
     
    4443C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_mainMenu.xnb 
    4544C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_mainMenuHover.xnb 
     45C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\PlayerB0.xnb 
     46C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\PlayerB1.xnb 
     47C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship1Icon.xnb 
     48C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship1IconHover.xnb 
     49C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship2Icon.xnb 
     50C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\GUI_Ship2IconHover.xnb 
     51C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\PauseBackground.xnb 
     52C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\Logo.xnb 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r8978 r9004  
    2323Content\BackgroundB0.xnb 
    2424Content\kentta4.xnb 
    25 Content\Stars.xnb 
    2625Content\GUI_StartGame.xnb 
    2726Content\GUI_StartGameHover.xnb 
     
    3635Content\GUI_mainMenu.xnb 
    3736Content\GUI_mainMenuHover.xnb 
     37Content\PlayerB0.xnb 
     38Content\PlayerB1.xnb 
     39Content\GUI_Ship1Icon.xnb 
     40Content\GUI_Ship1IconHover.xnb 
     41Content\GUI_Ship2Icon.xnb 
     42Content\GUI_Ship2IconHover.xnb 
     43Content\PauseBackground.xnb 
     44Content\Logo.xnb 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssistContent/GravityAssistContent.contentproj

    r8978 r9004  
    202202  </ItemGroup> 
    203203  <ItemGroup> 
    204     <Compile Include="Stars.png"> 
    205       <Name>Stars</Name> 
    206       <Importer>TextureImporter</Importer> 
    207       <Processor>TextureProcessor</Processor> 
    208     </Compile> 
    209   </ItemGroup> 
    210   <ItemGroup> 
    211204    <Compile Include="GUI_StartGame.png"> 
    212205      <Name>GUI_StartGame</Name> 
     
    274267    <Compile Include="GUI_mainMenuHover.png"> 
    275268      <Name>GUI_mainMenuHover</Name> 
     269      <Importer>TextureImporter</Importer> 
     270      <Processor>TextureProcessor</Processor> 
     271    </Compile> 
     272  </ItemGroup> 
     273  <ItemGroup> 
     274    <Compile Include="PlayerB0.png"> 
     275      <Name>PlayerB0</Name> 
     276      <Importer>TextureImporter</Importer> 
     277      <Processor>TextureProcessor</Processor> 
     278    </Compile> 
     279    <Compile Include="PlayerB1.png"> 
     280      <Name>PlayerB1</Name> 
     281      <Importer>TextureImporter</Importer> 
     282      <Processor>TextureProcessor</Processor> 
     283    </Compile> 
     284  </ItemGroup> 
     285  <ItemGroup> 
     286    <Compile Include="GUI_Ship1Icon.png"> 
     287      <Name>GUI_Ship1Icon</Name> 
     288      <Importer>TextureImporter</Importer> 
     289      <Processor>TextureProcessor</Processor> 
     290    </Compile> 
     291    <Compile Include="GUI_Ship1IconHover.png"> 
     292      <Name>GUI_Ship1IconHover</Name> 
     293      <Importer>TextureImporter</Importer> 
     294      <Processor>TextureProcessor</Processor> 
     295    </Compile> 
     296    <Compile Include="GUI_Ship2Icon.png"> 
     297      <Name>GUI_Ship2Icon</Name> 
     298      <Importer>TextureImporter</Importer> 
     299      <Processor>TextureProcessor</Processor> 
     300    </Compile> 
     301    <Compile Include="GUI_Ship2IconHover.png"> 
     302      <Name>GUI_Ship2IconHover</Name> 
     303      <Importer>TextureImporter</Importer> 
     304      <Processor>TextureProcessor</Processor> 
     305    </Compile> 
     306  </ItemGroup> 
     307  <ItemGroup> 
     308    <Compile Include="PauseBackground.png"> 
     309      <Name>PauseBackground</Name> 
     310      <Importer>TextureImporter</Importer> 
     311      <Processor>TextureProcessor</Processor> 
     312    </Compile> 
     313  </ItemGroup> 
     314  <ItemGroup> 
     315    <Compile Include="Logo.png"> 
     316      <Name>Logo</Name> 
    276317      <Importer>TextureImporter</Importer> 
    277318      <Processor>TextureProcessor</Processor> 
Note: See TracChangeset for help on using the changeset viewer.