Google's Blockly Games is a series of educational games that teach programming. It is based on the Blockly library. All code is free and open source.
The games are available at https://blockly.games/
The developer's site is at https://github.com/google/blockly-games/wiki
Note: I have simply edited the ducks.js file so that the 3 bot ducks' code can be edited or replaced with user code. This enables PvP battles. I'd love if someone would host this version.