Fermé

Distributed computing using sockets and threads SPACE DUEL

Write an ASCII graphics game for two computers using the techniques from Lab 5 and Lab 6 where each player controls a space ship. You always see your own space ship at the bottom of the screen, while your enemy's space ship is at the top of the screen, for example:

+------------------------------------------------------------------------------+

| +-H-+ |

| V |

| |

| |

| |

| |

| |

| |

| |

| |

| |

| A |

| |

| |

| |

| V |

| |

| |

| |

| |

| |

| |

| A |

| +-H++ |

+------------------------------------------------------------------------------+

Here we see your space ship at the bottom shooting missiles “A” while your enemy, controlled from the other PC, shoots “V”. The missiles proceed across the screen until they hit the other side or another missile coming the opposite direction. (If two missiles hit each other, both are eliminated.)

You move your ship with the left and right arrow keys, and shoot with the up arrow key. Your program must communicate with the program running on the other computer in order to update the screen with the current ship and missile positions. You should be able to keep shooting more missiles even while earlier missiles are still flying on the screen.

The game ends when a missile hits a ship. The game should then announce whether you won or your opponent won.

Hint: to figure out what the arrow keys generate in getch, write a little test program that calls getch and prints out what the return value is.

Compétences : Programmation C

Voir plus : programming techniques, programming computer game, little test, computing programming, computer programming game, computer game programming, bottom programming, using joomla update site, using plesk update

Concernant l'employeur :
( 5 commentaires ) sungai petani, Malaysia

N° du projet : #8501240

1 freelance a fait une offre moyenne de 333 RM pour ce travail

emailandi

Bis jetzt wurde noch kein Vorschlag eingegeben

333 RM MYR en 3 jours
(0 Commentaires)
0.0