stoneskin

learning coding with Scratch , Python and Java

10.11 Two Players Game

1 DotWar Game Starter

This is a example of game that let two players share same keyboard to play together. We could use WSAD and space for one player and Arrow key and one key nearby for another player https://scratch.mit.edu/projects/147879455/

dotwar

2 Basic control of player

Below is the code example of blue player, it has moving and direction control and received event for change life and play sound player1

3 Bullet code

Below code os of bullet, it only could have one bullet in screen. it use clone and will delete it self after 50 moves.

bullet

4 Game Over

Build two customer in gameover sprite, and show who is win.

gameover

gameover

5 what’s more kind of two player games

6 one play play two play game