boski Posted October 29, 2011 Share Posted October 29, 2011 So I'm trying to place a pixel directly center on my sprite, but unfortunately, even with my superb mathematics knowledge, the pixel is falling well below my sprite. Can someone take a quick look and let me know if I'm missing something? Thanks! include div_mul.asm player0x = 30 : player0y = 30 START player0: %00111100 %00100100 %11000011 %10000001 %10000001 %11000011 %00100100 %00111100 end COLUP0=$0E COLUPF=$0E if joy0up then player0y = player0y-1 if joy0down then player0y = player0y+1 if joy0left then player0x = player0x-1 if joy0right then player0x = player0x+1 a = (player0x/5) b = (player0y/4) if joy0fire then c = c + 1 if !joy0fire then c = 0 if c = 1 then pfpixel a b flip drawscreen goto START Quote Link to comment Share on other sites More sharing options...
jbs30000 Posted October 29, 2011 Share Posted October 29, 2011 Two programs I studied This one uses a missile - u=(missile1y-7)/8 : v=(missile1x-13)/4 This one a sprite - a=(player1x-13)/4 : b=(player1y-1)/8 Try one of those. It may help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.