Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Recipe For Pong Across a network!.

Similar presentations


Presentation on theme: "A Recipe For Pong Across a network!."— Presentation transcript:

1 A Recipe For Pong Across a network!

2 From the Share menu on one machine (this will be the server) click Host Mesh: BYOB will then report the IP address of that machine. From the Share menu on the other machine (this will be the client) click Join Mesh and enter the other machine’s IP address.

3 The Sprites

4 Creating Sprites On the server create a Ball & LeftBat, then right click each sprite and click Share sprite. The client creates RightBat and shares. The server creates four walls, called LeftWall, RightWall, TopWall, and BottomWall.

5 Controlling The Bats On the server, LeftBat has two scripts responding up/down key by moving up/down and broadcasting a LeftUp/LeftDown message across the mesh. RightBat responds to RightUp/RightDown messages by moving up/down.

6 Client Bat Scripts On the client the roles are reversed:
LeftBat will respond to broadcast messages RightBat to key presses

7 Server Ball Scripts The ball resets the game (scores, positions etc) when the green flag is clicked, then starts a game by broadcasting the PlayGame message. The ball moves regularly, bouncing off bats, top and bottom walls, and updates the score before restarting the game on bouncing off a left/right wall.

8 Client Ball Scripts On the client the ball is controlled by two simple scripts:


Download ppt "A Recipe For Pong Across a network!."

Similar presentations


Ads by Google