6,265 reputation
11741
bio website
location Tehran, Iran
age 23
visits member for 3 years, 6 months
seen 4 hours ago


Oct
26
comment How to determine the distance between a point and a rotated rectangle
also it doesn't need to be rotated around the center, and point in plane will do, as long as you rotate everything (including rectangle itself)
Oct
26
comment How to determine the distance between a point and a rotated rectangle
There is a minor problem with your code, consider this case: the point is exactly at (cx,cy). In this case, dx will become "width/2" and dy will become "height/2". Instead of computing squared distance, you should fix this by some conditions.
Oct
6
comment Moving CCNode with constant speed in cocos2d
what about adding CCMoveBy action? wrapped inside CCRepeatForever?
Sep
19
comment A Star pathfinding algorithm, multiple node set optimization
even if you use all those coordinates as A* nodes there won't be a noticeable performance cost... 135*185 < 150*200 = 30000 ~ 0.002s computation time. Compare that to 0.0167s that you have to render each frame. Also note that Usually it won't even take 0.1ms, I've computed the worst case time.
Aug
15
comment OpenGL Textures have distorted colors on some android devices
I'm not sure, but you might be using some kind of pixel representation that is not supported on those devices.
Aug
12
comment cocos2d-x “immediate mode”?
a) if you are going to use v3.x you should use custom command, either with draw or visit. and personally I prefer draw method since it almost needs no boilerplate code to make compatible with other stuff. b) porting to other systems is the biggest advantage. Also there are lots of other stuff that might help you in way (like textures, audio, debug helpers, ...) but you might take a look at SDL2 too (that's what I've migrated to for just one of my projects which required to run without GUI in some cases). c) As far as I know, there is absolutely no advantage of using scene graph in your case.
Aug
3
comment GLSL Processed Image to OpenGL
it would have been nice, if you threw a link to frame-buffer too.
Jul
31
comment Is this possible in cocos2dx 3.0?
@Dhruv-user3531484 you can always google stuff, and you can use the engine documentation. I mean you should have gotten a compile error for that code...
Jul
17
comment Creating a seamlessly looping 2D multiplayer level?
can't you always align camera position with the player being controlled?
Jul
14
comment Estimated framerate for custom engine?
does it really matter? I mean as long as you are above 60fps, continue development, and as soon as you got under it, start optimizing.
Jun
17
comment Dynamic navigation mesh changes
since my answer was not relevant, I've deleted it, to not receive the bounty
Jun
8
comment How can I mark a pixel in the stencil buffer?
take a look at stencil chapter in open.gl it's obviously opengl tutorial, but principles are the same
May
16
comment Ideas for 2D Water Simulation
@ashes999 I've got no screenshot, but here the same algorithm implemented! youtube.com/watch?v=avJPrL9UJ28
Apr
29
comment Endless 2d runner with increasing speed, how to adjust jump behavior?
you can scale the time to go faster instead of increasing the speed of background moving.
Apr
24
comment Mixing interpolation with extrapolation in multiplayer game
about fixed time step, take a look at gafferongames.com/game-physics/fix-your-timestep or gamedev.stackexchange.com/questions/1589/…. I'm not sure if I could explain better, but if you still had problems understanding them, I'll be more than glad to help you out.
Mar
13
comment Connecting Circular Rooms
well, it does guarantee the shortest path. And even if I'm making any mistake (that I really doubt), the paths generated will be near optimal.
Feb
7
comment How to make a game without OOP?
@Zhafur yep, just made a mistake :|
Feb
7
comment How to make a game without OOP?
@Philipp for one, as you asked, most of those kinda games were developed in an era when OOP languages were not introduced (or at least were not common). and second there are some people who think exactly opposite of your. for example see why linux is developed in C instead of C++.
Jan
30
comment How to apply logarithmic type formula for speed?
what library is this code using?
Jan
30
comment Colour intersection of two alpha-blended sprites
@Arne can you tell which combination of blend functions will result in that behavior?