Welcome  everyone Namaste My blog praveen hirachan Nepal Japan

Thursday, May 1, 2014

How to make a simple "Maze Game" using C# for beginners

Wondering how to make your first simple Game using C#. If you are new to programming world then may be you are wondering if You could actually make anything like a "GAME" in C language.
Of course, you can. Here I have again created a new tutorial video on how  to make  a simple "Maze Game" using C# for beginners.


Code 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace maze_game
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            MoveToStart();
     
        }

        private void label1_MouseEnter(object sender, EventArgs e)
        {
            MessageBox.Show("Congratulation");
            Close();
        }
        private void MoveToStart()
        {
            Point startingPoint = panel1.Location;
            startingPoint.Offset(10, 10);
            Cursor.Position = PointToScreen(startingPoint);
        }

        private void label2_MouseEnter(object sender, EventArgs e)
        {
            MoveToStart();
        }
        int flag = 0;
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (flag == 0)
            {
                label13.Enabled = true;
                label13.Visible = true;
                flag = 1;
            }
            else
            {
                label13.Enabled=false;
                label13.Visible=false;
                flag=0;
            }
        }
       

     

        

       
    }

}




No comments:

Post a Comment

Popular Posts