Archived

This topic is now archived and is closed to further replies.

noob2asm

Writing a breakout game in assembly

Recommended Posts

hey there, I wanted to write a simple breakout game in assembly ( 16 bit ) straight to video mode. Dont want to use interrupts to output anything to the screen. But the documentation in the book is almost next to nothing. Do you have anyt suggestions as to how to go about it or where i can get source code. So far i have coded this
.model small

.586

.stack 100h

.nolist

    ;*************************************************

    ;Includes

    ;*************************************************

    include bios.inc

    include constants.inc

.list

.data



.code



    main proc

        .startup

            @Cls

            @Setcsrpos,0,0



                        mov ax,0B800h

                        mov es,ax

                        mov cx,2

                        mov ax, 0Fdbh

                       Loop1:

                        mov bx,cx

                        ;mov ax,002Dh

                        mov es:[bx],ax

                        add cx,2

                        cmp cx,78

                        jng Loop1



            ;initialize everything

        ;@@:

            ;get user input



            ;update paddle



            ;update ball



            ;draw the screen



            ;check if all bricks are gone, if so then quit

            ;jmp @b

        ;done:



           ; @Cls

           ; @Setcsrpos,0,0

        .exit

    main endp



end

 
constants
VIDSEG equ 0B800h            ;video segment address
VIDCOL equ 80                ;video columns
VIDROW equ 25                ;video rows
STARTBRICKY equ 9            ;start row of bricks
STARTBRICKX equ 1            ;start column of bricks
ENDBRICKY equ 10            ;end row of bricks
ENDBRICKX equ 78            ;end column of bricks
CR equ 0Dh                ;define CR as carriage return
LF equ 0Ah                ;define LF as line feed
FALSE equ 0                ;define FALSE to value 0
TRUE equ 1                ;define TRUE to value 1
STARTX equ 0                ;start column for ball
STARTY equ 21                ;start row for balll
STARTVELY equ 1                ;x velocity of ball
STARTVELX equ 1                ;y velocity of ball
PADDLELEN equ 5                ;length of paddlebar
PADDLEX equ 0                ;start x position of paddle
PADDLEY equ 23                ;start y position of paddle
 

Share this post


Link to post
Share on other sites
You can see if this ASM article series has anything for ya. I think there was another one that actually did make a breakout game, but you''ll have to search further for it. It may just be this one I''m thinking about, can''t remember for sure.

_________________________________________________________________

Drew Sikora
President, Lead Programmer - Blade Edge Software
Staff Writer, Newsletter Editor - GameDev.net
Community Relations - Game Institute

Share this post


Link to post
Share on other sites
In addition, here''s the source to a little Loderunner-ish game that I wrote in 80x86 assembly language. It might be of some use; it''s commented and mostly neatly written. It was written using nasm and real-mode, and runs in 320x200x256.

cheers
sam

Share this post


Link to post
Share on other sites
thanks for your help. Will post code once i get more done or hopefully get it all done. Once again thanks

quote:
I think there was another one that actually did make a breakout game, but you'll have to search further for it. It may just be this one I'm thinking about, can't remember for sure.



and about searching for it, is it on that site the article that you are talking about ?

[edited by - noob2asm on April 4, 2004 11:29:51 AM]

Share this post


Link to post
Share on other sites