• Content count

  • Joined

  • Last visited

Community Reputation

607 Good

About phirekid718

  • Rank
  1. watercyfle

    edit: i had my laugh now let me try to help. where exactly are you having problems? what is it that you understand and what don't you understand? do you know what you need to do? do you get the idea? No one is going to do your assignment for you, no matter how many times you say please. But if you have any questions then this is the right place.
  2. Could someone explain this?

    I like to say char * a_pointer; You can also declare it as int main(int argc char **argv);
  3. An Open Letter to Young Programmers

    The reason programmers do not maintain a code base is because they have to follow deadlines. They would do anything to just get their concept onto the screen because the deadline is the only future they are concerned about.
  4. Vitrual touchscreen joystick

    Are there any 2d games on touch screen devices with a good joystick (or dpad) implementation? I haven't found a good reference for this, so I have researching physical joysticks and what this comes down to is called a "restrictor gate". (see link under "8-way")   Now I want to test the same concept, except within an octagon. So to clamp a point within a rectangle: if(point.x < throwRect.getMinX())         point.x = throwRect.getMinX();     if(point.x > throwRect.getMaxX())         point.x = throwRect.getMaxX();     if(point.y < throwRect.getMinY())         point.y = throwRect.getMinY();     if(point.y > throwRect.getMaxY())         point.y = throwRect.getMaxY();   To clamp a point within a circle: if(distance > throwDistance)     {         point.x = stickCenter.x + cos(angle) * throwDistance;         point.y = stickCenter.y + sin(angle) * throwDistance;         }   How can I clamp a point within an octagon? Thank you
  5. Implementing beams for space shooter

    Thanks a trillion. I implemented the beam as a long animated texture that gets "cropped" based on a ray cast. If the ray cast intersects with a fixture then it renders a explosion sprite on top of it. The green projectiles are simply bullets shot at a fast speed as said earlier. However, the orbs (the white things that shoot the green projectiles) get their position from the player's position some x frames before.   Some pseudocode: const int delay = 10; //orbPosition is playerPosition at ten frames before player's currentPosition VectorClass pastPositions [delay]; //update index once per frame int index = 0; orbPosition = pastPositions[index] + offset; pastPositions[index] = currentPlayerPosition;
  6. Vitrual touchscreen joystick

    Thanks. I was going to leave it as is. I just wanted to see if there was some programming trick that could be used.
  7. Vitrual touchscreen joystick

    Thanks. It was the clamping that troubled me. Is there a way to do it without calculating square roots? I have read that it was expensive. But so far this works fine.
  8. I am trying to implement a joystick in cocos2d-x. The idea is to allow the user to slide a circle within a larger circle so the direction of the slide controls the direction the character moves. If there is a better way to do this please let me know but so far my code looks something like this:   if(joystick.x < xMin)          joystick.x = xMin;      if(joystick.x > xMax)          joystick.x = xMax;      if(joystick.x < yMin)          joystick.x = yMin;      if(joystick.x > yMax)         joystick.x = yMax;   The joystick in this code represents a circular sprite that the user can slide around to control the character. But as you can see, the code confines the sprite so that it stays within a box formed by the sides xMin,xMax,yMin and yMax. I don't want that. I want to confine the sprite within a larger circle. How can I do this? Please and thank you.
  9. Implementing beams for space shooter

    Is that both of them (blue and green)? I can't see the individual sprites in the blue beam. And what is the logic behind the sprites in the green beam? Does each sprite follow the one preceding it? And how is it that both beams keep their stream-like fashion no matter how the player moves? Thanks again.
  10. -first ten seconds   What is the idea behind both kinds of beams on the player? Two approaches come to mind. The first one seems like a long, animated sprite that is drawn on top of a ray cast and cropped off at the first collision. The side beams look like a chain of small images where the each link moves slightly slower than the one behind it. I am not sure though so any insight will be very much appreciated. Please and thank you.
  11. Textbook code memory leak

    Thank you. I thought it was just me. It's been nearly a month and the only way I could figure to get this working was to go with the ToyMaker's implementation of mesh animating. Although it uses software skinning, It works. Has anyone ever taken so long on one task? Why or why not? Things like this make it seem like I don't have what It takes to make games. Again, thanks.
  12. No debug output in vs2010 after app close

    I ended up choosing to scrap xact and go with directsound as presented in the Toymaker's website. I may regret changing to this platform but for now it does exactly what I need it to do and the debug output displays as expected. I wish I didn't have to go through the process of changing the whole sound engine, but I can't see any other way, especially when the examples in the directx sdk such as "xactgame" have the same problem: loading up debug output at the start but not after the app closes. I guess I could have disabled the sound and continue building, but that would have been cheating for me. I feel that this problem is an indication of a much greater problem, but I don't know what. Any feedback would be appreciated.
  13. No debug output in vs2010 after app close

    I found that it has something to do with the XACT code that I am using from the directx sdk tutorials. I can't figure it out yet. It seems that the threads in the sound engine get in the way of the debug output from the other threads, if that makes sense.
  14. Textbook code memory leak

    I don't understand how someone gets away with publishing code that has memory leaks, leaving me to find them. I emailed the author, and I don't think I'm going to get a response. I tried switching to the code found below, which is similar, and doesn't have any leaks. But the problem is that I am having trouble making it so that my character can hold something in his hand. With the textbook code, the application shows the character holding (a sword in this case) and moving it around just fine, but I can't find the memory leak after all this time. With the code in the article implemented the character can still make the motions, but the sword is not there. If anyone has some insight please help. Maybe there's another resource on this subject? Thanks.
  15. Textbook code memory leak

    Thanks for your help. I tried it but unfortunately that,s not the issue. If I do not load the mesh using the hierarchy (last line in the same init method) then there are no leaks.   This is the output when the mesh is loaded (From the directx debug runtime). Direct3D9: :====> ENTER: DLLMAIN(6023d9a0): Process Detach 00001b20, tid=00001f54 Direct3D9: (INFO) :MemFini! Direct3D9: (ERROR) :Memory still allocated!  Alloc count = 143 ... Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 2388080 bytes   It also shows resources that are not destroyed when running pix. So there is definitely a sneaky leak somewhere, again most likely in the bonealloc class.