Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

118 Neutral

About invective

  • Rank
    Advanced Member
  1. invective

    XNA - Z axis backwards?

    XNA is by default right handed, which is no doubt confusing since most direct X examples are left handed, although the functions exist in both LH and RH versions. RH coordinates have the Z axis pointing in the opposite direction from LH coordinates (positive Z is out of the screen in RH, and into the screen in LH). Also the winding order of the vertices is CCW instead of clockwise. see the math entry here: You are stuck with it since they took away all of the LH functions. Of course if you have old code, its not that hard to invert the Z axis on the matrices or flip the winding order of the vertices or the cull mode.
  2. When you are up to it, take a look at the source code for Paint .NET:
  3. If you are familiar with interop and the windows api, use FindWindowEx to get the hwnd of the window you want to send the mouse clicks to, then use SendMessage or SendNotifyMessage to send the appropriate mouse message. You might have to experiment as different programs will trap different messages and there are quite a few mouse messages: WM_LBUTTONDBLCLK WM_LBUTTONDOWN WM_LBUTTONUP WM_MBUTTONDBLCLK WM_MBUTTONDOWN WM_MBUTTONUP WM_MOUSEFIRST WM_MOUSELAST WM_MOUSEMOVE WM_MOUSEWHEEL WM_RBUTTONDBLCLK WM_RBUTTONDOWN WM_RBUTTONUP WM_XBUTTONDBLCLK WM_XBUTTONDOWN WM_XBUTTONUP You can find the interop functions and the enums for all the windows messages here: and then its largely a matter of cut and paste.
  4. invective

    [.net] C# Solution to C Unions

    How to: Create a C/C++ Union Using Attributes (C# Programming Guide)
  5. invective

    game characters

    Since you are animating humanoids, look in to using a skinned mesh with bones. Instead of storing the geometry per frame, you store it hierachialy and store the transforms for each sub mesh per frame. Its more memory efficient and you will get smoother motion, provided your meshes lend themselves to this type of animation (as humanoid character meshes do). Direct X has classes to do this for you in the D3DX library. See the skinned mesh example in the SDK. If you are not using direct X take a look at OGRE or one of the other free engines that also support bones for an idea of how to go about it.
  6. I don't think you can do it with format. You can trap ItemDataBound like so or like so. but its probably less trouble to just loop through the table and truncate the strings or copy the truncated strings into a new column and hide the old one. For an exercise in masochism you could try your own format.
  7. You need to track your characters upper left (or whereever your zero based corner is) coordinates in pixels, instead of tile units. The maximum horiztonal tiles your character can span is equal to SPRITE_WIDTH / TILE_WIDTH +1, and the maximum vertical tiles you character spans is equal to SPRITE_HIEGHT / TILE_HIEGHT +1. (actually if the sprite is smaller than the tile, as in a bullet, the minimum number for each dimension is really 2 so if that can be the case then use the more complicated formula: max(SPRITE_WIDTH / TILE_WIDTH, 1) +1). The algorithm to move your character is as follows: 1) save current position 2) move to new position(current_position += velocity_in_pixels) 3) check if the new position is valid a. compute the left tile: tile.right = position.x / TITLE_WIDTH; b. compute the right tile: tile.left = (position.x + SPRITE_WIDTH) / TILE_WIDTH; c. compute the top tile: = position.y / TITLE_HIEGHT d. compute the bottome tile: tile.bottom = (position.y+SPRITE_HIEGHT) / TITLE_HIEGHT e. foreach tile in the span, check if the tile is solid and return invalid position if any solid tile is found 4) if the position is invalid then restore the old position
  8. The fact that the code is managed does not mean that it would be incapable of cheating. While you could not hack into the memory of other processess, if you have full access to the system there is nothing stopping you from reading and writing whatever you want to the the harddrive (possibly copying materials purchased via live and dumping them on another machine), and you can do all kinds of things with the network also, like reporting erroneous wins. As soon as you give people full access to the system you have to worry about all kinds of security issues, like copying, modding, cheating, hacking, trojan horses and possibly even viruses.
  9. Quote:Original post by Stru I know this is unlikely, since Microsoft will want to charge royalties for everything. Hopefully, their business model is more centered around XboxLIVE than royalties from games (at least I suspect it is) and maybe they will encourage hobby game development. The big budget games that generate a lot of royalty arent going to be on CD anyway so they could put their copy-protection and royalty stuff on the DVD discs only. Then not-for-profit hobby games could easily be shared on CD. I don't think this is likely. Not because of the royalty issue but because of the security and piracy issues. Security is supposed to be a big deal on this console with the new live micro transactions. Modding and cheating are other related problems. Microsoft is not going to allow any unsigned code to be run, which is too bad. It would have been nice if they at least let you run in a sand box with no disk access or network access, but i think thats highly unlikely.
  10. invective

    c# app needs to be tested

    An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. Additional information: Could not load file or assembly 'Microsoft.DirectX.Direct3DX, Version=1.0.2905.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
  11. Quote:Original post by deadlydog Quote:Original post by cignox1 Modulus is what remains after a division between two integers: with floats you can get decimals so why calculating the modulus? I'm using it with 1.0 as the modulus to get the decimal places. That's what I want it for. You can also just get the decimal points like this: float number = 1.23456 float decimal = number - (int)number;
  12. invective

    Using a if/else function when a counter is used

    Use an array / vector to store the input. I will not write the function for you, but here is how you do it using std::max_element(): #include <vector> #include <algorithm> using namespace std; int main() { vector <int> array; int temp; for (int i=0; i<10;++i) { cout << "enter number "<< i+1 << " of 10: "; cin >> temp; array.push_back(temp); } cout << "The largest element is: "<<*(max_element(array.begin(), array.end())) << endl; cin.ignore(2); }
  13. Well I haven't watched farenheit 9/11 yet, but thats mainly because I thought bowling for columbine was such a sanctimonious piece of propaganda crap (and I happen to be anti gun). In anycase for me, voting for bush or kerry is like voting for coke or pepsi. I hate warm pepsi slightly less than I hate warm coke, but by an large they are both more or less the same. Niether kerry or bush has a real exit strategy for iraq (in fact they both have about the same plan). Neither kerry or bush wants to balance the budget by cutting government spending. Neither kerry or bush has a real plan to reform social security or medicare. etc etc. Clintonian centrism has caused both sides to move towards the so called "center" that its hard to tell them apart these days. You have a "conservative" president who has presided over the biggest increase in government spending since the johnson administration and the largest nominal deficits in history, and a democratic canidate who wants to increase the size of the military -- go figure. Coke or pepsi? I think I'll try something else.
  14. The Sony VAIO s series is the only laptop I've been able to find that has a decent graphics card, doesn't wiegh a ton, and has decent battery life. You pay for it though, because its not cheap. I will probably buy a S170 to replace my Dell Inspiron 8200, which has a nice UXGA screen, but wieghs a ton (especially with the 2 batteries you need to squeeze out 4 hours of mobile time). I find that dell is usually dirt cheap and very customizable compared to everything else, but their laptops have a very cheap plastic feel to them and are large and bulky.
  15. invective

    reading in an array from a .txt file

    The istream extraction operator >> will ignore white space (tabs spaces, newlines), so just make your file uses one or more of these as delimiters for your data. If you do not know how many elements are in the file either store the number of elements in the file header, and allocate the array after you read the header, or use a vector instead of an array: #include <fstream> #include <vector> using namespace std; int main() { vector <int> array; ifstream input;"data.txt"); int temp; while (input.good()) { input >> temp; array.push_back(temp); } input.close(); for (int i=0; i < array.size(); ++i) cout << array << endl; cin.ignore(); }
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!