Skip to main content
18 events
when toggle format what by license comment
Dec 9, 2011 at 15:31 comment added Chris Evans Captain America?
Dec 9, 2011 at 15:30 vote accept Chris Evans
Dec 8, 2011 at 5:49 answer added David Gouveia timeline score: 3
Dec 8, 2011 at 1:08 answer added Stephen Tierney timeline score: 0
Dec 7, 2011 at 22:48 comment added Jordaan Mylonas Why is Captain America asking Math questions?
Dec 7, 2011 at 18:11 comment added Chris Evans And to apologise further I am just being lazy. I have just implemented it in my code and it works perfectly. Thanks John + Sam. :)
Dec 7, 2011 at 18:06 comment added Chris Evans Ah, I see what you are saying. Apologies, I misunderstood. As Y increases, the object will go down the screen and if rotation increases the sprite rotates clockwise. :)
Dec 7, 2011 at 18:04 comment added sam hocevar @ChrisEvans: my question is, if Y increases, does the object go up the screen or does it go down? and if rotation increases, does the sprite rotate clockwise or counterclockwise? If you have a coordinate system issue, then the answer to these questions is important.
Dec 7, 2011 at 18:03 comment added Chris Evans Ah of course, I feel a bit silly now! Still not sure about the rotation and XY situation though.
Dec 7, 2011 at 17:59 comment added John McDonald @ChrisEvans, it's just as easy to determine if two circles are intersecting as it is to see if a point resides inside a single circle: if distanceBetween(mouse, object.Centre) < object.Radius then it's inside. Distance between two points is as simple as calculating the Hypotenuse: en.wikipedia.org/wiki/Hypotenuse
Dec 7, 2011 at 17:59 comment added Chris Evans My X and Y central coordinates are calculated like this: "return positionX + (width / 2);" - so no consideration is made for rotation.
Dec 7, 2011 at 17:52 comment added sam hocevar Does your Y coordinate go up or down? And does a positive rotation go clockwise or counterclockwise?
Dec 7, 2011 at 17:52 comment added Chris Evans Hmm, I store centre XY already but thought it wouldn't be true centre due to the rotation? I guess it would be though because the sprite is rotated from the centre. Is it easy to determine mouse click in a circle?
Dec 7, 2011 at 17:49 comment added John McDonald In my top-down game, I do everything with circles. Instead of storing the (Top,Left) of the image, I store the (X,Y) of the centre, a radius for collisions only, and an (X,Y) offset from the centre for drawing.
Dec 7, 2011 at 17:47 comment added Chris Evans Well I considered circles but am I not going to have a problem keeping the circle in the middle of the rotated sprite?
Dec 7, 2011 at 17:41 answer added sam hocevar timeline score: 1
Dec 7, 2011 at 17:37 comment added John McDonald Circles are nice if you are able to freely rotate the sprite. Collisions between two circles is dead simple: if distanceBetween < radius1 + radius2 then colliding
Dec 7, 2011 at 17:20 history asked Chris Evans CC BY-SA 3.0