Fungle's Profile User Rating: *****

Reputation: 249 Stalwart
Group:
Author w/DIC++
Active Posts:
337 (0.22 per day)
Joined:
06-March 10
Profile Views:
16,242
Last Active:
User is offline Yesterday, 02:38 PM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Linux
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
225

Latest Visitors

Icon   Fungle has not set their status

Posts I've Made

  1. In Topic: C# For Beginners Tutorial I

    Posted 3 Apr 2014

    View PostFungle, on 24 July 2011 - 12:36 PM, said:

    As a most requested topic on the thread; I will post the code listing for you.The namespace is not the same for everyone, it depends on what you chose as your project name.Here is the code for the Class file:
    using System;using System.Drawing;namespace ClassT{    class Turnip    {        public Color T_Color { get; set; }        public int Size { get; set; }        public int Grow()        {            Size++;            return Size;        }    }}
    
    Here is the code for the Form:
    using System;using System.Drawing;using System.Windows.Forms;namespace ClassT{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void Form1_Load(object sender, EventArgs e)        {            Turnip Bob = new Turnip();            Bob.Grow();        }    }}
    
    Note: Nothing visual will happen when you run this code.Also; If anyone has suggestions for anything in Part 2 they want to do say so.



    View PostJNicki, on 28 February 2014 - 05:33 PM, said:

    One thing about these tutorials is that it doesn't show a lot of the background work, so the author must be insinuating the reader already generally knows what goes where. A huge help would be to have the entire finished code embedded at the bottom for reference, thanks.


    Hello, I'm sorry you are not satisfied with my tutorial. I posted the code listing in the comments some time ago, I have quoted this above. Hope this helps

    Sadly I'm not on my PC so its best to scroll up to the original post to get better formatting.
  2. In Topic: C# For Beginners Tutorial I

    Posted 16 Feb 2013

    Update:

    I feel I should mention that there will not be anymore of this tutorial series [from me at least].

    As you can see this tutorial was written over two years ago now.

    Alot has happened since then, and as far as I can remember, besides being very busy with exams etc at the time; another group of people in the C# Forum started their own learning series here: http://www.dreaminco...%23-start-here/

    I'm not sure if that is being worked on anymore but feel free to check it out, or other tutorials in the C# section of Dreamincode if you wish to further your knowledge of C#.

    I hope my tutorial helped, and I do check DIC from time to time for PM's etc.
  3. In Topic: C#: Basic Box Game

    Posted 8 Feb 2013

    View Postcocoto4, on 20 November 2012 - 10:12 PM, said:

    hey! thanks alot for this tutorial! learned alot :D/>/> although i can't seem to figure out how to make you "respawn" when you hit the corners, neither how you find out if the player hit the corners, can you please help me on this?
    This is my current 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 WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
                
                private Rectangle Goal = new Rectangle(350, 600, 50, 50);
                private Rectangle Player = new Rectangle(350, 1, 50, 50);
                private Rectangle Enemy1 = new Rectangle(0, 150, 75, 75);
                private Rectangle Enemy2 = new Rectangle(599, 350, 75, 75);
    
            public Form1()
            {
    
            InitializeComponent();
            this.MaximumSize = new Size(750, 750);
            this.MinimumSize = new Size(750, 750);
            InitializeComponent();
            }
    
            private void Form1_Paint(object sender, PaintEventArgs e)
            {
                e.Graphics.DrawRectangle(Pens.Green, Goal);
                e.Graphics.DrawRectangle(Pens.Blue, Player);
                e.Graphics.DrawRectangle(Pens.Red, Enemy1);
                e.Graphics.DrawRectangle(Pens.Red, Enemy2);
            }
    
    
            private void Form1_KeyDown(object sender, KeyEventArgs e)
            {
                int PlayerX = Player.Location.X;
                int PlayerY = Player.Location.Y;
             switch (e.KeyData)
            {
            case Keys.Up:
                Player.Location = new Point(PlayerX += 0, PlayerY -= 20);
                this.Refresh();
                break;
            case Keys.Down:
                Player.Location = new Point(PlayerX += 0, PlayerY += 20);
                this.Refresh();
                break;
            case Keys.Left:
                Player.Location = new Point(PlayerX -= 20, PlayerY += 0);
                this.Refresh();
                break;
            case Keys.Right:
                Player.Location = new Point(PlayerX += 20, PlayerY += 0);
                this.Refresh();
                break;
            }
    
      }
            
            private void timer1_Tick(object sender, EventArgs e)
            {
                int EX1 = Enemy1.Location.X;
                int EY1 = Enemy1.Location.Y;
    
                if (Enemy1.Location.X > 600)
                {
                    Enemy1.Location = new Point(EX1 = 0, EY1 = 150);
                }
    
                Enemy1.Location = new Point(EX1 += 30, EY1 += 0);
                this.Refresh();
    
                int EX2 = Enemy2.Location.X;
                int EY2 = Enemy2.Location.Y;
    
                if (Enemy2.Location.X < 0)
                {
                    Enemy2.Location = new Point(EX2 = 599, EY2 = 350);
    
                }
    
                Enemy2.Location = new Point(EX2 -= 30, EY2 += 0);
                this.Refresh();
    
    
            }
    
    
           
            private void HitDetect(object sender, EventArgs e)
            {
                int PlayerX = Player.Location.X;
                int PlayerY = Player.Location.Y;
    
                if (Player.IntersectsWith(Goal))
                {
                    Player.Location = new Point(PlayerX = 350, PlayerY = 0);
                    MessageBox.Show("You won!", "Nice!");
                }
            
                if (Enemy1.IntersectsWith(Player))
                {
                    Player.Location = new Point(PlayerX = 350, PlayerY = 0);
                    MessageBox.Show("You lose!");
                }
    
                if (Enemy2.IntersectsWith(Player))
                {
                    Player.Location = new Point(PlayerX = 350, PlayerY = 0);
                    MessageBox.Show("You lose!");
                    if (Player.Location.X > 650)
                    {
                        Player.Location = new Point(PlayerX -= 20, PlayerY += 0);
    
                    }
    
                    if (Player.Location.X < 0)
                    {
                        Player.Location = new Point(PlayerX += 20, PlayerY += 0);
    
                    }
    
                    if (Player.Location.Y > 590)
                    {
                        Player.Location = new Point(PlayerX += 0, PlayerY -= 20);
    
                    }
    
                    if (Player.Location.Y < 1)
                    {
                        Player.Location = new Point(PlayerX += 0, PlayerY += 20);
    
                    }
                }
            }
           
    
        }
    }
    
    
    
    

    PS: is there any other way i can get the MessageBox to stop spamming when hit goal? except putting out that you go back to start afterwards?


    I gave your code a go, and it seemed to work (almost) out of the box for me.

    I'm sorry for the broken code and the issue you're having, My only suggestion is perhaps modifying the switch statement from e.KeyPress to e.KeyCode

    Both worked for me.

    Also, Be aware this tutorial is very old so you may want to set yourself a challenge to write it in a much better, simpler way.
  4. In Topic: C#: Basic Box Game

    Posted 19 Aug 2012

    I'd like to issue an apology for my lack of support and activity for this tutorial. I wrote this tutorial as I was still new so there are issues with it.

    In terms of the lack of support I have had some real life issues so I needed to keep stress to a minimum.

    I am truely sorry, but I am glad some of you have been able to learn from what is essentially a broken tutorial. It appears to give guidance on the code structure and leaves it to you to do what programming is all about, problem solving.

    I will do my best to help in the future and look forward to becoming more active on here.

My Information

Member Title:
D.I.C Regular
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Interests:
Programming, Writing Tutorials.
Years Programming:
3
Programming Languages:
C#, Java, Python, Haskell

Contact Information

E-mail:
Private

Comments

Page 1 of 1
  1. Photo

    tazrmi Icon

    03 Aug 2013 - 03:15
    Fungle,
    I am having trouble downloading your code for " Silverlight 4: A Simple Video Player". Is there any way you could help me? Thanks.
  2. Photo

    anveshr Icon

    19 Dec 2012 - 11:01
    Is there anyway to contact you. I`m having a great problem with c#..... I need help...I`ve seen your tutorial blogs and they are very interesting.reply me to anveshr @ gmail
    Thank you
  3. Photo

    vai24shinde Icon

    19 Jan 2011 - 20:32
    Hey buddy.. doin a grt job...
Page 1 of 1