ShinigamiMachine said:
I want to add an entirely new sprite with 4 frames of animation.
wish granted
offset NPC016
#define
gravitylevel = 800
left_offset_graphic = 20
up_offset_graphic = 0
frames_between_sprite_change = 2
max_sprites = 4
sprite_height = 10
sprite_width = 10
#enddefine
push ebp
mov ebp,esp
sub esp,10
mov dword [ebp-10],0
mov dword [ebp-c],0
mov dword [ebp-8],0
mov dword [ebp-4],0
setpointer
cmp npc.frametimer, frames_between_sprite_change
jl :add_frame_timer
mov npc.frametimer, 0
inc npc.framenum
cmp npc.framenum, max_sprites
jl :render
mov npc.framenum, 0
jmp :render
:add_frame_timer
inc npc.frametimer
:render
mov npc.displayU, up_offset_graphic
mov eax, npc.displayU
add eax, sprite_height
mov npc.displayD, eax
mov eax, npc.framenum
mov edx, 10
imul eax,edx
add eax, left_offset_graphic
mov npc.displayL, eax
add eax, sprite_width
mov npc.displayR, eax
;gravity
add npc.Y, gravitylevel
:end_of_code
mov esp, ebp
pop ebp
retn
fumble around with the defines to your liking
Run this through the
douktsu assembler (on the tribute site forums) and download
noxid's defines list and put it in the same folder of the assembler.
You're welcome