-
This Project is a simple implementation of the classic Pong game.
-
It is designe to help you learn and practice several key concepts in low-level programming and graphics.
-
This code was inspired by Programming Dimensions's tutorials.
-
Graphic Modes: Setting video modes for graphical output.
-
Drawing Objects: Drawing pixels and shapes on the screen using assmebly language.
-
Managing Time: Using system time for game loops and event timing.
-
Collision detection: Implementing bounding boxes for collision detection between game objects.
-
Displaying text: Outputting text on the screen.
-
ASCII Conversion: Converting numerical values to ASCII characters for display.
-
Detecting key presses: Implementing keyboard input handling for player controls.
-
Install DOSBox
-
Install an 8086 Assembler
-
Install Notepad++
-
Open DOSBox.
-
Mount the directory containing you project files
mount c path_to_your_project_directory- Change the mounted directory
C:- Assemble the source code using the assembler
masm Prog.asm - Link the Object file to create an executable
link Prog- Run the executable
Prog-
Player 1
- Move Up: 'z'
- Move Down: 's'
-
Player 2
- Move Up: 'o'
- Move Down: 'l'
-
Data Segment: Defines all the variables and constants used in the game.
-
Code Segment: Contains all the procedures for game logic, including initializing the game, drawing the screen, moving objects, detecting collisions and handling user input.
-
Axis-Aligned Bounding Box (AABB) collision detection is a fundamental concept in game development, particularly for simple 2D games like Pong.
-
An AABB is a rectangular box aligned with the coordinate axes, and checking for collisions involves determining if a point (representing, for example, a corner of another object) lies within this box.
- To determine if a point
$(P)$ with coordinates$((P_x, P_y))$ is inside an AABB defined by its minimum coordinates$( (B_{\text{minX}}, B_{\text{minY}}) )$ and maximum coordinates$( (B_{\text{maxX}}, B_{\text{maxY}}) )$ , use the following formula: