• What are you working on? v16
    5,004 replies, posted
[QUOTE=RyanDv3;28218247]oh, i get, so it's just a gathering of people from the internet in a bar, with the intent to show things to each other and just generally have a good time i'm in[/QUOTE] Not sure if serious.
I want to do deep cloning, but the serialization method is out of the question...
[QUOTE=BlkDucky;28218297]Not sure if serious.[/QUOTE] He's using that lame gold-member no caps post tense, he's just shit posting, ignore him. Jesus the quality of WAYWO has been dropping like crazy lately. Irony, I know. Someone post content.
If we had it at the pub at the end of my road I could bring sandwiches [editline]0[/editline] I'm good at making sandwiches
[QUOTE=RyanDv3;28218455]He's using that lame gold-member no caps post tense, he's just shit posting, ignore him. Jesus the quality of WAYWO has been dropping like crazy lately. Irony, I know. Someone post content.[/QUOTE] I would but I think I've posted enough screenshots of my roguelike already recently. :v:
Alright I got basic camera collision working using bullet physics, here's the result. [media]http://www.youtube.com/watch?v=9n3uMjUSl1k[/media]
[QUOTE=CarlBooth;28218518]I'm good at making sandwiches[/QUOTE] Are you a girl? :v:
[QUOTE=Richy19;28218817]Are you a girl? :v:[/QUOTE] With the username Carl, I presume not.
[QUOTE=Richy19;28218817]Are you a girl? :v:[/QUOTE] No, real men make their own sandwiches [editline]0[/editline] And cut them diagonally then lay them flat so they make little mountains on the plate. [editline]23rd February 2011[/editline] [img]http://1.bp.blogspot.com/_ZnkRZWIona4/TLzkNJr2niI/AAAAAAAAAzM/S5djgd9snX8/s1600/Triangle_Sandwich.jpg[/img] mmm yeah
[QUOTE=q3k;28211799]It's alive! [url=http://i.imgur.com/5t36V.jpg][img_thumb]http://i.imgur.com/5t36Vm.jpg[/img_thumb][/url][/QUOTE] At least get VESA or a graphics driver working; following a tutorial like Jame's and then implementing ACPI isn't a huge accomplishment (not trying to be an ass).
[QUOTE=CarlBooth;28219040]No, real men make their own sandwiches [editline]0[/editline] And cut them diagonally then lay them flat so they make little mountains on the plate. [editline]23rd February 2011[/editline] [img_thumb]http://1.bp.blogspot.com/_ZnkRZWIona4/TLzkNJr2niI/AAAAAAAAAzM/S5djgd9snX8/s1600/Triangle_Sandwich.jpg[/img_thumb] mmm yeah[/QUOTE] God damn it now im hungry for a sandwich
[QUOTE=Richy19;28219445]God damn it now im hungry for a sandwiches[/QUOTE] I've got a loaf a bread, a fridge full of cold meats, lots of cheeses, mayo and lots of mustards. Oh and a griddle.
Let's raid his fridge, it's probably filled with them On topic, I got this little bit of code, which is halfway to doing it's job: [csharp]public static class Factory<T> where T : new() { public static T Create(T e) { T c = Clone(e); return c; } public static T Clone(T obj) { T clone = new T(); return clone; } }[/csharp] [editline]22nd February 2011[/editline] Is there a way to iterate through an object's fields?
[QUOTE=DevBug;28219305]At least get VESA or a graphics driver working; following a tutorial like Jame's and then implementing ACPI isn't a huge accomplishment (not trying to be an ass).[/QUOTE] I've never stated anywhere that this was an accomplishment - it's just two evenings of work, and I'm happy about what I've got so far. As for drivers, I want them to be loaded later on, in order to make all of them equal and let the kernel chose whether to use VESA or another mode depending on what is available... Same goes for other devices. (not to mention that the tutorial you are talking about (I think) wasn't worth a lot as the code was broken (the linker script was funky and the bootstrap code was putting stuff in the wrong sections) - I'll edit it later)
[QUOTE=ZenX2;28219487]Let's raid his fridge, it's probably filled with them On topic, I got this little bit of code, which is halfway to doing it's job: [csharp]public static class Factory<T> where T : new() { public static T Create(T e) { T c = Clone(e); return c; } public static T Clone(T obj) { T clone = new T(); return clone; } }[/csharp] [editline]22nd February 2011[/editline] Is there a way to iterate through an object's fields?[/QUOTE] [url=http://msdn.microsoft.com/en-us/library/f7ykdhsy(v=VS.100).aspx]System.Reflection[/url] should be of help there.
[csharp]public static class Factory<T> where T : new() { public static T Create(T e) { T c = Clone(e); return c; } public static T Clone(T obj) { T clone = new T(); foreach (System.Reflection.FieldInfo f in obj.GetType().GetFields()) { clone.GetType().GetField(f.Name).SetValue(clone, f.GetValue(obj)); //this line } return clone; } }[/csharp] This gives me one of those stupid "object reference not set to an instance of an object blah blah blah" errors, but I can pinpoint where exactly it is.
f.SetValue(clone, f.GetValue(obj)) [editline]23rd February 2011[/editline] That's for instances of classes at least. Didn't seem to work the same way for structs.
I've been slacking my ass off this weekend. But now I'm coding. But before I post this, Quick question: Any of you guys ever work on a project, and you're coding it and it seems all good and well designed. Then a week or two down the road while gaining more experience and knowledge, you realize your code could be better. So you just say: "mmm, I'll just re-write it ground up". -snip- Sorry, that was immature. :/
I'm nearing completion (or rather, completion of v1 feature set) of my android app, which is sort of unprecedented for me. For some reason, I seem to capable of working on for long periods and completing projects as long as they aren't games. If it's just working with data and a little bit of UI, I generally do fine. With games my design falls apart a few seconds before I actually come up with the idea.
[QUOTE=xAustechx;28221496]I've been slacking my ass off this weekend. But now I'm coding. But before I post this, Quick question: Any of you guys ever work on a project, and you're coding it and it seems all good and well designed. Then a week or two down the road while gaining more experience and knowledge, you realize your code could be better. So you just say: "mmm, I'll just re-write it ground up". -snip- Sorry, that was immature. :/[/QUOTE] That's got to be unhealthy. [editline]23rd February 2011[/editline] The thing before you snipped it, that is
What'd he snip? :s Also yes sometimes I completely re-write something and it ends up being much better. I think it's the random moments I realize that something could be better, like this morning when I was making my breakfast.
[QUOTE=Quark:;28222148]What'd he snip? :s Also yes sometimes I completely re-write something and it ends up being much better. I think it's the random moments I realize that something could be better, like this morning when I was making my breakfast.[/QUOTE] Phew, thought it was just me. My moments of realizing things could be better or more efficient are usually in the shower or when I'm about to fall asleep.
I re-write a lot of code. If I'm just ever so slightly confused with how something works, I usually end up picking a checkpoint that's stable and just starting from there. If you count porting to Java from C++, I've re-written my dungeon generation 3 times, now the fourth. [editline]22nd February 2011[/editline] [QUOTE=spear;28210564]If anyone has a working dungeon generator (preferably using BSP trees), please give me a heads up. I'd love an explanation, and, if possible, some code. Thanks. Until I see someone else's working code, I think I'll try other algorithms.[/QUOTE] If I do finish, I'll be glad to share the C++ code I use for my generation function.
[QUOTE=xAustechx;28221496]I've been slacking my ass off this weekend. But now I'm coding. But before I post this, Quick question: Any of you guys ever work on a project, and you're coding it and it seems all good and well designed. Then a week or two down the road while gaining more experience and knowledge, you realize your code could be better. So you just say: "mmm, I'll just re-write it ground up". -snip- Sorry, that was immature. :/[/QUOTE] Yes but, I'm learning to get it working before I clean it up.
[QUOTE=geel9;28221649]That's got to be unhealthy. [editline]23rd February 2011[/editline] The thing before you snipped it, that is[/QUOTE] wait, what?
[QUOTE=xAustechx;28222319]Phew, thought it was just me. My moments of realizing things could be better or more efficient are usually in the shower or when I'm about to fall asleep.[/QUOTE] Mine happen on the toilet, during walks or before bed. [i]No joke.[/i]
[QUOTE=ThePuska;28220190]f.SetValue(clone, f.GetValue(obj)) [editline]23rd February 2011[/editline] That's for instances of classes at least. Didn't seem to work the same way for structs.[/QUOTE] Ah, that works. Next up: For type arguments (as in, Factory<"class">.Create()), how would I get "class" from an object?
[QUOTE=KillerJaguar;28222333]If I do finish, I'll be glad to share the C++ code I use for my generation function.[/QUOTE] Are you planning on doing it the BSP tree way?
[QUOTE=BlkDucky;28223019]Are you planning on doing it the BSP tree way?[/QUOTE] Yeah. I'm partly doing it because I wanted to use a recursive function.
Horrible code ahead: [code] public class MessageBox { static SpriteFont debugFont; string Text; int Duration; int TimePassed; bool Visible = false; public MessageBox(string Text, int Duration) { this.Text = Text; this.Duration = Duration; } public void Show(GameTime gameTime) { Visible = true; TimePassed = gameTime.TotalGameTime.Seconds; } public static void LoadContent(ContentManager Content) { debugFont = Content.Load<SpriteFont>("Fonts/Debug"); } public void UnloadContent() { } public void Update(GameTime gameTime) { if (Visible == true) { if (gameTime.TotalGameTime.TotalSeconds - TimePassed >= Duration) { Visible = false; UnloadContent(); } else { Visible = true; } } } public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { if (Visible == true) { spriteBatch.DrawString(debugFont, this.Text, new Vector2(25, 25), Color.Black); } } } [/code] Could someone teach me a better way to do it?
Sorry, you need to Log In to post a reply to this thread.