Reference no: EM133105290
Assignment: Using assembly to implement a game
For this exercise you will use your basic assembler programming skills to develop a complete and useful program: a game. For the purpose of this assignment, a game is an interactive computer application in which at least one user (player) influences the outcome via keyboard or mouse input. You are free to choose any game, except for simple text-based games such as "Guess a number"
or Trivia. The game you choose does not have to be overly complex either; we suggest implement- ing a (single-player) Pong game, where the player controls a paddle and tries to prevent the ball from crossing the player's goal line, or something of comparable difficulty. Before you start pro- gramming, we encourage you to ask a lab assistant whether they think your idea is reasonable and sufficient.
Your task is to implement a game, subject to the following requirements:
Requirements
1. Your implementation should implement correctly the rules of the game.
2. Your implementation should display the state of the game. If the rules of the game make it possible, your implementation should display the current progress of the player toward achieving the goal of the game.
3. Your implementation should permanently record the top scores, if the rules of the game allow it. Your implementation should also have an option to display them. A bootable game only needs to store top scores until the next reboot (i.e. they do not need to be written to disk).
4. Your implementation should be able to receive input from at least one player. The input has to come either from the keyboard or from the mouse.
Notes and Hints about solving this assignment
Important: For this extra assignment you should NOT expect content-related help from the lab assistants, that is, you should not expect the lab assistants to debug your code or even to suggest how you should solve the assignment. Instead, this assignment allows you to demonstrate your ability to go beyond the manual (and lab assistant).
Hint #1: Although we are sure you know how to use a search engine and understand the keywords you need to search for this assignment, we would like to give you a hint for writing games in assembly. For the past 15 years, the demo scene and several generations of students around the world have learned much from Denthor's Asphyxia Tutorials.
Hint #2: Bootable game Another option is to make your game bootable, so that it can run without any operating system. This means that you will have access to the graphical (VGA) memory directly, implement interrupt handlers to work with timing and input, and basically be able to (but also have to) do everything yourself. There are no standard libraries either. (So no printf, no exit, no nothing.) These advantages may also be disadvantages.
You do not need to start from scratch in implementing a bootable game. You can use a simple library that we made and that will set up most of the basic things for you. This library switches the processor to 32 bit mode, makes sure you have a stack, and lets you set interrupt handlers. After that, you are basically on your own. Again, many advantages, but these can turn easily into disadvantages.
The "bootlib" library can be found online. It contains a README (which you should read), and an example which you should try. We recommend you work on some Linux distribution, as it is not quite easy to get the compiler/linker working right on Windows or Mac.