Skip to main content
pengume's user avatar
pengume's user avatar
pengume's user avatar
pengume
  • Member for 13 years, 9 months
  • Last seen more than 13 years ago
awarded
awarded
awarded
awarded
awarded
revised
per pixel based collision detection
added 689 characters in body
Loading…
comment
per pixel based collision detection
Hey Roger thanks for your answer. Do you have any examples or anything I could take a look at. I am getting stuck at the point where I evaluate the intersecting points to check for a collision of non alpha values. I'll edit my post with some code h=that I have now. Thanks!
comment
per pixel based collision detection
yeah thinking about it more and more I wouldn't mind per pixel detection but if I can get it to work without the use of it then I'll just implement that way. maybe I'll draw a circle instead of a box for right now and check to see if the enemy hits that. My hero is pretty much circular anyways. Thanks for your answer.
comment
per pixel based collision detection
Also really I am just confused on how to check if it is a pixel by pixel collision rather than bounding boxes. Like if you get the non alpha pixels of the enemy and hero but how do you check if those overlap as well.
comment
per pixel based collision detection
Thanks Jari, I wanted to implement some per pixel collision into my game for when the enemy hits the hero sprite because right now the bitmap has some transparent points in front of the hero. I was just hoping someone could explain the steps involved for achieving this. I am already checking if bounding boxes are intersecting and then was going to implement per pixel collision.
asked
Loading…
awarded
comment
Knockback enemy based off of direction sprite is facing
Hey Roger, thanks for your answer, Ialmost go this to work fo rme by using this code <pre>setenemyPositionY(getenemyPositionY() + Math.sin(getRotation() * (Math.PI / 180))); setenemyPositionX(getenemyPositionX() + Math.cos(getRotation() * (Math.PI / 180))); </pre> Is this what you were talking about? This seems to work however alwasy launches the enemy to my right. Ill keep working on it though. Thanks for your help.
Loading…
comment
Rotation of bitmap using a frame by frame animation
Hey Thanks. That confirms what I was trying today. I started to offset the rotation by an increment based on what frame the animation is on as well as finding the center for that frame by the frames width and height divided by two. Still didn't get it quite right though. I did notice some fuzzy and jagged edges being created when rotating as well. I'll take your advice it is much appreciated and exactly what I was looking for.
awarded
Loading…
awarded