Getting ready
To better understand this chapter, you should have followed all of the other chapters, since we are going to implement our scripts here on top of the ones we have previously created throughout the book.
For simplicity, for those readers who only did the first implementation in the previous chapter, I have kept the code of the first implementation. However, for those who did the second implementation, you shouldn't have a problem doing the same modifications to the code. In any case, it's recommended that you have the second implementation of the code in the game, because the next chapter will give us some ways to exploit its potential in the context of a larger game.