• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=Doritos_Man;30931702][code] private void button1_Click(object sender, EventArgs e) { MessageBox.Show("Username: " + UsernameInput + "\n" + "Password: " + PasswordInput); }[/code][/QUOTE] MessageBox.Show("Username: " + UsernameInput[B].Text[/B] + "\n" + "Password: " + PasswordInput[B].Text[/B]);
[QUOTE=SupahVee;30924492]Thanks! That fixed it. I found [b]one[/b] more problem, though. --- [img]http://dl.dropbox.com/u/3724424/Programming/bug1.gif[/img] When falling down at an high enough speed, and sliding towards a wall, the player gets trough the floor. --- Also, I found a new [b]feature[/b]. [img]http://dl.dropbox.com/u/3724424/Programming/bug2.gif[/img] If I keep the jump key pressed, hitting a corner of a wall while in the air will make the player jump again immediately without resetting velocity.[/QUOTE] Fixed it for you.
[QUOTE=ncls_hv;30927458]I dont understand what i am getting this error D:\sfml2\SFML2test\Engine.cpp|28|error: expected primary-expression before ';' token| [code] class Tile { private: sf::Sprite baseSprite; int tileId; public: static ImageManager* imgMgr; Tile(int tileid); ~Tile(); void setImage(int tileid); void Draw(int x, int y, sf::RenderWindow* rw); int GetTileID(){return tileId;} }; [/code] Here: Tile::imgMgr = &ImageManager; Edit: yes i know im a noob, but why this is funny? tell me[/QUOTE] ImageManager is a class. You can't take addresses from classes. You probably just don't want the pointer there.
[QUOTE=SupahVee;30925541]They look like they're overlapping because of the draw code (the borders). They're not overlapping. I call the collision routine once per frame, on every object. Should I call it more often?[/QUOTE] How do you update the positions of the entities and when do you check for collisions ? Do you update all entities position and after that make global collision check for every entity, or do you update an entity, check his collision and then move to another entity ?
[QUOTE=Felheart;30925339]Try to make the collision-boxes of the spikes bigger, as big as a tile. Does this fix the problem?[/QUOTE] Nope. By debugging I've noticed that when I move left toward the spikes (as shown in the gif) sometimes 4 collisions are registered. [editline]6th July 2011[/editline] [QUOTE=AntonioR;30936856]How do you update the positions of the entities and when do you check for collisions ? Do you update all entities position and after that make global collision check for every entity, or do you update an entity, check his collision and then move to another entity ?[/QUOTE] Tried both methods. They have the exact same results.
[QUOTE=SupahVee;30937818]Nope. By debugging I've noticed that when I move left toward the spikes (as shown in the gif) sometimes 4 collisions are registered. [editline]6th July 2011[/editline] Tried both methods. They have the exact same results.[/QUOTE] Maybe one sensor is inside the hitbox of the spike and a tile at the same time. Do you work in XNA? Can you maybe show a bit more of your code? I will add objects like platforms that move by themselves today to my own program.
[QUOTE=Felheart;30938227]Maybe one sensor is inside the hitbox of the spike and a tile at the same time.[/QUOTE] I believe that's exactly what's happening. [QUOTE=Felheart;30938227]Do you work in XNA? Can you maybe show a bit more of your code? I will add objects like platforms that move by themselves today to my own program.[/QUOTE] I use C# + SFML.NET. What parts of the source code are you interested in? [editline]6th July 2011[/editline] [img]http://dl.dropbox.com/u/3724424/Programming/bug4.gif[/img] Another buggy situation. This time Collisions is always <4. If I keep walking to the left, the player completely ignores the spikes and collides with the wall. This is because SmallestComponents obviously finds the smallest components (which push the player out of the wall but not out of the spikes). If I stop walking to the left, either the spikes push the player or the player is shooted through the floor.
[QUOTE=SupahVee;30938379]I believe that's exactly what's happening. I use C# + SFML.NET. What parts of the source code are you interested in?[/QUOTE] Your update loop would be interesting, also the acceleration constants and maximum and average velocities of all objects in your game.
[php]public void Update() { Console.Clear(); for (int i = 0; i < Bodies.Count; i++) if (Bodies[i].IsStatic == false) Bodies[i].Update(); }[/php] World update method --- [url]http://pastebin.com/M8mvPAJP[/url] - Update method (in a single body) --- Gravity acceleration is a SSSPVector2 (0, 100) --- Spikes aren't moved using velocity, their position is changed using a lerp method. Player reaches max velocity of +-1000 on the X axis, no max/min on the Y axis.
I'm sure there's a simple way to solve this but I can't for the life of me remember it. I have a rotation that can go from -180 to 180, this is changing a lot and is interpolated over 10 frames, so if the previous angle was 40 and it was going to 80, it gets the difference, divided by 10 and adds it each frame until the next set of angles. The problem occurs when the player rotates from -170 to 170 for example, it's really just a difference of 20 degrees but of course it tries to smooth it around all the way from -170, to 0 and to 170. Is there a simple method to have it smooth correctly over the -180/180 mark?
[QUOTE=Jimbomcb;30939320]I'm sure there's a simple way to solve this but I can't for the life of me remember it. I have a rotation that can go from -180 to 180, this is changing a lot and is interpolated over 10 frames, so if the previous angle was 40 and it was going to 80, it gets the difference, divided by 10 and adds it each frame until the next set of angles. The problem occurs when the player rotates from -170 to 170 for example, it's really just a difference of 20 degrees but of course it tries to smooth it around all the way from -170, to 0 and to 170. Is there a simple method to have it smooth correctly over the -180/180 mark?[/QUOTE] Here's some snippet I have: [cpp]inline float AngleDiff(float Angle1, float Angle2) { float Diff = Angle2 - Angle1; while (Diff < -180.f) Diff += 360.f; while (Diff > -180.f) Diff -= 360.f; return Diff; }[/cpp] I have always used angles from 0 to 360, but it should work anyways. In this -170 to 170 case it would return -20.
[QUOTE=Jimbomcb;30939320]I'm sure there's a simple way to solve this but I can't for the life of me remember it. I have a rotation that can go from -180 to 180, this is changing a lot and is interpolated over 10 frames, so if the previous angle was 40 and it was going to 80, it gets the difference, divided by 10 and adds it each frame until the next set of angles. The problem occurs when the player rotates from -170 to 170 for example, it's really just a difference of 20 degrees but of course it tries to smooth it around all the way from -170, to 0 and to 170. Is there a simple method to have it smooth correctly over the -180/180 mark?[/QUOTE] Maybe this helps [URL="http://stackoverflow.com/questions/2708476/rotation-interpolation"]http://stackoverflow.com/questions/2708476/rotation-interpolation [/URL] Edit: In this gif: [URL]http://dl.dropbox.com/u/3724424/Programming/bug4.gif[/URL] This should be "Collisions == 3". and the player should be pushed out in the direction "top right". hmm i have the feeling there is a subtle bug... Edit2: Now I know it. the code looks at how many collisions there are, and changes it's reaction according to that. but thats wrong. It should calculate "Collisions" in another way. Like this: [CODE] Collisions = 0; if(TopLeftSensor) Collisions++; if(TopRightSensor) Collisions++; if(BottomLeftSensor) Collisions++; if(BottomRightSensor) Collisions++; [/CODE] Because even if the BottomLeft sensor is colliding with a tile AND the spikes. its STILL a 3 point collision!! Try this, and /or a mix between this change and the old solution. Also lets see your Bodies[i].Update() method!
[QUOTE=Felheart;30939739] Also lets see your Bodies[i].Update() method![/QUOTE] This is the SSSPBody.Update() method [URL]http://pastebin.com/M8mvPAJP[/URL] (the one I posted above). :) This is the same method after the solution you posted above [URL="http://pastebin.com/kzcGnfgx"]http://pastebin.com/kzcGnfgx T[/URL]he results are unchanged, the bugs still occur. [editline]6th July 2011[/editline] Actually, here's the FULL source code. [url]http://dl.dropbox.com/u/3724424/Programming/PlatformerPhysicsTest%20-%20Copy.rar[/url]
Has anyone had problems with rendering text using SFML? Whenever I try rendering text using sf::String, the entire program becomes dark and the textures get screwed up. I am using OpenGL.
How do you guys check in VB for empty textboxes and if a textbox has numbers ? what i did.. [code] .... If IsNumeric(ibox1.Text + ibox2.Text) Then If ibox1.Text > "" Then If ibox2.Text > "" Then ...[/code] i think that is kinda wrong, but its working mhm ..
[QUOTE=cNova;30943704]How do you guys check in VB for empty textboxes and if a textbox has numbers ? what i did.. [code] .... If IsNumeric(ibox1.Text + ibox2.Text) Then If ibox1.Text > "" Then If ibox2.Text > "" Then ...[/code] i think that is kinda wrong, but its working mhm ..[/QUOTE] if Len(ibox1.Text) > 0 Then [URL]http://msdn.microsoft.com/en-us/library/dxsw58z6(v=vs.90).aspx[/URL]
I have seen many things people have made here showing a fps, but I'm wondering how they show it. First off, I use Java, so I hope it's possible. As of right now I have a Thread with a JFrame with the Run() method having a while(true) to repaint the JPanel, then wait 17ms and paint it again. Is that a good way to get a fixed ~60 fps? If not, please point me in a better direction. In school we only learn about application making in Java and not any game'ish stuff which I'd like to experiment with.
[QUOTE=Zyx;30946791]I have seen many things people have made here showing a fps, but I'm wondering how they show it. First off, I use Java, so I hope it's possible. As of right now I have a Thread with a JFrame with the Run() method having a while(true) to repaint the JPanel, then wait 17ms and paint it again. Is that a good way to get a fixed ~60 fps? If not, please point me in a better direction. In school we only learn about application making in Java and not any game'ish stuff which I'd like to experiment with.[/QUOTE] when you say you wait 17ms, do you actually tell the program to wait 17ms? if thats the case then its not right, as your program might be running slow say 30fps, and then your telling it to wait another 17ms
Does anyone know a good site for learning shaders in XNA?
[QUOTE=Dj-J3;30948534]Does anyone know a good site for learning shaders in XNA?[/QUOTE] [url]http://www.riemers.net/eng/Tutorials/XNA/Csharp/series3.php[/url] This should explain quite abit
[QUOTE=Dj-J3;30948534]Does anyone know a good site for learning shaders in XNA?[/QUOTE] Currently learning from those sites: [URL="http://forums.create.msdn.com/forums/t/27849.aspx"]http://forums.create.msdn.com/forums/t/27849.aspx [/URL] [URL]http://digitalerr0r.wordpress.com/2009/05/16/xna-shader-programming-tutorial-20-depth-of-field/[/URL]
Hi, I dont know a shit of code but I do know a little of Batch Script, so I need to create a script that mods some numbers in a file and saves them, I could do it with a Batch Script but it only allows operations with absolute numbers so im screwed. Anyone knows a batch calculator or a way I could code a script in other language like phyton etc. I will apresiate any help.
[QUOTE=DJ Iñaki;30948861]Hi, I dont know a shit of code but I do know a little of Batch Script, so I need to create a script that mods some numbers in a file and saves them, I could do it with a Batch Script but it only allows operations with absolute numbers so im screwed. Anyone knows a batch calculator or a way I could code a script in other language like phyton etc. I will apresiate any help.[/QUOTE] [URL="http://sourceforge.net/projects/pywin32/"]http://sourceforge.net/projects/pywin32/ [URL="http://docs.python.org/tutorial/interpreter.html"]http://docs.python.org/tutorial/interpreter.html [/URL][/URL]
In VS2010 and XNA4. How can I add content files as a reference (like a shortcut). The problem is that I have a soundfile on my desktop and I make changes to it all the time. And when I recompile my game it's using the old copy. How can I make it so VS copies the soundfile to the "content"-folder automatically on each build?? I'm adding files to the content project with "Add -> existing element". But that creates a copy that does not get updated if the original file changes. Setting the property of the file to Copy if newer or Copy always does not help, because the files should not be copied to the bin-folder, but are processed by the XNA-Content-Processor. Until I find a solution to this problem I have to remove, delete and re-add every single changed file every time I rebuild the game
How do you do 2d pathfinding
[QUOTE=Felheart;30951046]In VS2010 and XNA4. How can I add content files as a reference (like a shortcut). The problem is that I have a soundfile on my desktop and I make changes to it all the time. And when I recompile my game it's using the old copy. How can I make it so VS copies the soundfile to the "content"-folder automatically on each build?? I'm adding files to the content project with "Add -> existing element". But that creates a copy that does not get updated if the original file changes. Setting the property of the file to Copy if newer or Copy always does not help, because the files should not be copied to the bin-folder, but are processed by the XNA-Content-Processor. Until I find a solution to this problem I have to remove, delete and re-add every single changed file every time I rebuild the game[/QUOTE] Couldn't you just save to the file in your project instead of the one on your desktop? It's not ideal, but it would work.
[QUOTE=Richy19;30948447]when you say you wait 17ms, do you actually tell the program to wait 17ms? if thats the case then its not right, as your program might be running slow say 30fps, and then your telling it to wait another 17ms[/QUOTE] I am telling the thread that draws everything to wait(17). If it's still not the right way, do you have any suggestions for a better way to do it?
[QUOTE=Parakon;30958654]How do you do 2d pathfinding[/QUOTE] [url]http://www.policyalmanac.org/games/aStarTutorial.htm[/url]
[QUOTE=Dj-J3;30959794]Couldn't you just save to the file in your project instead of the one on your desktop? It's not ideal, but it would work.[/QUOTE]Tried that for a while but "On my desktop" was just an example. In fact the file(s) in question are on a LAN drive.So they are not only changed by me, but also by people on different PCs.I can't believe nobody has thought of that in the Visual Studio team...
[QUOTE=Felheart;30961843]Tried that for a while but "On my desktop" was just an example. In fact the file(s) in question are on a LAN drive.So they are not only changed by me, but also by people on different PCs.I can't believe nobody has thought of that in the Visual Studio team...[/QUOTE] Tried adding the file as a link? [img]http://img809.imageshack.us/img809/6849/screenshot2011070712145.png[/img]
Sorry, you need to Log In to post a reply to this thread.