Главная страница

Солуянова Семестровая Марио. Введение в ии


Скачать 0.58 Mb.
НазваниеВведение в ии
Дата12.06.2022
Размер0.58 Mb.
Формат файлаdocx
Имя файлаСолуянова Семестровая Марио.docx
ТипДокументы
#586456
страница2 из 8
1   2   3   4   5   6   7   8




using System;
















using System.Collections.Generic;




using System.Windows.Forms;









namespace MarioObjects




{




static class Program




{




///




/// The main entry point for the application.




///




[STAThread]




static void Main()




{




Application.EnableVisualStyles();




Application.SetCompatibleTextRenderingDefault(false);




Application.Run(new frmMain());




}




}




}

using System;
















using System.Collections.Generic;




using System.ComponentModel;




using System.Data;




using System.Drawing;




using System.Text;




using System.Windows.Forms;




using System.Runtime.InteropServices;









using Helper;




using MarioObjects.Objects.BaseObjects;




using MarioObjects.Objects.GameObjects;




using MarioObjects.Objects.Utils;









namespace MarioObjects




{




public partial class frmMain : Form




{




public const int WM_NCLBUTTONDOWN = 0xA1;




public const int HT_CAPTION = 0x2;




private const int WM_PAINT = 0x000F;














[DllImportAttribute("user32.dll")]




public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);




[DllImportAttribute("user32.dll")]




public static extern bool ReleaseCapture();









[DllImport("User32.dll")]




private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);









public Level lev;




public int BackPaint = 0;









DateTime LevelBeginTime;














public frmMain()




{




InitializeComponent();




}









public void Init_Properties()




{




Width = 320;




Height = 240 + 40 + flowPanel_gameInfo.Height;









//Cursor.Hide();









pMain.Image = new Bitmap(320,240);




/*pMain.Left = 0;




pMain.Top = 0;




pMain.Width = pMain.Image.Width;




pMain.Height = pMain.Image.Height;*/









Left = SystemInformation.PrimaryMonitorSize.Width / 2 - this.Width / 2;




Top = SystemInformation.PrimaryMonitorSize.Height / 2 - this.Height / 2;









Media.PlaySound(Media.SoundType.ST_level2);




}









private void MainForm_Load(object sender, EventArgs e)




{




LevelManager.Instance.InitLevelManager("LevelManager.xml");




Load_Level(LevelManagerLoadTypes.STARTUP);




}









private void timerPaint_Tick(object sender, EventArgs e)




{




pMain.Invalidate();




DateTime TimeClose = DateTime.Now;




TimeSpan Diff = TimeClose.Subtract(LevelBeginTime);




this.Text = string.Format("{0:00}:{1:00}:{2:00}", Diff.Hours, Diff.Minutes, Diff.Seconds);
1   2   3   4   5   6   7   8


написать администратору сайта