There's no better way to learn than by rolling up your shirt sleeves and actually doing it. Playground scripts are working examples that let you experiment using a premade framework.
This is the support site for the book, The Gamer's Guide to Coding, written by Gordon McComb, and published by Sterling Publishing.
With The Gamer's Guide to Coding, you'll discover how to create, test, and play colorful and fun 2D computer games—all with the aim of learning vital computer programming skills while doing it. The games in The Gamer's Guide to Coding use only simple bitmap graphics so you can easily change and update them. Make any game your own unique creation.