• What are you working on? v16
    5,004 replies, posted
Just began writing a map generator. I'm thinking about using a JSON parser for whatever needs be saved. [code] {'seed': 'T3hGamerDK', 'mapdata': {'xyz': '1024,1024,2048'}, 'entity': {'xyz': '3,400,-10', 'type': 'player_spawn'}} [/code] Seed is used to generate the map. The "xyz" of "mapdata" is the size of the maps. Most of this stuff is just random and arbitrary, to give an idea of how things are going to look. Do you guys think this is a good idea? I'm thinking about doing an editor for it too, because I won't be needing to load entire maps, I just generate all that shit on the fly :D
[img]http://i52.tinypic.com/16kaqg7.jpg[/img] Physics and a pretty camera are complete :D
I need some help with passing params (C# params that is) to lua's ... . What i'm currently doing, is I have a method in C# that takes a params object[] args and passes args directly into lua via [csharp]GetFunction("name").call(args);[/csharp] But the problem with this is that all of the args are of type object, or System.Object and since lua is dynamicly typed there is no casting. My question is, if the function that has the params as the arguments is called [csharp]CallLua(String name, params object[] args)[/csharp] and I call it by doing [csharp]CallLua("LFunc", "Bahaha!!");[/csharp] and in lua I have [csharp]function LFunc(haha) print(haha) end[/csharp] it prints "System.Object [43952345(or some other number]" instead of "Bahahaha!!!". How do I get lua to convert (cast...?) it to a string? By the way, this code [code] Hook.Register('OnLoad','Unique',function() print('Generating grid.') Offset = 8; MaxX = GetWidth()/16; MaxY = GetHeight()/16; for x=Offset,16*MaxX,16 do for y=Offset,16*MaxY,16 do if x==Offset or y==Offset or x==(16*MaxX)-Offset or y==(16*MaxY)-Offset then AddBody('rect',params({x,y,16,16})) end end end circ = AddBody('circle',params({GetWidth()/2,GetHeight()/2,50,function(b1,b2) print('Yay, collisions!') end})) circ.IsStatic = false circ.Restitution = 1.1 end) [/code] produces this: [img]http://dl.dropbox.com/u/5270951/Pics/Awesomeness.png[/img]
Does anyone have any experience with libGDX or Slick library? Really dont know whic to go for
Did a quick video to show some of the more movement oriented bits: [media]http://www.youtube.com/watch?v=S-DW2H2P8Iw[/media] Sorry for the low quality :C
[QUOTE=NorthernGate;29181100]Did a quick video to show some of the more movement oriented bits: [media]http://www.youtube.com/watch?v=S-DW2H2P8Iw[/media] Sorry for the low quality :C[/QUOTE] I love living in the future. "Hm. I kinda like the music in that video." 5 minutes later. Bam. I had obtained several albums through perfectly legit sources.
[QUOTE=NorthernGate;29181100]Did a quick video to show some of the more movement oriented bits: [media]http://www.youtube.com/watch?v=S-DW2H2P8Iw[/media] Sorry for the low quality :C[/QUOTE] That's great programming music.
[QUOTE=Moustach3;29182144]That's great programming music.[/QUOTE] The band is Uh Huh Her, and the song is Dreamer if you want to give it a better listen :)
I just spent an hour trying to figure out why my quaternions weren't working. Turns out I hadn't noticed that a + b ^ c is evaluated as (a + b) ^ c instead of a + (b ^ c). Which is bad because I'd overloaded ^ to stand for the cross product. Remember, kids: don't misuse your operators.
Aha! Just wrote a proof of concept for building a dynamic array of pointers to todo objects. This has been giving me trouble. I just have to tweak it so that it works with todo objects being read from a binary file and I'll have saving and loading finished for my todo program!
I implemented text entry controls to TopWise, things are getting texty up in here.
Uhh I plan on moving from upgrading from console applications in C++ and adding something to look at. What do you think I should move on to? SDL? Or is there something else I need to learn first?
[QUOTE=Kwaq;29186382]Uhh I plan on moving from upgrading from console applications in C++ and adding something to look at. What do you think I should move on to? SDL? Or is there something else I need to learn first?[/QUOTE] You could move straight to SDL or SFML if you feel like it. If things seems to complex, just come back later :)
SFML is probably the easiest graphics library you're gonna find, especially if you're familiar with Gmod Lua as they use a very similar style.
[QUOTE=bobthe2lol;29178611]I need some help with passing params (C# params that is) to lua's ... . What i'm currently doing, is I have a method in C# that takes a params object[] args and passes args directly into lua via [csharp]GetFunction("name").call(args);[/csharp] But the problem with this is that all of the args are of type object, or System.Object and since lua is dynamicly typed there is no casting. My question is, if the function that has the params as the arguments is called [csharp]CallLua(String name, params object[] args)[/csharp] and I call it by doing [csharp]CallLua("LFunc", "Bahaha!!");[/csharp] and in lua I have [csharp]function LFunc(haha) print(haha) end[/csharp] it prints "System.Object [43952345(or some other number]" instead of "Bahahaha!!!". How do I get lua to convert (cast...?) it to a string? By the way, this code [code] Hook.Register('OnLoad','Unique',function() print('Generating grid.') Offset = 8; MaxX = GetWidth()/16; MaxY = GetHeight()/16; for x=Offset,16*MaxX,16 do for y=Offset,16*MaxY,16 do if x==Offset or y==Offset or x==(16*MaxX)-Offset or y==(16*MaxY)-Offset then AddBody('rect',params({x,y,16,16})) end end end circ = AddBody('circle',params({GetWidth()/2,GetHeight()/2,50,function(b1,b2) print('Yay, collisions!') end})) circ.IsStatic = false circ.Restitution = 1.1 end) [/code] produces this: [img_thumb]http://dl.dropbox.com/u/5270951/Pics/Awesomeness.png[/img_thumb][/QUOTE] You probably just misstyped this but: [csharp]CallLua("LFunc", "Bahaha!!");[/csharp] shouldn't that be: [csharp]CallLua("LFunc", {"Bahaha!!"});[/csharp] because it's an array, right? Another thing, if I remember this correctly (which I probably don't) you shouldn't need to have it like a param, object[] should be enough. I am not certain though.
[IMG]http://dl.dropbox.com/u/9317774/Manyth-Sun.PNG[/IMG] Improved my sun a little
[QUOTE=AzLaN;29186870]You probably just misstyped this but: [csharp]CallLua("LFunc", "Bahaha!!");[/csharp] shouldn't that be: [csharp]CallLua("LFunc", {"Bahaha!!"});[/csharp] because it's an array, right? Another thing, if I remember this correctly (which I probably don't) you shouldn't need to have it like a param, object[] should be enough. I am not certain though.[/QUOTE] No, it automatically passes every argument after the named arguments into the array.
Hooray for four hours of straight coding until late at night to get me game engine done. It is so beautiful.
[QUOTE=AzLaN;29186870]You probably just misstyped this but: [csharp]CallLua("LFunc", "Bahaha!!");[/csharp] shouldn't that be: [csharp]CallLua("LFunc", {"Bahaha!!"});[/csharp] because it's an array, right? Another thing, if I remember this correctly (which I probably don't) you shouldn't need to have it like a param, object[] should be enough. I am not certain though.[/QUOTE] [csharp] public void TestFunction(params object[] args){ foreach(Object obj in args){ Console.out.writeline(obj.ToString()); } } TestFunction("a","b","c","d","e",10); [/csharp] prints [code] a b c d e 10 [/code] Just FYI
Guys... Garry's been 1 Up-ed... [url]http://www.humblebundle.com/[/url] $2000.02
[QUOTE=Loli;29189743]Guys... Garry's been 1 Up-ed... [url]http://www.humblebundle.com/[/url] $2000.02[/QUOTE] I sense a donation war a'comming
Huh, I wonder who it was who 1 upped him..
I think the best way to learn about non-deprecated OpenGL right now is looking up tutorials for WebGL, because they explain all of the non-deprecated concepts well.
Just been playing with non-deprecated OpenGL... teaching myself bit by bit. So far I have vertex and fragment shaders that draw a triangle on the screen via a VBO. It's going well! On an unrelated note, 20 minutes until we find out what this countdown's all about
I have this on loop [media]http://www.youtube.com/watch?v=9jK-NcRmVcw[/media]
Countdown?
Glados@home just launched. Basic idea: Play potato sack games enough and portal 2 will be released ahead of schedule. [editline]15th April 2011[/editline] [url]http://www.aperturescience.com/glados@home/[/url]
I just wrote my own paged-grid data display. Can have customisable rows and columns, and will return the index of the currently selected item if it were in a list. Feel like a pro. [editline]15th April 2011[/editline] [QUOTE=esalaka;29192610]Glados@home just launched. Basic idea: Play potato sack games enough and portal 2 will be released ahead of schedule. [editline]15th April 2011[/editline] [url]http://www.aperturescience.com/glados@home/[/url][/QUOTE] Though interesting, what has this got to do with WAYWO?
[QUOTE=CarlBooth;29192662]I just wrote my own paged-grid data display. Can have customisable rows and columns, and will return the index of the currently selected item if it were in a list. Feel like a pro. [editline]15th April 2011[/editline] Though interesting, what has this got to do with WAYWO?[/QUOTE] We can work on exploiting it v:v:v
[QUOTE=CarlBooth;29192662]Though interesting, what has this got to do with WAYWO?[/QUOTE] Well, dunno about anyone else but I know it'll be hindering [i]my[/i] projects :v:
Sorry, you need to Log In to post a reply to this thread.