Changeset 8940 for 2017/27


Ignore:
Timestamp:
2017-07-05 15:02:24 (2 years ago)
Author:
npo17_32
Message:

Some Bug fixes, new tiles for GravityAssist?.

Location:
2017/27/PyryS/GravityAssist
Files:
6 added
17 edited

Legend:

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

    r8917 r8940  
    2424    Image wall1 = LoadImage("SpaceStationWall1"); 
    2525 
     26    Image interiorWall0 = LoadImage("SpaceStationInteriorWall0"); 
     27    Image interiorWallCorner0 = LoadImage("SpaceStationInteriorCornerWall0"); 
     28 
    2629    Image damagedWall0 = LoadImage("SpaceStationWallDamaged0"); 
    2730 
     
    3235 
    3336 
    34     // Beginning Function 
     37    // Beginning Function, loads all other functions and sets some variables 
    3538    public override void Begin() 
    3639    { 
     
    4346        LisaaNappaimet(); 
    4447 
    45  
     48        // Camera Settings 
    4649        Camera.FollowX(player); 
    4750        Camera.ZoomFactor = 4.0; 
    48         //Camera.StayInLevel = true; 
    49  
    50         //Level.Background.Image = background0; 
    51  
     51 
     52        // Background Creation 
    5253        GameObject backgroundObject0 = new GameObject(Level.Width, 128); 
    5354        backgroundObject0.Image = background0; 
     
    5657        Layers[-3].RelativeTransition = new Vector(0.5, 0); 
    5758    } 
    58     // Level loading function 
     59    // Level Tilemap Creation 
    5960    void LuoKentta() 
    6061    { 
    61         TileMap kentta = TileMap.FromLevelAsset("kentta"+ RandomGen.NextInt(1, 4)); 
    62         kentta.SetTileMethod('A', LisaaTaso, false); 
    63         kentta.SetTileMethod('V', LisaaTaso, true); 
    64         kentta.SetTileMethod('.', RandomizeObstacle0, true); 
    65         kentta.SetTileMethod(',', RandomizeObstacle1, false); 
    66         kentta.SetTileMethod('N', LisaaPelaaja); 
    67         kentta.SetTileMethod('+', AddLevelSwitcher); 
    68         kentta.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
     62        TileMap level = TileMap.FromLevelAsset("kentta"+ RandomGen.NextInt(1, 2)); 
     63        // Exterior Roof 
     64        level.SetTileMethod('A', AddWallBlocks0, false); 
     65        // Exterior Floor 
     66        level.SetTileMethod('V', AddWallBlocks0, true); 
     67        // Interior Wall (Left) 
     68        level.SetTileMethod('J', AddWallBlocks1, 1); 
     69        // Interior Wall (Down) 
     70        level.SetTileMethod('K', AddWallBlocks1, 2); 
     71        // Interior Wall (Right) 
     72        level.SetTileMethod('L', AddWallBlocks1, 3); 
     73        // Interior Wall (Up) 
     74        level.SetTileMethod('I', AddWallBlocks1, 4); 
     75        // Interior Wall (Corner) (Down-Right) 
     76        level.SetTileMethod('P', AddWallBlocks2, 1); 
     77        // Interior Wall (Adapter) (Down-Left) 
     78        level.SetTileMethod('O', AddWallBlocks2, 2); 
     79        // Interior Wall (Adapter) (Up-Left) 
     80        level.SetTileMethod('U', AddWallBlocks2, 3); 
     81        // Interior Wall (Adapter) (Up-Right) 
     82        level.SetTileMethod('Y', AddWallBlocks2,4); 
     83        level.SetTileMethod('.', RandomizeObstacle0, true); 
     84        level.SetTileMethod(',', RandomizeObstacle1, false); 
     85        level.SetTileMethod('N', LisaaPelaaja); 
     86        level.SetTileMethod('+', AddLevelSwitcher); 
     87        level.Execute(RUUDUN_KOKO, RUUDUN_KOKO); 
    6988        Level.CreateBorders(); 
    7089        Level.Background.Color = Color.Black; 
     
    7291        levelCreationX += Level.Width; 
    7392    } 
    74     // Level generation function 
    75     void LisaaTaso(Vector paikka, double leveys, double korkeus, bool flipped) 
    76     { 
    77         PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, korkeus); 
    78         taso.Position = paikka; 
    79         taso.X += levelCreationX; 
    80         taso.Image = RandomGen.SelectOne(wall0, wall0, wall0, wall0,wall0, wall0, wall0, wall0, wall1, damagedWall0); 
    81         if (flipped) taso.FlipImage(); 
    82         taso.Restitution = 0.0; 
    83         taso.KineticFriction = 0.0; 
    84         taso.StaticFriction = 0.0; 
    85         taso.Tag = "wall"; 
    86         taso.LifetimeLeft = TimeSpan.FromSeconds(60); 
    87         Add(taso); 
    88     } 
     93    // Wall Block Generation 
     94    void AddWallBlocks0(Vector paikka, double leveys, double korkeus, bool flipped) 
     95    { 
     96        PhysicsObject block = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     97        block.Position = paikka; 
     98        block.X += levelCreationX; 
     99        block.Image = RandomGen.SelectOne(wall0, wall0, wall0, wall0,wall0, wall0, wall0, wall0, wall1, damagedWall0); 
     100        if (flipped) block.FlipImage(); 
     101        block.Restitution = 0.0; 
     102        block.KineticFriction = 0.0; 
     103        block.StaticFriction = 0.0; 
     104        block.Tag = "wall"; 
     105        block.LifetimeLeft = TimeSpan.FromSeconds(60); 
     106        Add(block); 
     107    } 
     108    // Interior Wall Generation 0 
     109    void AddWallBlocks1(Vector position, double width, double height, int direction) 
     110    { 
     111        PhysicsObject block = PhysicsObject.CreateStaticObject(width, height); 
     112        block.Position = position; 
     113        block.X += levelCreationX; 
     114        block.Image = RandomGen.SelectOne(interiorWall0); 
     115        // Determine Block Angle From Integer 
     116        if (direction == 1) 
     117        { 
     118            block.Angle = Angle.FromDegrees(0); 
     119        } 
     120        else if (direction == 2) 
     121        { 
     122            block.Angle = Angle.FromDegrees(90); 
     123        } 
     124        else if (direction == 3) 
     125        { 
     126            block.Angle = Angle.FromDegrees(180); 
     127        } 
     128        else 
     129        { 
     130            block.Angle = Angle.FromDegrees(270); 
     131        } 
     132        block.Restitution = 0.0; 
     133        block.KineticFriction = 0.0; 
     134        block.StaticFriction = 0.0; 
     135        block.Tag = "wall"; 
     136        block.LifetimeLeft = TimeSpan.FromSeconds(60); 
     137        Add(block); 
     138    } 
     139    // Interior Wall Generation 1 (Corner) 
     140    void AddWallBlocks2(Vector position, double width, double height, int direction) 
     141    { 
     142        PhysicsObject block = PhysicsObject.CreateStaticObject(width, height); 
     143        block.Position = position; 
     144        block.X += levelCreationX; 
     145        block.Image = RandomGen.SelectOne(interiorWallCorner0); 
     146        // Determine Block Angle From Integer 
     147        if (direction == 1) 
     148        { 
     149            block.Angle = Angle.FromDegrees(0); 
     150        } 
     151        else if (direction == 2) 
     152        { 
     153            block.Angle = Angle.FromDegrees(90); 
     154        } 
     155        else if (direction == 3) 
     156        { 
     157            block.Angle = Angle.FromDegrees(180); 
     158        } 
     159        else 
     160        { 
     161            block.Angle = Angle.FromDegrees(270); 
     162        } 
     163        block.Restitution = 0.0; 
     164        block.KineticFriction = 0.0; 
     165        block.StaticFriction = 0.0; 
     166        block.Tag = "wall"; 
     167        block.LifetimeLeft = TimeSpan.FromSeconds(60); 
     168        Add(block); 
     169    } 
     170    // Obstacle Randomizer 0 
    89171    void RandomizeObstacle0(Vector paikka, double leveys, double korkeus, bool flipped) 
    90172    { 
    91173        RandomGen.SelectOne<Action<Vector, double, double, bool>>(AddObstacle0, AddObstacle1)(paikka, leveys, korkeus, flipped); 
    92174    } 
    93  
     175    // Obstacle Randomizer 1 
    94176    void RandomizeObstacle1(Vector paikka, double leveys, double korkeus, bool flipped) 
    95177    { 
     
    104186        obstacle.Image = obstacle0[0]; 
    105187        obstacle.Animation = new Animation(obstacle0); 
    106         obstacle.Animation.FPS = 5; 
     188        obstacle.Animation.FPS = 7; 
    107189        obstacle.Animation.Start(); 
    108190        obstacle.Position = paikka; 
     
    111193            obstacle.FlipImage(); 
    112194            obstacle.Position = paikka + new Vector(0, -10); 
    113             //obstacle.Position = paikka + new Vector(Convert.ToInt64(RandomGen.NextDouble(Level.Left, Level.Right)), -10); 
    114195        } 
    115196        else 
    116197        { 
    117             //obstacle.Position = paikka + new Vector(Convert.ToInt64(RandomGen.NextDouble(Level.Left + 25, Level.Right)), 10); 
    118198            obstacle.Position = paikka + new Vector(0, 10); 
    119199        } 
     
    122202        Add(obstacle, 2); 
    123203    } 
    124     // Obstacle creation function 1 (Broken Console) 
     204    // Obstacle creation function 1 (Broken Console Thingy) 
    125205    void AddObstacle1(Vector paikka, double leveys, double korkeus, bool flipped) 
    126206    { 
     
    152232 
    153233 
    154     // Level switch block creation function 
     234    // Level Switcher Creation 
    155235    void AddLevelSwitcher(Vector paikka, double leveys, double korkeus) 
    156236    { 
    157         PhysicsObject taso = PhysicsObject.CreateStaticObject(leveys, Level.Height); 
    158         taso.IgnoresCollisionResponse = true; 
    159         taso.Position = paikka; 
    160         taso.X += levelCreationX; 
    161         taso.Tag = "levelswitch"; 
    162         Add(taso); 
    163     } 
    164     // Player creation and movement function 
     237        PhysicsObject block = PhysicsObject.CreateStaticObject(leveys, Level.Height); 
     238        block.IgnoresCollisionResponse = true; 
     239        block.Position = paikka; 
     240        block.X += levelCreationX; 
     241        block.Tag = "levelswitch"; 
     242        block.IsVisible = false; 
     243        Add(block); 
     244    } 
     245    // Player Creation and Movement 
    165246    void LisaaPelaaja(Vector paikka, double leveys, double korkeus) 
    166247    { 
    167248        player = new PhysicsObject(32, 13); 
    168249        player.Position = paikka; 
    169         player.Mass = 100.0; 
     250        player.Mass = 0.1; 
    170251        player.CanRotate = false; 
    171252        player.KineticFriction = 0.0; 
     
    186267 
    187268    } 
    188     // Controls function 
     269    // Controls 
    189270    void LisaaNappaimet() 
    190271    { 
     
    200281    } 
    201282 
    202     // Gravity swap function 
     283    // Gravity Swap System 
    203284    void GravitySwap(PhysicsObject Player, double Force) 
    204285    { 
     
    216297        } 
    217298    } 
    218     // Collision management function 
     299    // Collision Management 
    219300    void collision(PhysicsObject hahmo, PhysicsObject obstacle) 
    220301    { 
     
    241322        }   
    242323    } 
     324    // Map Creator / Level Switcher 
    243325    void LevelSwitch(PhysicsObject player, PhysicsObject levelSwitcher) 
    244326    { 
     
    246328        LuoKentta(); 
    247329    } 
     330    // Game Restart 
    248331    void restart() 
    249332    { 
    250         ClearAll(); 
    251         Begin(); 
     333        Timer.SingleShot(0.5, delegate 
     334        { 
     335            ClearAll(); 
     336            GravityDirection = false; 
     337            Begin(); 
     338        }); 
    252339    } 
    253340} 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/GravityAssist.csproj.Debug.cachefile

    r8917 r8940  
    1919Content\ObstacleC0.xnb 
    2020Content\kentta3.xnb 
     21Content\SpaceStationInteriorCornerWall0.xnb 
     22Content\SpaceStationInteriorWall0.xnb 
     23Content\SpaceStationInteriorWallAdapter0.xnb 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/obj/x86/Debug/ContentPipeline-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}.xml

    r8917 r8940  
    2727      <Options>None</Options> 
    2828      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\kentta1.xnb</Output> 
    29       <Time>2017-07-05T10:11:22.508884+03:00</Time> 
     29      <Time>2017-07-05T14:53:32.848991+03:00</Time> 
    3030    </Item> 
    3131    <Item> 
     
    9999      <Options>None</Options> 
    100100      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\kentta2.xnb</Output> 
    101       <Time>2017-07-05T10:12:07.542944+03:00</Time> 
     101      <Time>2017-07-05T14:46:40.4214739+03:00</Time> 
    102102    </Item> 
    103103    <Item> 
     
    180180      <Options>None</Options> 
    181181      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\kentta3.xnb</Output> 
    182       <Time>2017-07-05T11:57:34.1538891+03:00</Time> 
     182      <Time>2017-07-05T14:46:39.7974539+03:00</Time> 
     183    </Item> 
     184    <Item> 
     185      <Source>SpaceStationInteriorCornerWall0.png</Source> 
     186      <Name>SpaceStationInteriorCornerWall0</Name> 
     187      <Importer>TextureImporter</Importer> 
     188      <Processor>TextureProcessor</Processor> 
     189      <Options>None</Options> 
     190      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\SpaceStationInteriorCornerWall0.xnb</Output> 
     191      <Time>2017-07-05T14:58:07.3572231+03:00</Time> 
     192    </Item> 
     193    <Item> 
     194      <Source>SpaceStationInteriorWall0.png</Source> 
     195      <Name>SpaceStationInteriorWall0</Name> 
     196      <Importer>TextureImporter</Importer> 
     197      <Processor>TextureProcessor</Processor> 
     198      <Options>None</Options> 
     199      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\SpaceStationInteriorWall0.xnb</Output> 
     200      <Time>2017-07-05T13:41:04.7011787+03:00</Time> 
     201    </Item> 
     202    <Item> 
     203      <Source>SpaceStationInteriorWallAdapter0.png</Source> 
     204      <Name>SpaceStationInteriorWallAdapter0</Name> 
     205      <Importer>TextureImporter</Importer> 
     206      <Processor>TextureProcessor</Processor> 
     207      <Options>None</Options> 
     208      <Output>C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\SpaceStationInteriorWallAdapter0.xnb</Output> 
     209      <Time>2017-07-05T13:54:04.7105782+03:00</Time> 
    183210    </Item> 
    184211    <BuildSuccessful>true</BuildSuccessful> 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/obj/x86/Debug/GravityAssist.csproj.FileListAbsolute.txt

    r8917 r8940  
    2727C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\ObstacleC0.xnb 
    2828C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\kentta3.xnb 
     29C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\SpaceStationInteriorCornerWall0.xnb 
     30C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\SpaceStationInteriorWall0.xnb 
     31C:\MyTemp\PyryS\GravityAssist\GravityAssist\GravityAssist\bin\x86\Debug\Content\SpaceStationInteriorWallAdapter0.xnb 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssist/obj/x86/Debug/cachefile-{FB1067CC-FEED-45F1-8CB8-8F3DD59AB260}-targetpath.txt

    r8917 r8940  
    1919Content\ObstacleC0.xnb 
    2020Content\kentta3.xnb 
     21Content\SpaceStationInteriorCornerWall0.xnb 
     22Content\SpaceStationInteriorWall0.xnb 
     23Content\SpaceStationInteriorWallAdapter0.xnb 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssistContent/GravityAssistContent.contentproj

    r8917 r8940  
    175175    </Compile> 
    176176  </ItemGroup> 
     177  <ItemGroup> 
     178    <Compile Include="SpaceStationInteriorCornerWall0.png"> 
     179      <Name>SpaceStationInteriorCornerWall0</Name> 
     180      <Importer>TextureImporter</Importer> 
     181      <Processor>TextureProcessor</Processor> 
     182    </Compile> 
     183    <Compile Include="SpaceStationInteriorWall0.png"> 
     184      <Name>SpaceStationInteriorWall0</Name> 
     185      <Importer>TextureImporter</Importer> 
     186      <Processor>TextureProcessor</Processor> 
     187    </Compile> 
     188    <Compile Include="SpaceStationInteriorWallAdapter0.png"> 
     189      <Name>SpaceStationInteriorWallAdapter0</Name> 
     190      <Importer>TextureImporter</Importer> 
     191      <Processor>TextureProcessor</Processor> 
     192    </Compile> 
     193  </ItemGroup> 
    177194  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    178195  <!--  To modify your build process, add your task inside one of the targets below and uncomment it.  
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssistContent/kentta1.txt

    r8917 r8940  
    11AAAAAAAAAAAAAAAAAAAAAAAAAAA 
    2                  , , ,  
    3              + 
     2     PO         , , ,  
     3            + 
    44     . . . 
    55VVVVVVVVVVVVVVVVVVVVVVVVVVV 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssistContent/kentta2.txt

    r8917 r8940  
    11AAAAAAAAAAAAAAAAAAAAAAAAAAA 
    22          ,,   ,,     
    3              + 
     3            + 
    44    ..               ..  
    55VVVVVVVVVVVVVVVVVVVVVVVVVVV 
  • 2017/27/PyryS/GravityAssist/GravityAssist/GravityAssistContent/kentta3.txt

    r8917 r8940  
    11AAAAAAAAAAAAAAAAAAAAAAAAAAA 
    2     ,  ,  ,  ,  ,  ,  ,   
    3              + 
    4     .  .  .  .  .  .  .   
     2    ,     ,  ,  ,     ,   
     3            + 
     4    .     .  .  .     .   
    55VVVVVVVVVVVVVVVVVVVVVVVVVVV 
Note: See TracChangeset for help on using the changeset viewer.