예제 #1
0
 public Okno(string filename)
 {
     InitializeComponent();
     Filename = filename;
     Settings sheet = new Settings (Filename,false);
     pudinklinux.Game1 g = new pudinklinux.Game1 ();
     GraphicsDevice dev = g.GraphicsDevice;
     Pudink.TextureSet pud = global::pudink.Graphics.Graphics.Pudink_LoadTextures_Fake(dev);
     Brouk.TextureSet bug = global::pudink.Graphics.Graphics.Brouk_LoadTextures_Fake (dev);
     PowerUp.TextureSet pow = global::pudink.Graphics.Graphics.PowerUp_LoadTextures_Fake (dev);
     Level lvl = new Level (sheet.Contents,ref pud,ref bug,ref pow,2048);
     g.Dispose ();
     pudink = lvl.hrdina;
     hliny = lvl.dirts;
     cesty = lvl.ways;
     bugove = lvl.nepratele;
     vylepseni = lvl.vylepseni;
 }
예제 #2
0
파일: Game1.cs 프로젝트: JakubVanek/pudding
 public Game1()
 {
     /*
     for (int i = 0; i < 41; i++)
     {
         Console.Write ("{0}|{1},", i, -1);
     }
     for (int i = 0; i < 41; i++)
     {
         Console.Write ("{0}|{1},", i, -2);
     }
     Console.Write ('\n');
     */
     settings = new pudink.Settings();
     graphics = new GraphicsDeviceManager (this);
     graphics.IsFullScreen = Convert.ToBoolean(settings.Contents["Fullscreen"][0]);
     graphics.PreferredBackBufferWidth=Convert.ToInt32(settings.Contents["ResX"][0]);
     graphics.PreferredBackBufferHeight = Convert.ToInt32(settings.Contents["ResY"][0]);
     this.Window.AllowUserResizing = false;
     Content.RootDirectory = "/home/kuba/pudink-linux/pudink-linux/Content";
     viewY0 = Convert.ToInt32(settings.Contents["ResY"][0]);
     this.Window.Title = "Pudink";
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="pudink.Scoring"/> class.
 /// </summary>
 public Scoring(Settings settings)
 {
     sheet = settings;
     Load ();
 }
예제 #4
0
파일: World.cs 프로젝트: JakubVanek/pudding
 /// <summary>
 /// Initializes a new instance of the <see cref="pudink.World"/> class.
 /// </summary>
 /// <param name="settings">Settings.</param>
 /// <param name="pud_textury">Pudding textures.</param>
 /// <param name="bug_textury">Bug textures.</param>
 /// <param name="pow_textury">PowerUp textures.</param>
 public World(Settings settings,ref Pudink.TextureSet pud_textury,ref Brouk.TextureSet bug_textury,ref PowerUp.TextureSet pow_textury)
 {
     sheet = settings;
     pud_textureSet = pud_textury;
     bug_textureSet = bug_textury;
     pow_textureSet = pow_textury;
 }
예제 #5
0
파일: World.cs 프로젝트: JakubVanek/pudding
 /// <summary>
 /// Initializes a new instance of the <see cref="pudink.World"/> class.
 /// </summary>
 /// <param name="settings">Settings sheet.</param>
 public World(Settings settings)
 {
     sheet = settings;
 }
예제 #6
0
파일: World.cs 프로젝트: JakubVanek/pudding
 /// <summary>
 /// Loads levels and settings.
 /// </summary>
 public void Load()
 {
     // 1. part - loading from settings sheet
     Console.WriteLine("1");
     Vanilka = Convert.ToBoolean(sheet.Contents["Vanilka"][0]);
     Pistacie = Convert.ToBoolean(sheet.Contents["Pistacie"][0]);
     Cokolada = Convert.ToBoolean(sheet.Contents["Cokolada"][0]);
     Jahoda = Convert.ToBoolean(sheet.Contents["Jahoda"][0]);
     Pomeranc = Convert.ToBoolean(sheet.Contents["Pomeranc"][0]);
     VanocniMix = Convert.ToBoolean(sheet.Contents["Vanocka"][0]);
     postup = Convert.ToInt32(sheet.Contents["Level"][0]);
     Console.WriteLine("2");
     // 2. part - loading levels
     Settings levels = new Settings(DefaultLevelList);
     int pocet = Convert.ToInt32(levels.Contents["levelcount"][0]);
     for(int i = 1; i<=pocet;i++)
     {
         string folder = levels.Contents[Convert.ToString(i)][0];
         string levelfile = Path.Combine(DefaultFolder,folder,folder+".level");
         string data = File.ReadAllText(levelfile);
         Dictionary<string,string[]> sheet2 = Settings.Parse(data);
         urovne.Add(new Level(sheet2, ref pud_textureSet,ref bug_textureSet,ref pow_textureSet, viewY0));
     }
 }