• What are you working on? December 2011 Edition
    3,353 replies, posted
[QUOTE=Map in a box;33965550]Got my tablet in just now, it browses facepunch pretty well. Now I get to port my UI to android! Your move, yogurt.[/QUOTE] You win this round [b]THIIIIS ROOOOUUUNNNDDDD[/b]
My code base just isn't modular enough for unit testing. Oh crap, 3499 posts. Better make the last one count.
This works: [csharp]public static Vector2d Mirror( this Vector2d v, Vector2d tangent, Vector2d normal ) { double invdet = 1.0 / ( tangent.X * normal.Y - tangent.Y * normal.X ); return ( tangent * ( v.X * normal.Y - v.Y * normal.X ) - normal * ( v.Y * tangent.X - v.X * tangent.Y ) ) * invdet; }[/csharp] [csharp]public override LightRay[] Interact( LightRay ray ) { Vector2d normal = Line.Direction.PerpendicularRight; return new LightRay[] { new LightRay( ( ray.Origin - Line.Start ).Mirror( Line.Direction, normal ) + Line.Start, ray.FieldRight.Mirror( Line.Direction, normal ), ray.FieldLeft.Mirror( Line.Direction, normal ), ray.ProjRight, ray.ProjLeft, LightRay.DefaultRange, LightRay.DefaultRange, ray, ray.Colour & Filter, this ) }; }[/csharp]
[QUOTE=Jookia;33965808]My code base just isn't modular enough for unit testing. Oh crap, 3499 posts. Better make the last one count.[/QUOTE] Either refactor your code (lots of work but worth it) or use a mocking framework to get rid of dependencies (okayish and kinda fast to do) or do integration tests (bad coverage, fast as hell to write).
[QUOTE=Ziks;33965844]This works: [csharp]public static Vector2d Mirror( this Vector2d v, Vector2d tangent, Vector2d normal ) { double invdet = 1.0 / ( tangent.X * normal.Y - tangent.Y * normal.X ); return ( tangent * ( v.X * normal.Y - v.Y * normal.X ) - normal * ( v.Y * tangent.X - v.X * tangent.Y ) ) * invdet; }[/csharp] [csharp]public override LightRay[] Interact( LightRay ray ) { Vector2d normal = Line.Direction.PerpendicularRight; return new LightRay[] { new LightRay( ( ray.Origin - Line.Start ).Mirror( Line.Direction, normal ) + Line.Start, ray.FieldRight.Mirror( Line.Direction, normal ), ray.FieldLeft.Mirror( Line.Direction, normal ), ray.ProjRight, ray.ProjLeft, LightRay.DefaultRange, LightRay.DefaultRange, ray, ray.Colour & Filter, this ) }; }[/csharp][/QUOTE] Yes but those are more semantical changes. I was thinking about using some mathsy structure for faster lookups. Too bad I don't know anything about those :D
[QUOTE=Map in a box;33965550]Got my tablet in just now, it browses facepunch pretty well. Now I get to port my UI to android! Your move, yogurt.[/QUOTE] Wait why does it say I'm using safari?
Just getting ready for WAYWO Jan 2012, here's a header if anyone wants to use it for the next thread. [IMG]http://i.imgur.com/cbBvr.png[/IMG] Here's a plaintext dump from [url=http://code.google.com/p/facepunch-lua-sdk/source/browse/trunk/test/highestratings.lua?spec=svn68&r=68]highestratings.lua[/url], too: [code]Most Disagrees goes to: http://www.facepunch.com/threads/1144771?p=33 859908&viewfull=1#post33859908 with 40 Disagrees! Most Programming Kings goes to: http://www.facepunch.com/threads/1144771?p=33 540826&viewfull=1#post33540826 with 26 Programming Kings! Most Artistics goes to: http://www.facepunch.com/threads/1144771?p=33 684144&viewfull=1#post33684144 with 39 Artistics! Most Friendlys goes to: http://www.facepunch.com/threads/1144771?p=33 669654&viewfull=1#post33669654 with 15 Friendlys! Most Funnys goes to: http://www.facepunch.com/threads/1144771?p=33 590552&viewfull=1#post33590552 with 75 Funnys! Most Agrees goes to: http://www.facepunch.com/threads/1144771?p=33 540001&viewfull=1#post33540001 with 44 Agrees! Most Optimistics goes to: http://www.facepunch.com/threads/1144771?p=33 591156&viewfull=1#post33591156 with 51 Optimistics! Most Usefuls goes to: http://www.facepunch.com/threads/1144771?p=33 588434&viewfull=1#post33588434 with 14 Usefuls! Most Dumbs goes to: http://www.facepunch.com/threads/1144771?p=33 602655&viewfull=1#post33602655 with 42 Dumbs! Most Lates goes to: http://www.facepunch.com/threads/1144771?p=33 543506&viewfull=1#post33543506 with 14 Lates! Most Winners goes to: http://www.facepunch.com/threads/1144771?p=33 694632&viewfull=1#post33694632 with 72 Winners! Most Zings goes to: http://www.facepunch.com/threads/1144771?p=33 619939&viewfull=1#post33619939 with 36 Zings! Most Informatives goes to: http://www.facepunch.com/threads/1144771?p=33 624117&viewfull=1#post33624117 with 21 Informatives! [/code] It's a day early, so if anyone wants me to redump these on request tomorrow, that's fine. I'm going to write a utility script to dump the top 10 posts by Programming King, Artistic, and Winner, and omit any non-content. Does that sound alright?
I guess the browsers webkit based or something
[QUOTE=ZenX2;33962577]Jesus dick text scaling suck in love [img]http://dl.dropbox.com/u/45554193/images/iryeesfcvfb.png[/img][/QUOTE] You either have to: switch to a bitmap font, reload the font in a bigger size each time or I think you can draw the text to a buffer and then scale up the buffer with a nearest neighbour scale, then draw that to the screen.
With my TV connected, I can play the whole level without scrolling! [t]http://i.imgur.com/NCZTI.png[/t] Though it's irritating to turn my head halfway through. This would be an awesome thing to have at a convention or something, with like 10 screens next to each other. And then 10 player multiplayer with hotseat style. I'd so program that if I had the opportunity.
Is it a better idea to make my functions check if they can execute or to make the calling code check that? Say a method depended on a dictionary having a value set. Should the caller of the function check if the key exists or should it just call the method which would be responsible for that.
Probably neater to get the functions to do it themselves, and make them return false or something if they didn't pass.
I think it's better to have inner functions that do the logic asked of them as simply as possible, then have more secure methods that call that function if necessary. But in some cases it might be better to just make all your logic in one simple secure method.
[QUOTE=Darwin226;33966622]Is it a better idea to make my functions check if they can execute or to make the calling code check that? Say a method depended on a dictionary having a value set. Should the caller of the function check if the key exists or should it just call the method which would be responsible for that.[/QUOTE] It's a tossup. If you don't have the function check itself, you can run into problems if you forget to check before using it. If you have the function check itself, you add a little bit of overhead every time the function is called, even if you don't need to check. I personally would have the function check and return false/null/etc, and that way the code that depends on it is free to handle it however it likes, Eg; In one case it might just end the function, in another case it might supply it's own value, etc.
[QUOTE=Ziks;33964807][url=http://anyhub.net/file/1Zw9-release.7z][img]http://anyhub.net/file/47Ky-dl2.png[/img][/url] You can now place more types of objects, fix the light direction and I fixed the intersecting mirrors bug. I require optimistic ratings.[/QUOTE] You're probably already aware but the box objects let "half" of the light through at certian angles of light / box dimensions. Otherwise, pretty fun to play around with :D
I'm currently working on the world generator for my upcoming XNA game, would like some feedback on what I could add to it and what I could also improve from the pictures (not releasing source code or game yet, as it's currently being re-written because it's pretty messy). World Type 1 - Plains : [thumb]http://img97.imageshack.us/img97/7823/pbgen1.png[/thumb] World Type 2 - Desert (Yes cacti generate underground, thought it was cool, but you guys may suggest otherwise and I will change) : [thumb]http://img811.imageshack.us/img811/2113/pbgen2.png[/thumb] World Type 3 - Forest : [thumb]http://img535.imageshack.us/img535/1715/pbgen3.png[/thumb] World Type 4 - Snow Plains (Yes, could do with improvement) : [thumb]http://img706.imageshack.us/img706/5364/pbgen4.png[/thumb] This was also my first time making any sort of random world generator, so I'm pretty proud of what I've produced so far. Also, this is one of the first posts I've made on Facepunch - the community seems really nice!
I'd add more snow to the Snow Plains biome (now the height of snow is 1 pixel, not much), because right now it doesn't look like snow biome to me. Also, I don't understand why is the ground of desert biome so [I]spiky[/I] (dunes?). And what are these parts with darker colour? Caves? I think it needs more and better explanation. :v: However, it looks interesting! Good luck with it. :)
[QUOTE=TomsonTom;33968326]I'd add more snow to the Snow Plains biome (now the height of snow is 1 pixel, not much), because right now it doesn't look like snow biome to me. Also, I don't understand why is the ground of desert biome so [I]spiky[/I] (dunes?). And what are these parts with darker colour? Caves? I think it needs more and better explanation. :v: However, it looks interesting! Good luck with it. :)[/QUOTE] Thanks for that reply, it feels good to have feedback so you know what direction to take. Added on my todo list. Oh, and those darker bits are background tiles, when you go deeper, it shows dark ones. Yeah, background tiles do need more definition to them. Also, expect lighting soon :D
[IMG]http://i.imgur.com/HS0RX.png[/IMG] Feel free to rate me dumb, but it's basically a bot that scrapes from reddit's /r/random feature and gets the names & descriptions of random Subreddits. Uses the BackgroundWorker and WebClient.
[QUOTE=BBgamer720;33968732] Feel free to rate me dumb, but it's basically a bot that scrapes from reddit's /r/random feature and gets the names & descriptions of random Subreddits. Uses the BackgroundWorker and WebClient.[/QUOTE] [img]http://i.imgur.com/ecIzo.png[/img] I made an imgur subreddit downloader, so now I'm sitting on 20k pics of porn :D
Are you scraping the links from the [url]www.imgur.com/r/subredditnamehere[/url] functionality or is it just from Reddit itself?
[QUOTE=BBgamer720;33968890]Are you scraping the links from the [url]www.imgur.com/r/subredditnamehere[/url] functionality or is it just from Reddit itself?[/QUOTE] Yep, usually more images pop up when you scroll. What I do to get all the images I just do http://imgur.com/r/<subreddit>/page/1?scrolled
Okay, I'm trying out what BlkDucky suggested and rendering to a buffer, but now it's becoming apparent that love.graphics.newFramebuffer is nil. Auuugghhh.
[QUOTE=DeanWinchester;33967306]You're probably already aware but the box objects let "half" of the light through at certian angles of light / box dimensions. Otherwise, pretty fun to play around with :D[/QUOTE] To clarify: [t]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230222031.png[/t] [t]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230222126.png[/t] Also, although this could be intentional: [t]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230222301.png[/t]
I believe all three scenarios are intentional. If the objects were drawn solidly, you wouldn't notice it.
[QUOTE=horsedrowner;33969373]To clarify: [t]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230222031.png[/t] [t]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230222126.png[/t] Also, although this could be intentional: [t]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230222301.png[/t][/QUOTE] It's probably an optimization since the box will probably be filled. [editline]30th December 2011[/editline] Late
Working on a Quadtree system; [img]http://i53.tinypic.com/rtdrp5.png[/img] Leafs are created on-the-fly if they do not exist depending on object position. If there is no object, the leaf will not be created.
[img]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230223359.png[/img] This is amazing to play around with. It would be cool if the light would extend a little further, though.
[QUOTE=horsedrowner;33969570][img]http://www.horsedrowner.com/images/screenshots/NANO-Torch%20Game-20111230223359.png[/img] This is amazing to play around with. It would be cool if the light would extend a little further, though.[/QUOTE] Also a restart button or a delete tool.
Okay, getting better [img]http://dl.dropbox.com/u/45554193/images/grdekrc.png[/img] Text is rendered to a Canvas with nearest scaling, but it still has some fuzziness
Sorry, you need to Log In to post a reply to this thread.