Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   Check my Game code in assembly (http://www.go4expert.com/forums/check-game-code-assembly-t28335/)

Lana1 6May2012 23:11

Check my Game code in assembly
 
Create a Game in assembly language That has an object that shoots at stars and moves horizantally using the mouse and shoots with left click.

What i have done till now:
org 100h

position db 23
my_position db 0
bullet db 12

MOV BX , 0B800H

MOV DS ,BX

MOV CX , 9


top: ADD SI , 16

MOV [SI] , "*"

loop top



myloop:
mov bullet,12
mov position,23



mov ch, 32
mov ah, 1
int 10h

mov ax,3
int 33h


mov ah,2
mov dh,24
shr cl,1
mov dl,cl
mov bh,0
int 10h


mov ah,0Ah
mov al,'!'
mov bh,0
mov cx,1
int 10h

mov ah,0Ah
mov al,' '
mov bh,0
mov cx,1
int 10h

mov ax, 3
int 33h
cmp bx,1
je click
jmp myloop

click:
mov my_position, cl
shr my_position,1
click2:
dec position
mov ah,2
mov dh,position
mov ah,2

mov dl,my_position
mov bh,0
int 10h

mov ah,0Ah
mov al,'*'
mov bh,0
mov cx,1
int 10h

mov ah,0Ah
mov al,' '
mov bh,0
mov cx,1
int 10h


add position , -1
add bullet , -1
jnz click2

jmp myloop
ret


But this code is a little slow and I can't seem to make a loop that makes a star disappear when it gets shooted. I would be grateful if someone helps me to fix this problem

Lana1 6May2012 23:12

Re: Check my Game code in assembly
 
I am using Emu8086


All times are GMT +5.5. The time now is 15:13.