Click here to Skip to main content
15,900,686 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
i am making simple game which has a moving bot in the map and will remain within the boundary of that map the idea is create a map using link list
Posted
Comments
SenAPI 6-Feb-11 11:11am    
It is not STL map class !!!

I actually have some interesting suggestion, but please don't blame if it does not help you to get immediate or better results. From the context of comments I think your game is working with discreet cellular automaton (because you discuss move in 4 direction or 8 and so on).

Here is the idea. There is one popular game you should know: a Game of Life invented by John Horton Conway (http://en.wikipedia.org/wiki/Conway's_Game_of_Life[^]).

The game itself is maybe quite far from yours but 1) it is very popular, so people created a lot of implementations, some of them are very good; 2) in the programming of this game, there is only one real challenge: how to present the game scene in data structures and map them on screen — this is exactly what are you thinking about. Some people devised really clever ways of doing this thing. If you want to research designs of such codes you will certainly find all you want.

How about that?

Good luck.
—SA
 
Share this answer
 
v2
Comments
Espen Harlinn 29-Jan-11 3:45am    
Good answer, once more a 5+
Sergey Alexandrovich Kryukov 30-Jan-11 14:17pm    
Thank you very much. Conway's Game of Life is one of the greatest inventions of all times.
--SA
Espen Harlinn 30-Jan-11 14:19pm    
It's a bit scary too :)
Sergey Alexandrovich Kryukov 30-Jan-11 20:06pm    
Well, life is scary, so Life should be, too.
--SA
That's great! Sounds like you'll have a lot of fun with that game when you're finished!

But did you have a specific question? What exactly are you having problems with?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-Jan-11 12:38pm    
By the way, William, I don't think the question is unclear; and the implementation is possible (if using linked list at all and is it optimal or not being a matter of discussion).
Basically, I agree with you as OP is supposed to come up with the solution, face with some problems (or not) and then... no, not asking questions here just yet, do some research, and if still there are problems, post a question than will be very welcome. Agree?

Datta, that was just a teamwork in order to give you the directions. Will you please go ahead?
Thank you,
--SA
William Winner 28-Jan-11 12:46pm    
Technically, there is no question in his post. That was my point.

But, besides that, yes, I could tell him how to implement a linked list to build a "map" but, like you said, the OP needs to show some effort. Aside from that, we also don't know if he wants to allow 4 directions or 8 for the bot to move..
Datta Bawarae 28-Jan-11 12:50pm    
yes i want to move it in 4 direction
Sergey Alexandrovich Kryukov 28-Jan-11 13:38pm    
Absolutely agree with you.
This is funny: even though I misunderstood "Map", but my statement remains valid.
--SA
Sergey Alexandrovich Kryukov 28-Jan-11 13:49pm    
I think I made interesting suggestion where to consult (see my answer). What do you think?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900