C-Sharp Programming Beginner Tutorial: No-Frills Dungeon Crawler (Part 6)

CSharp-ForBeginners_FristImage.JPG

Ok, so I know it's been a good deal of time since I wrote the last Tutorial Post. I apologize, it's been super-hectic with my job and I've been dealing with a car that's been broken and just life, in general. On top of that I've not been sure if I should even continue with these Tutorial Posts. Then it struck me yesterday that I don't like the idea of being a quitter... I've quit too many things in my life already for my liking, and I want to finish this game, regardless of whether it takes me a very long time to do so.

Then I thought of my followers and how much help these Posts seem to be doing as I reread your comments. It's because you guys seem to be craving these Lessons that I continue. So, yet again, here we stand on the precipice of learning. Diving in...


So What's Up For Today?

Well, class, I think I'm going to just synchronize with the lessons. To do this, I'm going to copy over the code snippets for each Class File that I've generated so far and right below here will be a video of me playing the game. It still doesn't have monsters or treasures popping up, but it does randomly throw in a pit to kill the character (although I have no graphic in place for it yet.

I won't be explaining any of the concepts or code specifically. Please comment afterwards to let me know what code we have already learned and what code looks new. In addition, if you can comment with an explanation of the new code bits to tell the class what it does, you'll receive a 100% upvote on that comment.

So here you go!


gameplay_03112018.gif


-MapForm.cs_

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

namespace SimpleDungeonCrawlerGame
{
    public partial class MapForm : Form
    {
        DataTable monster_table = new DataTable();
        DataTable score_table = new DataTable();

        public string character_name = string.Empty;
        public int character_life = 100;

        DnD_Character_Sheet.CharacterSheet character = new DnD_Character_Sheet.CharacterSheet();

        Random r = new Random();

        public char map;

        //these letters represent the positioning of doors in a room as they are set up
        public char[] room_types = { ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o' };

        public const int north = 0;
        public const int east = 1;
        public const int south = 2;
        public const int west = 3;

        public int direction = north;
        public int map_x = 0;
        public int map_y = 0;

        public bool north_door = false;
        public bool east_door = false;
        public bool south_door = false;
        public bool west_door = false;

        public PictureBox backdrop = new PictureBox();

        Image left_image;
        Image front_image;
        Image right_image;
        Image left_front_image;
        Image left_right_image;
        Image front_right_image;
        Image left_front_right_image;
        Image none_image;

        Image pit_trap;

        public MapForm()
        {
            InitializeComponent();

            this.DialogResult = DialogResult.Ignore;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Intro intro = new Intro();
            if (intro.ShowDialog() == DialogResult.OK)
            {
                NameForm name_form = new NameForm();
                if (name_form.ShowDialog() == DialogResult.OK)
                {
                    this.character_name = name_form.name;
                }
            }
            else
            {
                this.DialogResult = DialogResult.No;
                this.Close();
            }

            MessageBox.Show(string.Format(@"Welcome to the Dungeon, {0}!", character_name));

            if (character.ShowDialog() == DialogResult.OK)
            {
                MessageBox.Show(string.Format(@"Now you are all set! Go forth, {0} and save the Princess!", character_name));
            }

            this.backdrop.Location = new Point(100, 100);
            this.backdrop.Size = new Size(401, 401);
            this.Controls.Add(this.backdrop);

            left_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_left.gif");
            front_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_front.gif");
            right_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_right.gif");
            left_front_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_left_front.gif");
            left_right_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_left_right.gif");
            front_right_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_front_right.gif");
            left_front_right_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_left_front_right.gif");
            none_image = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\walls_none.gif");

            pit_trap = Image.FromFile(@"C:\SteemitTutorialProjects\SimpleDungeonCrawlerGame\SimpleDungeonCrawlerGame\hole.jpg");

            map = room_types[r.Next(0, 15)];

            GetDoors(map);
            this.Update();

            monster_table.Rows.Clear();
            monster_table.Columns.Clear();
            monster_table.Columns.Add("id");
            monster_table.Columns.Add("monster_name");
            monster_table.Columns.Add("monster_image_filename");
            monster_table.Columns.Add("min_health");
            monster_table.Columns.Add("max_health");
            monster_table.Columns.Add("min_attack");
            monster_table.Columns.Add("max_attack");
            monster_table.Columns.Add("min_defense");
            monster_table.Columns.Add("max_defense");
            monster_table.Columns.Add("min_score_reward");
            monster_table.Columns.Add("max_score_reward");
            monster_table.Columns.Add("min_treasure_reward");
            monster_table.Columns.Add("max_treasure_reward");

            char line_end = Environment.NewLine.ToCharArray()[0];
            string monster_text = File.ReadAllText(@"C:\monsters.txt");
            foreach (string monster_line in monster_text.Split(line_end))
            {
                string[] monster_columns = monster_line.Split('|');
                monster_table.Rows.Add(monster_columns);
            }

            score_table.Rows.Clear();
            score_table.Columns.Clear();
            score_table.Columns.Add("score");
            score_table.Columns.Add("name");
            score_table.Columns.Add("date");

            string hi_scores_text = File.ReadAllText(@"C:\hi_scores.txt");
            foreach (string hi_score_line in hi_scores_text.Split(line_end))
            {
                string[] hi_score_columns = hi_score_line.Split('|');
                score_table.Rows.Add(hi_score_columns);
            }
        }

        private void Done_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Yes;
            this.Close();
        }

        private void ShowScores()
        {
            HighScores hi_scores = new HighScores(score_table);
            if (hi_scores.ShowDialog() == DialogResult.OK)
            {

            }
        }

        private void MoveForward_Click(object sender, EventArgs e)
        {
            switch (direction)
            {
                case north: if (CheckDirection(true)) { map_y++; LastMessage.Text = "You moved forward."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                case east: if (CheckDirection(true)) { map_x++; LastMessage.Text = "You moved forward."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                case south: if (CheckDirection(true)) { map_y--; LastMessage.Text = "You moved forward."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                case west: if (CheckDirection(true)) { map_x--; LastMessage.Text = "You moved forward."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                default: break;
            }

            GetDoors(map);
            this.Update();
        }

        private void MoveBack_Click(object sender, EventArgs e)
        {
            switch (direction)
            {
                case north: if (CheckDirection(false)) { map_y--; LastMessage.Text = "You moved back."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                case east: if (CheckDirection(false)) { map_x--; LastMessage.Text = "You moved back."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                case south: if (CheckDirection(false)) { map_y++; LastMessage.Text = "You moved back."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                case west: if (CheckDirection(false)) { map_x++; LastMessage.Text = "You moved back."; map = room_types[r.Next(0, 15)]; } else { LastMessage.Text = "You cannot go that way. No Door."; }; break;
                default: break;
            }

            GetDoors(map);
            this.Update();
        }

        private void TurnRight_Click(object sender, EventArgs e)
        {
            direction++;

            if (direction > west) { direction = north; }

            GetDoors(map);
            LastMessage.Text = "Turn Right.";
            this.Update();
        }

        private void TurnLeft_Click(object sender, EventArgs e)
        {
            direction--;

            if (direction < north) { direction = west; }

            GetDoors(map);
            LastMessage.Text = "Turn Left.";
            this.Update();
        }

        private bool CheckDirection(bool forward)
        {
            bool result = false;

            if (forward)
            {
                if (direction == north)
                {
                    return north_door;
                }
                else if (direction == east)
                {
                    return east_door;
                }
                else if (direction == south)
                {
                    return south_door;
                }
                else if (direction == west)
                {
                    return west_door;
                }
            }
            else
            {
                if (direction == north)
                {
                    return south_door;
                }
                else if (direction == east)
                {
                    return west_door;
                }
                else if (direction == south)
                {
                    return north_door;
                }
                else if (direction == west)
                {
                    return east_door;
                }
            }

            return result;
        }

        private void GetDoors(char room_identifier)
        {
            int monster_randomizer = r.Next(0, 20);
            int show_monster_randomizer = r.Next(0, 20);

            if (monster_randomizer == show_monster_randomizer)
            {
                ShowMonsterFight();
            }

            if (r.Next(0, 5) == 4)
            {
                this.backdrop.Image = pit_trap;
                this.backdrop.SizeMode = PictureBoxSizeMode.StretchImage;

                MessageBox.Show("You fell in a pit and died. Watch that next step, it's a doozy.");
                character_life = 0;
            }

            if (character_life == 0)
            {
                character_life = 100;
                YouHaveDied();
                return;
            }

            switch (room_identifier)
            {
                case 'a':
                    north_door = true; east_door = false; south_door = false; west_door = false;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = front_image; break;
                        case east: this.backdrop.Image = left_image; break;
                        case south: this.backdrop.Image = none_image; break;
                        case west: this.backdrop.Image = right_image; break;
                        default: break;
                    }
                    break;
                case 'b':
                    north_door = false; east_door = true; south_door = false; west_door = false;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = right_image; break;
                        case east: this.backdrop.Image = front_image; break;
                        case south: this.backdrop.Image = left_image; break;
                        case west: this.backdrop.Image = none_image; break;
                        default: break;
                    }
                    break;
                case 'c':
                    north_door = false; east_door = false; south_door = true; west_door = false;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = none_image; break;
                        case east: this.backdrop.Image = right_image; break;
                        case south: this.backdrop.Image = front_image; break;
                        case west: this.backdrop.Image = left_image; break;
                        default: break;
                    }
                    break;
                case 'd':
                    north_door = false; east_door = false; south_door = false; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_image; break;
                        case east: this.backdrop.Image = none_image; break;
                        case south: this.backdrop.Image = right_image; break;
                        case west: this.backdrop.Image = front_image; break;
                        default: break;
                    }
                    break;
                case 'e':
                    north_door = true; east_door = true; south_door = false; west_door = false;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = front_right_image; break;
                        case east: this.backdrop.Image = left_front_image; break;
                        case south: this.backdrop.Image = left_image; break;
                        case west: this.backdrop.Image = right_image; break;
                        default: break;
                    }
                    break;
                case 'f':
                    north_door = true; east_door = false; south_door = true; west_door = false;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = front_image; break;
                        case east: this.backdrop.Image = left_right_image; break;
                        case south: this.backdrop.Image = front_image; break;
                        case west: this.backdrop.Image = left_right_image; break;
                        default: break;
                    }
                    break;
                case 'g':
                    north_door = true; east_door = false; south_door = false; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_front_image; break;
                        case east: this.backdrop.Image = left_image; break;
                        case south: this.backdrop.Image = right_image; break;
                        case west: this.backdrop.Image = front_right_image; break;
                        default: break;
                    }
                    break;
                case 'h':
                    north_door = false; east_door = true; south_door = true; west_door = false;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = right_image; break;
                        case east: this.backdrop.Image = front_right_image; break;
                        case south: this.backdrop.Image = left_front_image; break;
                        case west: this.backdrop.Image = left_image; break;
                        default: break;
                    }
                    break;
                case 'i':
                    north_door = false; east_door = true; south_door = false; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_right_image; break;
                        case east: this.backdrop.Image = front_image; break;
                        case south: this.backdrop.Image = left_right_image; break;
                        case west: this.backdrop.Image = front_image; break;
                        default: break;
                    }
                    break;
                case 'j':
                    north_door = false; east_door = false; south_door = true; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_image; break;
                        case east: this.backdrop.Image = right_image; break;
                        case south: this.backdrop.Image = front_right_image; break;
                        case west: this.backdrop.Image = left_front_image; break;
                        default: break;
                    }
                    break;
                case 'k':
                    north_door = true; east_door = true; south_door = true; west_door = false;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = front_right_image; break;
                        case east: this.backdrop.Image = left_front_right_image; break;
                        case south: this.backdrop.Image = left_front_image; break;
                        case west: this.backdrop.Image = left_right_image; break;
                        default: break;
                    }
                    break;
                case 'l':
                    north_door = true; east_door = true; south_door = false; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_front_right_image; break;
                        case east: this.backdrop.Image = left_front_image; break;
                        case south: this.backdrop.Image = left_right_image; break;
                        case west: this.backdrop.Image = front_right_image; break;
                        default: break;
                    }
                    break;
                case 'm':
                    north_door = true; east_door = false; south_door = true; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_front_image; break;
                        case east: this.backdrop.Image = left_right_image; break;
                        case south: this.backdrop.Image = front_right_image; break;
                        case west: this.backdrop.Image = left_front_right_image; break;
                        default: break;
                    }
                    break;
                case 'n':
                    north_door = false; east_door = true; south_door = true; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_right_image; break;
                        case east: this.backdrop.Image = front_right_image; break;
                        case south: this.backdrop.Image = left_front_right_image; break;
                        case west: this.backdrop.Image = left_front_image; break;
                        default: break;
                    }
                    break;
                case 'o':
                    north_door = true; east_door = true; south_door = true; west_door = true;
                    switch (direction)
                    {
                        case north: this.backdrop.Image = left_front_right_image; break;
                        case east: this.backdrop.Image = left_front_right_image; break;
                        case south: this.backdrop.Image = left_front_right_image; break;
                        case west: this.backdrop.Image = left_front_right_image; break;
                        default: break;
                    }
                    break;
                default: break;
            }
        }

        private void HighScores_Click(object sender, EventArgs e)
        {
            ShowScores();
        }

        private void SaveScore()
        {
            //TODO: Add logic to Save your Score (if it's High Enough it will show up on the High Score table)
        }

        private void YouHaveDied()
        {
            SaveScore();

            this.DialogResult = DialogResult.Yes;
            this.Close();
        }

        private void ShowMonsterFight()
        {
            int monster_type = r.Next(0, monster_table.Rows.Count - 1);


            /*
            monster_table.Columns.Add("id");
            monster_table.Columns.Add("monster_name");
            monster_table.Columns.Add("monster_image_filename");
            monster_table.Columns.Add("min_health");
            monster_table.Columns.Add("max_health");
            monster_table.Columns.Add("min_attack");
            monster_table.Columns.Add("max_attack");
            monster_table.Columns.Add("min_defense");
            monster_table.Columns.Add("max_defense");
            monster_table.Columns.Add("min_score_reward");
            monster_table.Columns.Add("max_score_reward");
            monster_table.Columns.Add("min_treasure_reward");
            monster_table.Columns.Add("max_treasure_reward");
            */
        }
    }
}


NameForm.cs

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 SimpleDungeonCrawlerGame
{
    public partial class NameForm : Form
    {
        public string name = string.Empty;

        public NameForm()
        {
            InitializeComponent();

            this.DialogResult = DialogResult.Abort;
        }

        private void NameForm_Load(object sender, EventArgs e)
        {
        }

        private void Done_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.name = this.Name.Text.Trim();
            this.Close();
        }
    }
}


Intro.cs

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 SimpleDungeonCrawlerGame
{
    public partial class Intro : Form
    {
        public Intro()
        {
            InitializeComponent();

            this.DialogResult = DialogResult.Abort;
        }

        private void Intro_Load(object sender, EventArgs e)
        {

        }

        private void Done_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}


HighScores.cs

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

namespace SimpleDungeonCrawlerGame
{
    public partial class HighScores : Form
    {
        DataTable scores = new DataTable();
        List<KeyValuePair<int, string>> all_scores = new List<KeyValuePair<int, string>>();
        List<KeyValuePair<int, string>> sorted_scores = new List<KeyValuePair<int, string>>();

        public HighScores(DataTable scores)
        {
            InitializeComponent();

            this.scores = scores;
            this.DialogResult = DialogResult.Abort;
        }

        private void HighScores_Load(object sender, EventArgs e)
        {
            SetScores();
        }

        private void SetScores()
        {
            int score = 0;
            foreach (DataRow score_row in this.scores.Rows)
            {
                int.TryParse(score_row["score"]?.ToString(), out score);

                if (score > 0 && score_row["name"]?.ToString() != string.Empty)
                {
                    all_scores.Add(new KeyValuePair<int, string>(score, score_row["name"]?.ToString()));
                }
            }

            sorted_scores = all_scores.OrderBy(x => x.Key).ToList();

            for (int counter = 0; counter <= 9; counter++)
            {
                ScoreGrid.Rows.Add((counter + 1).ToString(), sorted_scores[counter].Key.ToString(), sorted_scores[counter].Value.ToString());
            }
        }

        private void Done_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}


CharacterSheet.cs

using System;
using System.Windows.Forms;

namespace DnD_Character_Sheet
{
    public partial class CharacterSheet : Form
    {
        public int Str;
        public int Dex;
        public int Int;
        public int Wis;
        public int Cha;
        public int Con;

        public Random random_number_generator;

        public CharacterSheet()
        {
            InitializeComponent();

            this.random_number_generator = new Random();

            this.DialogResult = DialogResult.Abort;
        }

        private void Exit_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;

            this.Close();
        }

        private void Reroll_Click(object sender, EventArgs e)
        {
            this.Str = DiceRoll();
            this.Dex = DiceRoll();
            this.Int = DiceRoll();
            this.Wis = DiceRoll();
            this.Cha = DiceRoll();
            this.Con = DiceRoll();

            this.Strength.Text = this.Str.ToString();
            this.Dexterity.Text = this.Dex.ToString();
            this.Intelligence.Text = this.Int.ToString();
            this.Wisdom.Text = this.Wis.ToString();
            this.Charisma.Text = this.Cha.ToString();
            this.Constitution.Text = this.Con.ToString();

            this.Refresh();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Str = DiceRoll();
            this.Dex = DiceRoll();
            this.Int = DiceRoll();
            this.Wis = DiceRoll();
            this.Cha = DiceRoll();
            this.Con = DiceRoll();

            this.Strength.Text = this.Str.ToString();
            this.Dexterity.Text = this.Dex.ToString();
            this.Intelligence.Text = this.Int.ToString();
            this.Wisdom.Text = this.Wis.ToString();
            this.Charisma.Text = this.Cha.ToString();
            this.Constitution.Text = this.Con.ToString();

            this.Refresh();
        }

        public int DiceRoll()
        {
            int die_roll = 0;

            die_roll = random_number_generator.Next(1, 6) + random_number_generator.Next(1, 6) + random_number_generator.Next(1, 6);

            return die_roll;
        }
    }
}


GameClass.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SimpleDungeonCrawlerGame
{
    public class GameClass
    {
        public bool IsAlive = true;
        public bool IsResetting = true;
        public bool LoadNewGame = true;

        public GameClass()
        {
            ShowGameClass();
        }
        
        public void ShowGameClass()
        {
            while (LoadNewGame)
            {
                MapForm game = new MapForm();

                while (IsAlive && IsResetting)
                {
                    if (game.ShowDialog() == DialogResult.Yes)
                    {
                        if (MessageBox.Show("Play again?", string.Format("I'm sorry you died. Next time, be more careful! Would you like to play again?"), MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            LoadNewGame = true;
                            IsResetting = true;
                            IsAlive = true;
                        }
                        else
                        {
                            LoadNewGame = false;
                            IsResetting = false;
                            IsAlive = false;

                            MessageBox.Show("Goodbye", "Thanks for playing! Goodbye!");
                        }
                    }
                    else
                    {
                        LoadNewGame = false;
                        IsResetting = false;
                        IsAlive = false;

                        MessageBox.Show("Goodbye", "Thanks for playing! Goodbye!");
                    }
                }
            }

            if (!IsResetting) { Application.Exit(); }
        }
    }
}

This Class has no associated Form


Program.cs

This is the main program that Visual Studio sets up on it's own.

This is what it looked like to begin with:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace SimpleDungeonCrawlerGame
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new GameClass());
        }
    }
}

and this is what it looks like after I monkeyed with it to keep cycling through on death-and-restart:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace SimpleDungeonCrawlerGame
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            GameClass game = new GameClass();
            //Application.Run(new GameClass());
        }
    }
}

Lessons Learned

Here are the links to your lessons learned (or not learned, if you need to go back and learn them):

C# Programming Beginner Tutorial: Basic Concepts and Ideas

C# Programming Beginner Tutorial: A First look at actual code using D&D as the Project

C# Programming Beginner Tutorial: Variables & Data Types to Fuel the Gaming Engine!

C# Programming Beginner Tutorial: Designing the Game with Programming Logic in Mind (Part 1)

C# Programming Beginner Tutorial: Designing the Game with Programming Logic in Mind (Part 2)

C# Programming Beginner Tutorial: Designing the Game with Programming Logic in Mind (Part 3)

C-Sharp Programming Beginner Tutorial: Designing the Game with Programming Logic in Mind (Part 4)

C-Sharp Programming Beginner Tutorial: Rock! Paper! Scissors!

C-Sharp Programming Beginner Tutorial: No-Frills Dungeon Crawler (Part 1)

C-Sharp Programming Beginner Tutorial: No-Frills Dungeon Crawler (Part 2)

C-Sharp Programming Beginner Tutorial: No-Frills Dungeon Crawler (Part 3)

C-Sharp Programming Beginner Tutorial: No-Frills Dungeon Crawler (Part 4)

C-Sharp Programming Beginner Tutorial: No-Frills Dungeon Crawler (Part 5)

Sort:  

Ohh man this is really cool. I've been taking course of python from udemy.... This feels tough when you look at it.. But slowly you can learn. You just need to invest some time.

If you go back through my earlier Tutorial Posts and work up to this you will see the progression and it will be far easier to learn from this post. I actually just started teaching myself Python over the weekend... lots of similarities but some nice differences.

Sir @dbzfan4awhile if I'm not wrong then csharp is used in unity to make games ???? ...... Can you suggest me a website in which i would get in depth knowledge about csharp .... Nicely explained sir where were you I was missing your post are you busy somewhere ??

I've looked at CodeCademy (I think that's it) before and they seem a decent way to learn, but I've not dug too deeply. Unity does offer integration with C Sharp for games, but I've not dug too deeply into that either, although I have Unity's SDK/platform downloaded. As for my absence, I've just had some real-life issues take precedence (eg. the Turbo went out in my car and had to figure out how to get over a thousand dollars to fix it). I figure I'll have probably 3 or 4 more posts specific to this game and then go to Tool-Based logic or other such things.

Good to see you are sticking with your tutorials. I can't do anything on a phone but read it 😊
I am sorry to hear about the car issues. Take care!

Thanks Rose, you're awesome. I hope the migraines haven't been too bad lately. We got the car fixed (hopefully) and it's given us incentive to not get another Car Loan in the future if we don't have to (and if we do, make it a very short-term loan).

They have been brutal. I have one now. I'm glad the car is fixed. My car is paid off, but may fail inspection in May. Good luck!

Eeek!! Good luck with that as well!

Fingers crossed <3

I always found C sharp so tough. Can you share some quite easy tutorials for learning C sharp?

Have you went through my previous Posts yet? If not, then I'd suggest starting there to see if they help to clear up confusion. Otherwise I can't say for sure... I've looked at a few that are decent but can't give a strong endorsement either way.

Great education post @dbzfan4while...
I'm learning an object-oriented program
Tutorials on Java would have been very useful for me.

This is C#, but there are definitely similarities and the constructs are not too different. Any tutorials that show how to do something are a good way to learn.

I think that's what I look like when I'm stumped on a logic segment and finally have a break-through.

Coin Marketplace

STEEM 0.13
TRX 0.23
JST 0.031
BTC 83907.96
ETH 1882.01
USDT 1.00
SBD 0.77