-
September 22nd, 2010, 05:02 AM
#1
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
-
September 22nd, 2010, 04:39 PM
#2
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,
-
September 24th, 2010, 10:52 AM
#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?
-
September 25th, 2010, 02:49 PM
#4
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.
-
September 27th, 2010, 03:40 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|