| bio | website | |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 5 months |
| seen | 17 hours ago | |
| stats | profile views | 0 |
|
Jan 15 |
comment |
Repeatedly Shooting Bullets Each instance of your bullet class has the same bounding box, something like 40px wide by 20 pixels high. You use the position of the bullet AND the bounding box to determine where the bounding box is in the world. Then it is a simple rectangle bounds check. Rectangle worldBound = new Rectangle(bullet.X + bullet.Bound.X, bullet.Y + bullet.Bound.Y, bullet.Bound.W, bullet.Bound.H); Thats assuming rectangles have a width/height constructor, otherwise you need to calculate the x2, y2 positions the same way I got the x1 and y1 positions. |
|
Jan 14 |
awarded | Teacher |
|
Jan 14 |
answered | Repeatedly Shooting Bullets |