The LaserWar Game Author Hongliang Zhang Lambton College
The Laser-War Game Author: Hongliang Zhang Lambton College 2014. 11
JAVA GAME • Consists of two parts, Server and Client • Server jar file: JGame. Server. jar • Client files: JGame. Client. jar and a folder resources contains pictures and sound files for the game.
How To Run The Game • Server java –jar JGame. Server. jar Default port: 8998 To set another port, for example, 8000 java –Dport=8000 –jar JGAme. Server. jar
How To Run The Game • Client Unzip the file game. Client. zip to get JGame. Client. jar and the folder resources java –jar JGame. Client. jar Default connection to IDEVUSR 011. FRANKENI. COM: 8998 An IBM i. Server with the server program already running on it
How To Run The Game To set another host and port, for example, 122: 8000 java –Dhost=122. 122 –Dport=8000 – jar JGame. Client. jar
Game Introduction • One game played by two players Each player control one spaceship to attack the other. • The Server can supports may games at the same time. • They are based on netty. io
Game Introduction • One space ship has 30 energy. If got shot by the other, it would lose one. If reached zero, it would lose the game. • Speed Default speed is 3. Pressing up-key to accelerate. Pressing down-key to slow down. Limit: -9 To +9
keybroad • Up key: Accelerate • Down key: Slow down • Left key: Turn left • Right key: Turn right • Space key: Laser attack A gaming keyboard like Logitech G 11 to support 3 -key input.
Game Start ! • Two players play the same game. The first player create a new game. The second join it. • java –Dhost=xxx. xxx –Dport=xxxx – jar JGame. Client. jar
First Player Screen
First Player Screen
The First Player Screen • The window title Laser-War Game ID: 1014 • When the second player join the same game, he must choose the game id 1014. • The spaceship could not move until the second player come in. But it could be turned and shooting.
The Second Player Screen
The Second Player Screen • Select the game id 1014 that was created by the first player.
Gaming • Both players are in the game now! The first player can move his spaceship! Sounds Effect!
Enjoy It
Thanks!
- Slides: 17