‫So one thing to be aware of with live coding is that at the moment you can encounter some bugs when
‫using it.
‫So for example, suppose I wanted to add a new new property in to my moving platform.
‫I can go ahead and just copy the INT.
‫I'm just going to have a my int two in here.
‫Now I go ahead and faithfully according to the course use live coding to rebuild and see my new property.
‫And once that's done, go ahead and close the window and I might go ahead and update the moving platforms.
‫Property here might say, oh, I don't want it to be 99 here, I want it to be set to 300 instead.
‫And then I finish up for the day and I close down my editor.
‫However, what you may observe is that when you go ahead and relaunch the project and go to the outline
‫and look again for your moving platform, select it.
‫You'll see that, oh no, that new property has disappeared.
‫So what appears to have happened is that live coding only affected the change in the editor, but it
‫didn't make it permanent on disk.
‫It didn't kind of make it stay there.
‫So what you might be tempted to do is, okay, well, I'll just hit the live coding button again.
‫It's going to go ahead and rebuild and it's going to reintroduce my change, but you'll notice, oops,
‫it's reset it to the default value.
‫So I've lost that data that I had entered in here, which is no good.
‫So if you do find yourself in this situation where you've gone ahead and seem to have lost some data,
‫go ahead and close the editor straight away so that we don't save any of that lost data.
‫And then what you want to do is go over to Visual Studio code and control shift B to bring up the build
‫tasks and start your regular build task here.
‫Make sure it re compiles fully outside of the editor with the editor closed.
‫Then you can go back to your project file and open it up again and we can go and look in the outline
‫for our moving platform and select it.
‫And they go.
‫You can now see that the new property I'd added is not only there but it is also there with the value
‫that we saved it as before.
‫We close the editor for the first time so we've not lost any data this way.
‫Now I find that 90% of the problems with live coding boils down to this issue.
‫So if that's the case, then a restart of the editor and reloading can do the trick.
‫But if you find that frustrating or you seem to be having other issues with live coding, you can revert
‫to the old method of doing stuff which is called hot reloading.
‫You go to the edit menu and go to the editor preferences.
‫You select live coding under the general section and you just disable live coding like.
‫So then you can close the preferences and you'll need to restart the editor to make this change permanent.
‫So once that has been restarted, you can recompile either using the usual recompile button at the bottom,
‫right?
‫So hopefully this lecture will see you through any issues you may encounter compiling with live coding.
‫And I'll see you in the next lecture.