I have been trying to teach myself programming since two years back, and an important part about asking for help is this: Try to be as specific as possible in your questions. You will have better luck getting help if you try to ask specific and technical questions instead of broad and possibly open ended ones. For example, your post contains many questions, most of which aren't precise enough to have any single answer, or not enough context to do so. Therefore answering your post as a whole would be much more difficult than if you had posed a single technical question. In short, try to help the people who want to help you, it's easier for them to answer small questions.
That's just some friendly advice from a someone who asks a lot of questions.
due to something I did way back means i have to amend something new to fix that problem but some of my old functions are using that function, this happens all the time and I completely understand it is my fault for not fully understanding the structure of my game or the program.
Sounds like you may benefit from making an effort to follow the principles of `Separation of Concerns.` That means encapsulating different areas of functionality such that they aren't entangled in other areas. Making the different concerns into strictly defined and separated modules, with a clearly defined API, will make it so that if you need to rewrite, say, the rendering module down the line, then you don't need to go deep into every area of your project changing function calls and so on, because you defined the interface clearly from the start.
Other ideas include:
Trying to plan your program flow more carefully before actually writing any code.
Writing unit tests for every function, and writing your tests before actually writing your functions.
Trying to make your code `purely functional` whenever possible. That means to minimize your use of functions that have side effects such as changing a global value, or functions that have varying return value depending on something else than their input parameters. This takes some getting used to, but you may very well find that your code is much more robust and reusable.
I have a State which has a ImageService, the state has a hero and a level, would I assign them each a image? for example hero.sprite = imageService.images["heroImg"];
Without knowing anything about the rest of the structure of your code, I don't think it's too weird or unusual to have some kind of entity system, that includes some kind of Entity.Sprite or Entity.getSprite() attribute. In any case, for small games, I think that's acceptable because it's pretty straightforward and clear what is going on. But I'm not really sure what you are asking, so forgive me if I'm not making sense.
Second lets say if a level had some blocks, but some blocks are infront of the hero, would I have to write out my render function to say
//Draw level blocks
//Draw hero
//Draw upper level blocks
//Draw menu
//etc...
Well, not explicitly unless there is some other reason to. Maybe you could just assign every sprite a Z value, and render them in order going from least Z to most Z.
But then a really big important part is, the renderwindow is 800 by 600, in most computer games the user is allowed to change the size of the game, so lets say the user wants to display 1280 by 768, where would be the best place to draw the sprites differently? What about collision detection? if the view was 800 by 600 and now it is 1280 by 768 the width has go up by 1.5 and a bit and the height has changed by 168 pixels, would I save a global variable in my state which has the "ratios" of the screen? so 800 by 600 = 1:1 and 1280 by 768 = 1.6:1.28 would I then use that to modify all sprites displaying and also use that to modify collision detection?
I don't understand the first part of that, you may want to clarify what you mean.
As for collision detection, it would be unusual to scale distances in the game world according to window size. More sane is to apply all game logic such as collision detection using your normal measures, and just scale the final image in rendering.