• What do you need help with? Version 5
    5,752 replies, posted
[QUOTE=WTF Nuke;38818674]Concrete your understanding of one, then move on.[/QUOTE] By "concrete", you should probably have the ability to program a useful thing or game or whatever in that language. Learning to program is mostly about learning the overall ideas and methodology behind it all, rather than any specific language. It's possible to implement just about anything in any language.
[QUOTE=ECrownofFire;38819529]By "concrete", you should probably have the ability to program a useful thing or game or whatever in that language. Learning to program is mostly about learning the overall ideas and methodology behind it all, rather than any specific language. It's possible to implement just about anything in any language.[/QUOTE] I agree, but I think you should actually do it rather than conceptually think about it. Thinking is one thing, everything works in your head. When you get down to the nitty-gritty however, everything's a lot harder. That's why I think it's important to implement an idea you've read about to actually concrete your learning. Understanding examples and implementing them are two different things.
I'm having some trouble with the Getting Started tutorial for SFML. When I run the program this pops up: [img]http://i.imgur.com/MePjb.png[/img] I don't know where that file's supposed to come from. Anyone more familiar with SFML who could help me out?
[QUOTE=muckuruxx;38820515]I'm having some trouble with the Getting Started tutorial for SFML. When I run the program this pops up: -snip- I don't know where that file's supposed to come from. Anyone more familiar with SFML who could help me out?[/QUOTE] It comes with SFML 2.0. You'll need to find it from the SFML folder and put it in the folder with your EXE.
[QUOTE=Pangogie;38821076]It comes with SFML 2.0. You'll need to find it from the SFML folder and put it in the folder with your EXE.[/QUOTE] Ah, thanks. Was looking in the wrong places before.
First time posting in here, haven't been doing any sort of programming for too long at all, so sorry if this is all a bit trivial I'm making a 2D game in C#, and so far I've got stuff like collisions, animations and pickups in place, but now I'm stuck on adding the next feature It would be most useful for the game to know when the player is in a certain area on the screen, since I have a single image overlaying everything that includes some bush sprites, and I'm hoping for a sort of "hiding" deal when the player is obscured by one. I'm imagining the easiest way would be to make some sort of invisible mask to put over the level to dictate places that are or aren't hiding spots, but I have no idea how I'd do this Does anyone have an pointers per chance?
So if I'm using C++, and I want an array of objects that can dynamically resize itself when I want to add or remove an element, yet the pointers to any particular element have to remain valid - I should use a list and not a vector, correct?
[QUOTE=Nikita;38824537]So if I'm using C++, and I want an array of objects that can dynamically resize itself when I want to add or remove an element, yet the pointers to any particular element have to remain valid - I should use a list and not a vector, correct?[/QUOTE] That is correct.
Any tips on adding physics/collisions in Love2d? What I have so far is top down scroller and the movement is delta time based. I saw there is a HardonCollider library or should I use the built-in Box2d engine?
[QUOTE=Nikita;38824537]So if I'm using C++, and I want an array of objects that can dynamically resize itself when I want to add or remove an element, yet the pointers to any particular element have to remain valid - I should use a list and not a vector, correct?[/QUOTE] Yes, std::list is a linked list while std::vector is a continuous set of objects.
I ran into a issue with Microsoft SQL that I'm hoping you guys can help out with. Basically I need to update the server using the ColumnID instead of the ColumnName. EX "UPDATE Accounts SET (0=Anthony, 1=Password)" instead of "UPDATE Accounts SET (Username=Anthony, Password=Password)" If anyone is curious why, My current SQL system is set up like this. To get data from the SQLDatabase it calls GetData which returns the result in object[] form using this. [code]public static object[] GetData(string Query, params object[] args) { using (SqlConnection con = new SqlConnection(Settings.DatabaseString)) { con.Open(); using (SqlCommand command = con.CreateCommand()) { command.CommandText = string.Format(Query, args); using (SqlDataReader Reader = command.ExecuteReader()) { if (Reader.HasRows) { while (Reader.Read()) { object[] Values = new object[Reader.FieldCount]; Reader.GetValues(Values); return Values; } } } } } return null; } [/code] Which is used by a Class called [url=http://pastebin.com/ctXr6GJc]IData[/url] which I wrote to make adding new SqlLoaders less of a pain as it's pretty dynamic. Then is used in a IData Override in this case [url=http://pastebin.com/JKBkXZZJ]SkillCooldownData[/url] I was hoping to write a function similar to Reader.GetValues(Values); but it instead sets them so I don't have to bother hardcoding the query's.
thanks for the suggestion guys. it seems hard learning js for a first language though since it doesn't really seem to do much on its own. it seems to be useful in the context of html and css. maybe i should have started with html =\
I want to know what are the best resources to use for learning Java and Android development, since there are a few job opportunities in my area coming up next year where they want apps on Android developed.
[QUOTE=Nevec;38750369]I'm looking for a fast ray-terrain intersection algorithm for XNA. Right now I'm using ray-triangle interesction, but it's too slow with a large number of vertices. The terrain is generated using a height map.[/QUOTE] I figured it out myself. This is what I did: * define a plane using the lowest vertex in the terrain; * define a plane using the highest vertex in the terrain; * define a line using the points where the ray interests the high and the low planes; * rasterize the line using the scale of the terrain; * find all triangles that are part of the rasterized line; * calculate intersections with those triangles; * find the shortest distance. This brought down the number of triangles that need to be checked from 131072 to 40 or so.
I still require help with SQL work in C# [CODE] SqlConnection con = new System.Data.SqlClient.SqlConnection(); con.ConnectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\path_to_file.mdf;Integrated Security=True;Connect Timeout=30"; con.Open(); MessageBox.Show("Connection opened"); con.Close(); MessageBox.Show("Connection closed"); [/CODE] The connection works I believe, no errors are thrown. How do I create queries with the "con" object?
[QUOTE=wutanggrenad;38840043]I still require help with SQL work in C# [CODE] SqlConnection con = new System.Data.SqlClient.SqlConnection(); con.ConnectionString = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\path_to_file.mdf;Integrated Security=True;Connect Timeout=30"; con.Open(); MessageBox.Show("Connection opened"); con.Close(); MessageBox.Show("Connection closed"); [/CODE] The connection works I believe, no errors are thrown. How do I create queries with the "con" object?[/QUOTE] Heh, believe it or not [URL="http://facepunch.com/showthread.php?t=1167392&p=38834675&viewfull=1#post38834675"]my question[/URL] will probably help you get your code working. If you have any questions I'll see what I can to to answer them. [editline]![/editline] Well I figured out one way to solve my issue. I'll just load the Column names during startup and and use it to replace the ID's with valid names. [code] object[][] Tables = GetAllData("USE Database SELECT name FROM sys.Tables WHERE name != 'sysdiagrams'"); foreach (object[] Table in Tables) { object[][] Columns = GetAllData("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{0}' ORDER BY ORDINAL_POSITION", Table[0]); List<string> ColumnNames = new List<string>(); foreach (object[] ColumnName in Columns) { ColumnNames.Add((string)ColumnName[0]); } this.ColumnNames.TryAdd((string)Table[0], ColumnNames); } [/code]
[QUOTE=yawmwen;38836267]thanks for the suggestion guys. it seems hard learning js for a first language though since it doesn't really seem to do much on its own. it seems to be useful in the context of html and css. maybe i should have started with html =\[/QUOTE] HTML and CSS are hardly programming langauges you can pick them up in a few days, you should at least have basic understanding of both before you start messing with javascript.
Just a question: I'm studying C++ right now, but I want to go on game development, and as I've seen, it is possible to develop games using [I]Visual[/I] C++. What are the real differences between C++ and Visual C++? I'm sure it's not just graphics.
[QUOTE=RocketRacer;38852110]Just a question: I'm studying C++ right now, but I want to go on game development, and as I've seen, it is possible to develop games using [I]Visual[/I] C++. What are the real differences between C++ and Visual C++? I'm sure it's not just graphics.[/QUOTE] More or less, Visual C++ is the Visual Studio IDE for C++. One of it's main features is it can compile the code into IL code or ASM code. It also has VisualStudio's amazing debugger behind it. You can read more about it here. [url]http://en.wikipedia.org/wiki/Visual_C%2B%2B[/url]
[QUOTE=anthonywolfe;38852162]More or less, Visual C++ is the Visual Studio IDE for C++. One of it's main features is it can compile the code into IL code or ASM code. It also has VisualStudio's amazing debugger behind it. You can read more about it here. [url]http://en.wikipedia.org/wiki/Visual_C%2B%2B[/url][/QUOTE] So if I'll study C++ more(soon we should begin studying Files on my courses), I could do a very simple and dumb game on Visual C++?
[QUOTE=RocketRacer;38852195]So if I'll study C++ more(soon we should begin studying Files on my courses), I could do a very simple and dumb game on Visual C++?[/QUOTE] Yea, You could do a simple or complex game in C++. Using [url=http://msdn.microsoft.com/en-us/library/bb384840.aspx]DirectX[/url] or OpenGL's [url=http://www.libsdl.org/]SDL[/url] or [url=http://www.sfml-dev.org]SMFL[/url]
[QUOTE=RocketRacer;38852195]So if I'll study C++ more(soon we should begin studying Files on my courses), I could do a very simple and dumb game on Visual C++?[/QUOTE] Don't concentrate too much on "Visual C++", it's just a compiler for C++. You can make games with it just like you can with other compilers like GCC and Clang.
[QUOTE=ArgvCompany;38852790]Don't concentrate too much on "Visual C++", it's just a compiler for C++. You can make games with it just like you can with other compilers like GCC and Clang.[/QUOTE] My main goal now, is to learn to work on C++, so I don't concentrate on Visual C++ at all.
[QUOTE=RocketRacer;38852822]My main goal now, is to learn to work on C++, so I don't concentrate on Visual C++ at all.[/QUOTE] That's good. I agree with anthonywolfe with recommending [URL=http://www.sfml-dev.org/]SFML[/URL]. It's very straightforward to use compared to lower-level stuff. It's a really good start.
When I want to run a program with GDB that was compiled with DMD I get this error: "not in executable format: File format not recognized" Though I can run it directly.
[QUOTE=ArgvCompany;38852859]That's good. I agree with anthonywolfe with recommending [URL=http://www.sfml-dev.org/]SFML[/URL]. It's very straightforward to use compared to lower-level stuff. It's a really good start.[/QUOTE] Looks like SFML is really good for a start(for me). Thanks for recommending it! I'll take a look at it when I'll know how to work with classes and object-orientated programming. Also, looks like SFML has some Network abilities. Does it make it possible to create a kind-of-multiplayer thing?
I'm interested in starting object orientated programming for C++. At uni I've had two programming classes so far, intro to programming which was taught Python and covered basic programming principles and a subject about developing user interfaces using the GDI(not GDI+) which was in C. The introduction to programming subject did cover object orientated programming briefly but not well enough to really apply it to my programming. Since I have a bit of spare time now and would like to try practice some more programming and it seems like learning object orientated programming would be beneficial to learn sooner rather than later. Obviously there are plenty of tutorials available but I was wondering if anyone could make some suggestions to get me on the right track. Some tutorials I've found which have sections for object orientated programming are: [url]http://www.learncpp.com/[/url], [url]http://www.cplusplus.com/doc/tutorial/[/url] and [url]http://c.learncodethehardway.org/book/ex19.html[/url].
[QUOTE=RocketRacer;38852974]Looks like SFML is really good for a start(for me). Thanks for recommending it! I'll take a look at it when I'll know how to work with classes and object-orientated programming. Also, looks like SFML has some Network abilities. Does it make it possible to create a kind-of-multiplayer thing?[/QUOTE] Yeah it's possible, but I would wait with that until a bit later. Networking really complicates stuff a lot.
I need an array of two queues of 2-element arrays. [code]std::queue<std::array<double, 2>> crossing[2];[/code] But then I get a compiler error when doing [code]crossing[i].push_back(x); error: 'class std::queue<std::array<double, 2u> >' has no member named 'push_back'[/code]
[QUOTE=Larikang;38854330]I need an array of two queues of 2-element arrays. [code]std::queue<std::array<double, 2>> crossing[2];[/code] But then I get a compiler error when doing [code]crossing[i].push_back(x); error: 'class std::queue<std::array<double, 2u> >' has no member named 'push_back'[/code][/QUOTE] That's because std::queue doesn't have push_back. Use push instead.
Sorry, you need to Log In to post a reply to this thread.