-
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
-
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,
-
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?
-
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.
-
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.