News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Xmas fireworks

Started by Mikl__, January 03, 2025, 10:26:13 PM

Previous topic - Next topic

daydreamer

#15
Fixed point fireworks?
X dd screenwidth /2
Y dd screenheight
Height dd screenheight - centre
Xdelta dd
Ydelta dd
Xacc dd
Yacc dd 9.81
Init proc
Mov xdelta, rnd
Mov Xacc,rnd
Paint proc
Mov eax,x
Sal eax,16
Mov ebx,y
Sal ebx,16
Drawiconex fire icon,eax,ebx,xsize,ysize

Fireworks proc
Mov ecx,height
.If ecx ==0 call spawn ret
Mov eax,x
Mov ebx,y
Mov edx, xdelta
Mov edi,ydelta
Add eax,edx
Add ebx,edi
Add edx,Xacc
Add edi,Yacc
Mov x,eax
Mov y,ebx
Mov xdelta, edx
Mov ydelta, edi
Dec height ; countdown to when explode / spawn
.if height == 0 call spawn ret

Ret
Fireworks enpd


my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

64 bit Fixed point fireworks
Code
X dq screenwidth /2
Y dq screenheight
Height dq screenheight - centre
Xdelta dq
Ydelta dq
Xacc dq
Yacc dq 9.81
Init proc
Mov xdelta, rnd
Mov Xacc,rnd
Paint proc
Mov rax,x
Sal rax,32
Mov rbx,y
Sal rbx,32
Drawiconex fire icon,rax,rbx,xsize,ysize

Fireworks proc
Mov ecx,height
.If ecx ==0 call spawn ret
Mov rax,x
Mov rbx,y
Mov rdx, xdelta
Mov rdi,ydelta
Adq rax,rdx
Adq rbx,rdi
Adq rdx,Xacc
Adq rdi,Yacc
Mov x,rax
Mov y,rbx
Mov xdelta, rdx
Mov ydelta, rdi
Dec height ; countdown to when explode / spawn
.if height == 0 call spawn ret

Ret
Fireworks enpd
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding