CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    3

    Drawing a maze in C#

    Hi,

    I want to program an application that simulates robots moving in a maze.
    For the first version of the program it's good enough to show the maze as simple lines and the robots as moving dots.
    When I click on a robot (dot), the route it has driven before should be shown by a colored line.

    I have no experience with drawing in c#. I only used qpainter and openGL (both in Qt/C++) a little.

    In a later version the robots should be displayed as pictures instead of the dots.

    Can you recommend an easy way to accomplish what I want? Do you have some keywords for me?

    Maybe you could also recommend a simple way for programming a 3D-application. If I got time i want to convert the 2D-application to 3D.

    Thanks for reading
    steckl

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Drawing a maze in C#

    Simple and 3d don't really go together, but DirectX is pretty good for that kind of thing. For 2d drawing I would start by using GDI+ and see how far that takes you,

  3. #3
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    3

    Re: Drawing a maze in C#

    Thanks for your answer.

    GDI+ looks straightforward, but is there a way to react on a click on a robot?

  4. #4
    Join Date
    Jan 2010
    Posts
    1,133

    Re: Drawing a maze in C#

    Yes - for a simple game, you can draw your sprites directly on a control such is a Panel or a UserControl, and you can use the controls' click event to detect if a robot has been clicked on. You just need a way to track the bounds of the sprite.

  5. #5
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    3

    Re: Drawing a maze in C#

    Thank you. I decided to use a PictureBox for the robots, so I can use the click-event of the PictureBox.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured