• What Are You Working On? V13
    5,003 replies, posted
[QUOTE=ZeekyHBomb;25806521][code] bool AreEqual(float a, float b) { return ((int)a).ToString() == ((int)b).ToString(); } [/code] :pseudo:[/QUOTE] you could retain the fuzziness that Jallen's algorithm allows by calculating the Levenshtein distance for the strings and weighing each character by the magnitude it represents
[QUOTE=Xerios3;25806684]Well I find DirectX much easier atm since I'm used to XNA's work flow. Who knows, I might make a OpenGL port in the future =)[/QUOTE] With all the other graphic libraries you've gone through, you probably will. :v:
Xerios you should really make it renderer-independent. That way you can swap libraries to your heart's content.
In Visual Studio I have a C# project with a default namespace of "Scripts". I have a folder in the project, also called "Scripts". In this folder (well, subfolders in this folder) are a bunch of .cs files. Whenever I make a new .cs file it lists the namespace as: [csharp]namespace Scripts.Scripts.Directory.Etc[/csharp] So I have to manually remove the first "Scripts". How can I make the new class wizard leave out the first "Scripts"? The folder structure is essential, I can't change that.
[QUOTE=DeadKiller987;25804779]JAD sucks try this: [url]http://java.decompiler.free.fr/[/url] Easy and fast.[/QUOTE] JD is one of the best. Sadly it doesn't see too many updates. Which really sucks because he just rewrote the engine and there are some critical bugs in it :\. (Every other class will be missing 3+ methods) Also really wish it had something like reflectors analyze feature. Also more clickable functions. It is a freaking bitch to hunt down shit
[QUOTE=Robert64;25808950]In Visual Studio I have a C# project with a default namespace of "Scripts". I have a folder in the project, also called "Scripts". In this folder (well, subfolders in this folder) are a bunch of .cs files. Whenever I make a new .cs file it lists the namespace as: [csharp]namespace Scripts.Scripts.Directory.Etc[/csharp] So I have to manually remove the first "Scripts". How can I make the new class wizard leave out the first "Scripts"? The folder structure is essential, I can't change that.[/QUOTE] I think you can change that in the namespace part. I think it will say namespace Scripts.Scripts change that to Scripts
[QUOTE=Dj-J3;25809780]I think you can change that in the namespace part.[/QUOTE] I can only change the name of the thing that comes before the second Scripts, not remove it all together.
I'm going to make a website to preview OpenGL shaders as a little showcase of my Lua game framework. (The website is served by the Lua code)
Trying to understand math I don't know yet. [code]bullet_instance[i].x = bullet_instance[i].x + bullet_instance[i].speed * cos(bullet_instance[i].direction*pi/180); bullet_instance[i].y = bullet_instance[i].y - bullet_instance[i].speed * sin(bullet_instance[i].direction*pi/180);[/code] [img]http://i225.photobucket.com/albums/dd159/samuka97/failingbullet.png[/img] WHY DON'T THEY MAKE A CIRCLE AAAAAAAAAAAAA [b]edit:[/b] I'm a programming king because I can't get my math stuff to work? Yay!
Y is cos, x is sin. I dunno if that matters here, tho'.
For a circle it shouldn't make any difference at all, as far as I can tell. The only issue I can think of is that the values returned by sin and cos are being truncated to 0. I don't see why it would do that early on though.
[QUOTE=esalaka;25810514]Y is cos, x is sin. I dunno if that matters here, tho'.[/QUOTE] It is like that in my code now. Still, the only difference is that the stupid little ball goes up now =|
.direction is an angle in degrees, correct?
[QUOTE=Chris220;25810569]For a circle it shouldn't make any difference at all, as far as I can tell. The only issue I can think of is that the values returned by sin and cos are being truncated to 0. I don't see why it would do that early on though.[/QUOTE] oh my fucking balls that was it. Well, there goes 4 hours of my life doing absolutely nothing but staring at a white screen with a bunch of text!
Haha, I hate it when stuff like that happens.
I have been reading Head First C# book and it is pretty good. I just finished my Beehive simulator. Even though I was given 80% of the code I'm still proud of it. I learned a lot. [img_thumb]http://anyhub.net/file/beehivesimulator.png[/img_thumb]
Haha oh wow, that's actually really cool! I'd love to see a video of it in action. Any chance of uploading one?
It's annoying when you find that some code you have written isn't really good for what you wanted but is in fact excellent for something else that you have no use for.
[QUOTE=esalaka;25810514]Y is cos, x is sin. I dunno if that matters here, tho'.[/QUOTE] Wrong... [img]http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Unit_circle.svg/352px-Unit_circle.svg.png[/img]
[QUOTE=Siemens;25802748]Also, I could [b]really[/b] use Chandler's hue library here: [img_thumb]http://ahb.me/Pm9[/img_thumb][/QUOTE] But that would mean you'd have to use C++. And I'm sure we all know your opinion on that :awesomelon: To be honest, I actually based Hue on the .NET Console, (but with C++ STL style. Personally, I think using << isn't the greatest thing in the world, but oh well. "When in Rome." and all that jazz) On a different note, I'm pretty certain I'll be using Tcl now as the preprocessor. Here's why (kind of long winded, but the setup is necessary) One of my primary goals for my language is that upon viewing a specific identifier (i.e. a class, namespace, method, function, variable etc.), it would be fairly easy to deduce what is happening where. For instance, a generic is quite clearly declared with a [T] (or [...] if you want vararg generics ;D), and a function/method is always called with (). All objects are accessed with the . operator, etc. etc. But this means I have to get creative so as to not end up with confusing ambiguity. Case in point is the new C++ standard, where && now has two meanings. In the case of boolean logic, it works as the good old "and" token, but when placed within the confines of a method declaration, it becomes the "move" operator (basically a memmove is used in the background, with the original argument now being set to nullptr (or NULL, if the compiler doesn't have nullptr), even if it were to be declared on the stack). This is highly confusing, and in the interest of keeping people sane, I've turned such things into keywords (mov and ref for && and &. C# and D both use the ref keyword, but the move operator is something new, I believe, as no copy is called) In C, even, is the possible mixup for address-of and declaring a pointer. Now at this current point in time, I'm using the @ symbol for address of (seems to make sense), so that x := @some_var would be equivalent to something like int* x = &some_var; in C or C++. (though I may use the opposite of "declared return type" (->), and use <- instead. Don't know how I feel about it though. "x := <-some_var" seems too confusing. While this entire situation (of using [] for generics, and such) may cause some confusion, (especially since I haven't decided if I want a pointer to be a "generic keyword", which I'll talk about later, or an actual symbol), it does luckily, allow for an easier go with the preprocessor. Currently, my language doesn't use either {} or $, which means anything that uses these as their primary form of expressions is just right as a preprocessor. Which just so happens to be what Tcl does. Now, the preprocessor is invoked with the backtick character `, though a digraph of some kind may be necessary, because I believe some keyboards don't have this available? I am not sure. Anywho, I originally was going to have a set number of commands, as well as a "script" command that would allow the execution of the embedded language. This is no longer necessary, as Tcl is a command language, so each command would be executed through the language itself. So for instance, take the following code. [code] `set x [puts "'Hello, world!'"] def print(arg:string) -> none: output.write(arg) end print($x) [/code] At runtime, the preprocessor would execute the command "puts "'Hello, World!'"" anywhere where $x is placed, so after preprocessing, the code would look like [code] def print(arg:string) -> none: output.write(arg) end print('Hello, World!') [/code] Obviously, this is a smaller example, and there will be quite a bit more someone can do with the preprocessor. Another reason I've chosen to make something like this the preprocessor, is in the hopes that no one will abuse the generics system, as I have a feeling that by the time I'm done it will be turing complete. and I don't want someone doing with it what they've done with Boost.Spirit :ohdear:
[QUOTE=Darwin226;25810777]Wrong... [img_thumb]http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Unit_circle.svg/352px-Unit_circle.svg.png[/img_thumb][/QUOTE] Oh fuck I am dumb and should be drowned in boxes. I [B]knew[/B] this.
No problem. I think I sounded like a prick. Sorry :)
[QUOTE=high;25809012]JD is one of the best. Sadly it doesn't see too many updates. Which really sucks because he just rewrote the engine and there are some critical bugs in it :\. (Every other class will be missing 3+ methods) Also really wish it had something like reflectors analyze feature. Also more clickable functions. It is a freaking bitch to hunt down shit[/QUOTE] Really? I thought that he made updates quite frequently. That was about 1.5yrs ago when I was messing with Runescape deobs and private servers, though. :smugdog:
[img]http://imgkk.com/i/__qai6.png[/img] tile system in 20 minutes fuck yeah [cpp] #include <iostream> #include <string> #include <SFML/Graphics.hpp> #include "Game.h" //EVERTHING IS 32X32 int main() { Game gam; gam.init("wee", 800, 600); sf::Image img; img.LoadFromFile("tile.png"); Tile t; Tile s; Tile q; Player me; t.init(img, 0, 0); s.init(img, 0, 1); q.init(img, 1, 0); gam.addtile(t, 0, 0); gam.addtile(s, 0, 1); gam.addtile(q, 1, 0); sf::Image play; play.LoadFromFile("player.png"); me.init(play, 1, 1); gam.SetPlayer(me); gam.draw(); int i; std::cin >> i; } [/cpp] I'll add factory functions for tiles later so I can remove a bunch of that code. My RPG game/engine is coming along nicely.
[QUOTE=Darwin226;25810777]Wrong... [img_thumb]http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Unit_circle.svg/352px-Unit_circle.svg.png[/img_thumb][/QUOTE] But if the radius of the circle isn't 1, should I multiply the cos t and the sin t by the radius ?
Instead of "int i; std::cin >> i;" I usually prefer to do "std::cin.get();" Works the same, but will accept empty inputs as well [editline]2nd November 2010[/editline] [QUOTE=Laserbeams;25811638]But if the radius of the circle isn't 1, should I multiply the cos t and the sin t by the radius ?[/QUOTE] That's simply a "unit circle" for conveniance. To get the X and Y lengths, yes, you should multiply by radius.
[QUOTE=neos300;25811210][img_thumb]http://imgkk.com/i/__qai6.png[/img_thumb] tile system in 20 minutes fuck yeah [cpp] #include <iostream> #include <string> #include <SFML/Graphics.hpp> #include "Game.h" //EVERTHING IS 32X32 int main() { Game gam; gam.init("wee", 800, 600); sf::Image img; img.LoadFromFile("tile.png"); Tile t; Tile s; Tile q; Player me; t.init(img, 0, 0); s.init(img, 0, 1); q.init(img, 1, 0); gam.addtile(t, 0, 0); gam.addtile(s, 0, 1); gam.addtile(q, 1, 0); sf::Image play; play.LoadFromFile("player.png"); me.init(play, 1, 1); gam.SetPlayer(me); gam.draw(); int i; std::cin >> i; } [/cpp] I'll add factory functions for tiles later so I can remove a bunch of that code. My RPG game/engine is coming along nicely.[/QUOTE] What the hell is a "gam" ? Also your image is broken, at least it is for me anyway.
[QUOTE=Laserbeams;25811638]But if the radius of the circle isn't 1, should I multiply the cos t and the sin t by the radius ?[/QUOTE] Naturally. The sin and cos function will always be -1 <= x <= 1
It appears to be a game, without an e. Edit: Ninjas
[QUOTE=Darwin226;25811064]No problem. I think I sounded like a prick. Sorry :)[/QUOTE] Nah, you didn't, it was nice of you to point it out.
Sorry, you need to Log In to post a reply to this thread.