Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --sprite draw on angle
- function spra(angle,n,x,y,w,h,f_x,f_y)
- if w==nil or h==nil then
- w,h=8,8
- else
- w=w*8
- h=h*8
- end
- local diag,w,h=flr(sqrt(w*w+h*h))/2,w/2,h/2
- f_x,f_y=f_x and -1 or 1,f_y and -1 or 1
- local cosa,sina,nx,ny=cos(angle),sin(angle),n%16*8,flr(n/16)*8
- for i=-diag,diag do
- for j=-diag,diag do
- local ox,oy=(cosa*i + sina*j),(cosa*j - sina*i)
- if ox==mid(-w,ox,w) and oy==mid(-h,oy,h) then
- local col=sget(ox+w+nx,oy+h+ny)
- if col!=14 then
- --if(f_x*i+w>5) then col = darken[col]; end --shading and light hack
- pset(x+f_x*i+w,y+f_y*j+h,col)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement