97 reputation
14
bio website
location
age
visits member for 1 year, 11 months
seen May 6 at 0:36

Jul
23
comment Coordinate and positioning problem on iOS with cocos2d-x
Nah, I've looked through that page before. Problem is, it's deprecated (see the "need to be updated" thing in the title). the setDeviceOrientation() method doesn't even exist in CCDirector anymore... Anyway, this is the topic I created in the forums: cocos2d-x.org/boards/6/topics/31964
Jul
23
comment Coordinate and positioning problem on iOS with cocos2d-x
Still no answer from the cocos2d-x forums... I'll try bumping the topic once and see if anybody can help. I really hope to get this solved, seems to be a pretty big issue.
Jul
18
comment Coordinate and positioning problem on iOS with cocos2d-x
Hey, thanks for the aswer! So, the VisibleRect class got size and origin from CCEGLView (e.g. CCEGLView::sharedOpenGLView()->getVisibleSize() ). I tried switching to getting those values from sharedDirector, but it didn't do much difference. However I did find out that my problem is actually related to the landscape orientation on iOS. Portrait works as it should, but on landscape, width and height are swapped (as well as x and y on touch events). I'll investigate things further and bring this matter to the cocos2d-x forums and I'll report back here when I come to a conclusion.
Mar
24
comment Implementing tile-based movement on 2D platformer
Very nice solution. I've actually asked around about this and I got a different solution from someone at TIGSource. I'll post it as an answer here too, might be helpful too.
Jan
2
comment How to handle collision resolution in a top-down car game?
It's also worth noting that having a physics engine would probably save a lot of hassle from this kind of problem, although I wouldn't have learned half as much, I'd say. So to anyone who might have this kind of problem: weigh your options well :)
Dec
26
comment How to handle collision resolution in a top-down car game?
I do realize there are pretty complete (and complex) solutions, such as this one, but it's a bit of an overkill for my scope, specially considering a short deadline I'm working with. What I'm looking for doesn't need to be realistic, it's can be something simple, as long as it's fun :)
Oct
9
comment How to limit click'n'drag movement to an area?
Great! Thanks, David.
Oct
9
comment How to limit click'n'drag movement to an area?
Wow, very interesting. +1 too :D
Oct
8
comment How to limit click'n'drag movement to an area?
Great solution! I've come across something that involved two circles and a triangle, but your solutiong elegantly simplifies that. About the angle validation, I had thought of something along the lines of having a normalized vector that stood at maxAngle (and another at -maxAngle) from playerForward, which could be multiplied by the length of C->M in case it was of bounds, angle-wise. I'm assuming your solution of rotating M around C would be less costly, is that right?
Oct
8
comment How to limit click'n'drag movement to an area?
Really? I figured an algorhithmic solution or even pseudocode would help. I'll edit the question anyway, just in case.
Oct
8
comment How to limit click'n'drag movement to an area?
Arent waypoints related to pathfinding and such? Also, mathematically defining the gray area is one of my problems :P I think I could figure out something like a rectangle or even a circle, but that kind of shape, with two arcs for sides and two other sides on an angle... It's a bit over my head.
Oct
5
comment How to implement curved movement while tracking the appropriate angle?
Thanks, Arthur, that cleared things up. Although I've figured I'll implement the desired speed a bit differently. Since I'll need all the points in the curve to draw the line anyway (the line will indicate the path the car will follow once you end your turn), I'll just build a class to represent the curve and store all the necessary points. Whenever the distance between two points isn't long enough, I'll just get the next one until it's enough.
Oct
4
comment How to implement curved movement while tracking the appropriate angle?
Thanks, I actually had come across that question, but I hadn't tried to implement it yet, since I figure I'd need a few lessons in Khan Academy first, to be able to do it :P @Arthur's solution seems a lot simpler though, so I'm thinking about giving it a shot instead.
Oct
4
comment How to implement curved movement while tracking the appropriate angle?
Thanks for the answer, Arthur! In your Bezier function, is continue the control point? It's a bit different from what I'm currently doing, which is (1 - t)² * p0 + 2 * (1 - t) * t * p1 + t² * p2, p1 being the control point. Also, I was aware of the problem of uniform movement in the curve, and I your solution seems very interesting, But how can I know it was too close for a whole step? Do I need to get the length of Q(currentVal) - Q(currentVal+stepSize)?