I'm making a game and i was thinking about what happens when someone dies and i want to make it so they go back to a certain point like the last shop or w/e. My question is as thus: How do you write it so that the code will take you "back" to another point in your program? or is there even a way to do so. BTW i'm doing this in C++ on visual studio.
No, don't EVER use the goto keyword when you are trying to do something like this, it's not needed and will simply make your code harder to understand/maintain.
In order to solve the issue of whether or not to use "goto" (I know it's shun upon but it is really useful in some cases) could you post the code your having trouble with?
I'm making a game and while i would love to post the game it's rather long, but in summery it's a mass of functions that simulate battles and towns and other various activities, mostly i would like to know if theres a way to make it skip back to a particular function? say the last town or w/e, thanks in advance for any advice and links that would help.
i don't see how it's a bad sign of design, since i know of no other way of making checkpoints in a game, because if you die i don't want to just end it. but anyway how do make a checkpoint that once you past it if you "die" it sends you back to the last "checkpoint"?
That's exactly where the bad design is. You're coding the game itself in C++. Games like, say, text adventures, are written in a special purpose language specifically designed for that game. The program that implements the language is known as the engine. For games past a certain complexity (for example, games that save state), a game engine is a must.
Suggestion: Make a prototype with Mark Overmar's Game Maker 7.0, then once you've implemented a checkpoint feature with that game engine, find a way to 'convert' it to C++.