Changeset 5618 for 2014/30


Ignore:
Timestamp:
2014-07-24 11:12:48 (5 years ago)
Author:
oomahutt
Message:
 
Location:
2014/30/OonaH
Files:
12 added
4 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2.cs

    r5590 r5618  
    99public class GoldenMaknae2 : PhysicsGame 
    1010{ 
     11 
     12    #region Olioiden nimeaminen 
    1113    PhysicsObject Kookie; 
    12     PhysicsObject Reuna; 
     14    PhysicsObject reuna; 
    1315    PhysicsObject tavarat; 
    14  
     16    #endregion 
    1517    IntMeter pisteLaskuri; 
    16  
     18    #region kuvien lataaminen 
    1719    Image KookieKuva = LoadImage("Kookie"); 
    1820    Image LetterKuva = LoadImage("Letter"); 
    1921    Image RapmonKuva = LoadImage("Rapmon"); 
    20  
    21  
     22    #endregion 
     23    #region nopeudet 
    2224    Vector nopeusOikealle = new Vector(300, 0); 
    2325    Vector nopeusVasemmalle = new Vector(-300, 0); 
    24  
     26    #endregion 
    2527 
    2628    public override void Begin() 
     
    2931        LuoKentta(); 
    3032        LuoPisteLaskuri(); 
    31         LuoKookie(); 
    3233        AsetaOhjaimet(); 
    3334    } 
     
    4243    } 
    4344 
     45    #region Kentan luomista 
    4446    void LuoKentta() 
    4547    { 
    4648        SetWindowSize(600,800); 
    4749        Level.Size = new Vector(600, 800); 
    48         Reuna = PhysicsObject.CreateStaticObject(580, 20, Shape.Rectangle); 
    49         Reuna.Position = new Vector(0, Level.Bottom); 
    50         Reuna.IsVisible = true; 
    51         Add(Reuna); 
     50 
     51        TileMap alaReuna = TileMap.FromLevelAsset("Kentta"); 
     52        alaReuna.SetTileMethod('#', LuoReunaa); 
     53        alaReuna.SetTileMethod('-', LuoKookie); 
     54        alaReuna.Execute(20.0,20.0); 
     55        Camera.ZoomToLevel(); 
     56 
     57 
     58        IsMouseVisible = true; 
    5259 
    5360        PhysicsObject oikeaReuna = Level.CreateRightBorder(); 
     
    5663        PhysicsObject vasenReuna = Level.CreateLeftBorder(); 
    5764        vasenReuna.Restitution = 1.0; 
    58  
    59         AddCollisionHandler(Reuna, "Hyung", Osuma); 
    60         AddCollisionHandler(Reuna, "Letter", KirjeenOsuma); 
    61         Level.CreateBorders(); 
    62  
    63          
    64  
    65     } 
    66  
     65    } 
     66 
     67    void LuoReunaa(Vector paikka, double leveys, double korkeus) 
     68    { 
     69        reuna = PhysicsObject.CreateStaticObject(leveys, korkeus); 
     70        reuna.Position = paikka; 
     71        reuna.Color = Color.Salmon; 
     72        reuna.Tag = "reuna"; 
     73        reuna.CollisionIgnoreGroup = 1; 
     74        Add(reuna); 
     75    } 
     76 
     77    void LuoKookie(Vector paikka, double leveys, double korkeus) 
     78    { 
     79        //Kookie = new PlatFormCharacter(10,10); 
     80        //Kookie.Position = paikka; 
     81        //AddCollisionHandler(Kookie, "Letter", PisteidenSaanti); 
     82        //Add(Kookie); 
     83 
     84 
     85        Kookie = PhysicsObject.CreateStaticObject(50.0, 50.0); 
     86        //Kookie.X = 0.0; 
     87        //Kookie.Y = Level.Bottom + 30; 
     88        Kookie.Position = paikka; 
     89        Kookie.Image = KookieKuva; 
     90        Kookie.Restitution = 1.0; 
     91        AddCollisionHandler(tavarat, "reuna", Osuma); 
     92 
     93        Add(Kookie); 
     94    } 
     95 
     96    #endregion 
     97 
     98    #region Luo Hahmoja 
    6799    void LuoHahmot() 
    68100    { 
     
    79111    } 
    80112 
    81     void AsetaOhjaimet() 
    82     { 
    83         Keyboard.Listen(Key.Right, ButtonState.Down, AsetaNopeus, "Oikealle.", Kookie, nopeusOikealle); 
    84         Keyboard.Listen(Key.Right, ButtonState.Released, AsetaNopeus, null, Kookie, Vector.Zero); 
    85  
    86         Keyboard.Listen(Key.Left, ButtonState.Down, AsetaNopeus, "Vasemmalle.", Kookie, nopeusVasemmalle); 
    87         Keyboard.Listen(Key.Left, ButtonState.Released, AsetaNopeus, null, Kookie, Vector.Zero); 
    88  
    89         Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
    90     } 
    91  
    92     void AsetaNopeus(PhysicsObject hahmo, Vector nopeus) 
    93     { 
    94         if ((nopeus.X > 0) && (hahmo.Right > Level.Right)) 
    95         { 
    96             hahmo.Velocity = Vector.Zero; 
    97             return; 
    98         } 
    99  
    100         if ((nopeus.X < 0) && (hahmo.Left < Level.Left)) 
    101         { 
    102             hahmo.Velocity = Vector.Zero; 
    103             return; 
    104         } 
    105  
    106         hahmo.Velocity = nopeus; 
    107     } 
    108  
    109     void LuoKookie() 
    110     { 
    111         Kookie = PhysicsObject.CreateStaticObject(50.0, 50.0); 
    112         Kookie.X = 0.0; 
    113         Kookie.Y = Level.Bottom + 30; 
    114         Kookie.Image = KookieKuva; 
    115         Kookie.Restitution = 1.0; 
    116  
    117         Add(Kookie); 
    118  
    119         AddCollisionHandler(Kookie, "Hyung", Kuolema); 
    120         AddCollisionHandler(Kookie, "Letter", PisteidenSaanti); 
    121     } 
    122  
    123     void Osuma(PhysicsObject Reuna, PhysicsObject osuneetEsineet) 
    124     { 
    125         osuneetEsineet.Destroy(); 
    126  
    127     } 
    128  
    129     void KirjeenOsuma(PhysicsObject Reuna, PhysicsObject osuneetEsineet) 
    130     { 
    131         osuneetEsineet.Destroy(); 
    132         pisteLaskuri.Value -= 10; 
    133     } 
    134  
    135113    void LuoHahmoja(int maara, Image Kuva, string tag) 
    136114    { 
     
    138116        while (i < maara) 
    139117        { 
    140             double x = RandomGen.NextDouble(Level.Left + 10, Level.Right -10); 
     118            double x = RandomGen.NextDouble(Level.Left + 10, Level.Right - 10); 
    141119            tavarat = LuoTavarat(x, Level.Top - 20, 20.0, RapmonKuva); 
    142120            tavarat.Tag = tag; 
    143121            tavarat.Image = Kuva; 
    144122            tavarat.Velocity = new Vector(0, -200); 
     123            tavarat.CollisionIgnoreGroup = 1; 
    145124            Add(tavarat); 
    146125            i++; 
     
    155134    } 
    156135 
     136    #endregion 
     137 
     138    void AsetaOhjaimet() 
     139    { 
     140        Keyboard.Listen(Key.Right, ButtonState.Down, AsetaNopeus, "Oikealle.", Kookie, nopeusOikealle); 
     141        Keyboard.Listen(Key.Right, ButtonState.Released, AsetaNopeus, null, Kookie, Vector.Zero); 
     142 
     143        Keyboard.Listen(Key.Left, ButtonState.Down, AsetaNopeus, "Vasemmalle.", Kookie, nopeusVasemmalle); 
     144        Keyboard.Listen(Key.Left, ButtonState.Released, AsetaNopeus, null, Kookie, Vector.Zero); 
     145 
     146        Keyboard.Listen(Key.Escape, ButtonState.Pressed, ConfirmExit, "Lopeta peli"); 
     147    } 
     148 
     149    void AsetaNopeus(PhysicsObject hahmo, Vector nopeus) 
     150    { 
     151        if ((nopeus.X > 0) && (hahmo.Right > Level.Right)) 
     152        { 
     153            hahmo.Velocity = Vector.Zero; 
     154            return; 
     155        } 
     156 
     157        if ((nopeus.X < 0) && (hahmo.Left < Level.Left)) 
     158        { 
     159            hahmo.Velocity = Vector.Zero; 
     160            return; 
     161        } 
     162 
     163        hahmo.Velocity = nopeus; 
     164    } 
     165 
     166 
     167    #region osumia 
     168 
     169    void Osuma(PhysicsObject Reuna, PhysicsObject osuneetEsineet) 
     170    { 
     171        osuneetEsineet.Destroy(); 
     172 
     173    } 
     174 
     175    void KirjeenOsuma(PhysicsObject Reuna, PhysicsObject osuneetEsineet) 
     176    { 
     177        osuneetEsineet.Destroy(); 
     178        pisteLaskuri.Value -= 10; 
     179    } 
     180 
    157181    void Kuolema(PhysicsObject Kookie, PhysicsObject kohde) 
    158182    { 
     
    166190        pisteLaskuri.Value = pisteLaskuri.Value + 10; 
    167191    } 
     192    #endregion 
     193 
     194     
    168195 
    169196    void LuoPisteLaskuri() 
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2.csproj

    r5590 r5618  
    88    <OutputType>WinExe</OutputType> 
    99    <AppDesignerFolder>Properties</AppDesignerFolder> 
    10     <RootNamespace>GoldenMaknae2</RootNamespace> 
    11     <AssemblyName>GoldenMaknae2</AssemblyName> 
     10    <RootNamespace>GoldenMaknae</RootNamespace> 
     11    <AssemblyName>GoldenMaknae</AssemblyName> 
    1212    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 
    1313    <TargetFrameworkProfile>Client</TargetFrameworkProfile> 
     
    1919    <ApplicationIcon>Game.ico</ApplicationIcon> 
    2020    <Thumbnail>GameThumbnail.png</Thumbnail> 
     21    <IsWebBootstrapper>false</IsWebBootstrapper> 
     22    <ReferencePath>$(registry:HKEY_LOCAL_MACHINE\Software\Jypeli@Install_Dir)\lib\x86</ReferencePath> 
    2123    <PublishUrl>publish\</PublishUrl> 
    2224    <Install>true</Install> 
     
    3133    <ApplicationRevision>0</ApplicationRevision> 
    3234    <ApplicationVersion>1.0.0.%2a</ApplicationVersion> 
    33     <IsWebBootstrapper>false</IsWebBootstrapper> 
    3435    <UseApplicationTrust>false</UseApplicationTrust> 
    3536    <BootstrapperEnabled>true</BootstrapperEnabled> 
    36     <ReferencePath>$(registry:HKEY_LOCAL_MACHINE\Software\Jypeli@Install_Dir)\lib\x86</ReferencePath> 
    3737  </PropertyGroup> 
    3838  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2.csproj.Debug.cachefile

    r5590 r5618  
    22Content\Letter.xnb 
    33Content\Rapmon.xnb 
     4Content\Kentta.xnb 
     5Content\Kentta.txt 
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2/obj/x86/Debug/ContentPipeline-{6494C56A-28E2-4B1B-97F3-D805E8298F10}.xml

    r5590 r5618  
    2828      <Output>C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Rapmon.xnb</Output> 
    2929      <Time>2014-07-23T12:43:49.1419469+03:00</Time> 
     30    </Item> 
     31    <Item> 
     32      <Source>Kentta.txt</Source> 
     33      <Name>Kentta</Name> 
     34      <Importer>TextFileImporter</Importer> 
     35      <Processor>TextFileContentProcessor</Processor> 
     36      <Options>None</Options> 
     37      <Output>C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Kentta.xnb</Output> 
     38      <Time>2014-07-24T10:26:15.718834+03:00</Time> 
    3039    </Item> 
    3140    <BuildSuccessful>true</BuildSuccessful> 
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2/obj/x86/Debug/GoldenMaknae.csproj.FileListAbsolute.txt

    r5590 r5618  
    22C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Letter.xnb 
    33C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Rapmon.xnb 
    4 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae2.exe 
    5 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae2.pdb 
    64C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Jypeli.dll 
    75C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Jypeli.xml 
    86C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
    9 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae2.exe 
    10 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae2.pdb 
     7C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae.exe 
     8C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae.pdb 
     9C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae.csprojResolveAssemblyReference.cache 
     10C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae.exe 
     11C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae.pdb 
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2/obj/x86/Debug/GoldenMaknae2.csproj.FileListAbsolute.txt

    r5590 r5618  
    11C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\Microsoft.Xna.Framework.RuntimeProfile.txt 
    22C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Kookie.xnb 
    3 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae2.exe 
    4 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae2.pdb 
    53C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Jypeli.dll 
    64C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Jypeli.xml 
    7 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae2.exe 
    8 C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae2.pdb 
    95C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae2.csprojResolveAssemblyReference.cache 
    106C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Letter.xnb 
    117C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Rapmon.xnb 
     8C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae.exe 
     9C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\GoldenMaknae.pdb 
     10C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae.exe 
     11C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\obj\x86\Debug\GoldenMaknae.pdb 
     12C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Kentta.xnb 
     13C:\MyTemp\OonaH\GoldenMaknae2\GoldenMaknae2\GoldenMaknae2\bin\x86\Debug\Content\Kentta.txt 
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2/obj/x86/Debug/cachefile-{6494C56A-28E2-4B1B-97F3-D805E8298F10}-targetpath.txt

    r5590 r5618  
    22Content\Letter.xnb 
    33Content\Rapmon.xnb 
     4Content\Kentta.xnb 
     5Content\Kentta.txt 
  • 2014/30/OonaH/GoldenMaknae2/GoldenMaknae2/GoldenMaknae2Content/GoldenMaknae2Content.contentproj

    r5590 r5618  
    6666    </Compile> 
    6767  </ItemGroup> 
     68  <ItemGroup> 
     69    <Compile Include="Kentta.txt"> 
     70      <Name>Kentta</Name> 
     71      <Importer>TextFileImporter</Importer> 
     72      <Processor>TextFileContentProcessor</Processor> 
     73      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> 
     74    </Compile> 
     75  </ItemGroup> 
    6876  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 
    6977  <!--  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.