[img]http://anyhub.net/file/sfml.png[/img]
Working on a colorful Pong game :v:
[QUOTE=pikzen;25271170][img_thumb]http://anyhub.net/file/sfml.png[/img_thumb]
Working on a colorful Pong game :v:[/QUOTE]
Does it flash, blink, move 'n stuff? Really fast?
I might spend a whole second of my attention span on it if it does.
[QUOTE=ZeekyHBomb;25271222]Does it flash, blink, move 'n stuff? Really fast?
I might spend a whole second of my attention span on it if it does.[/QUOTE]
It will, but I've just started, just done collision for now.
[QUOTE=high;25270764]First, make sure you serialize any input as "|", "#" and "\n" will break shit.
Possibly add something like
I{
entries
}
That way it isn't so redundant.[/QUOTE]
That actually sounds better then my current way. But unfortunately I can't come up with a way(at the moment, atleast) to do that. A little help? :3:
[QUOTE=high;25270764]make sure you serialize any input as "|", "#" and "\n" will break shit.[/quote]
Got this handled by removing them from the input string. (I think that's an ok way to do it, right?)
If it encounters that then find the end of it and remove the tags, run that though another function.
Hmm, I've been working through Accelerated C++. With the exercises, say I haven't been fully following the exercises from the beginning. Should I go back and do them all, considering most exercises ask you to expand on old programs, or just miss those ones out?
[QUOTE=Vbits;25270763]It is coming along really nicely, you may want to modify the parser to call a function that returns a object if you have not already, also you really need to add more stuff to your parser, [b]so far you have initial items sorted but there is not alot of room to grow.[/b][/QUOTE]
I'm aware of this, but i can't come up with anything interesting to add. Hopefully i will soon enough. :smile:
As always, ideas on how to improve are always welcome.
Do them unless you have been working on programing projects at the time or are busy with them now.
[QUOTE=Vbits;25271395]If it encounters that then find the end of it and remove the tags, run that though another function.[/QUOTE]
Gonna try this, i'll come back when i got it in functional code :buddy:
[editline]08:50PM[/editline]
Broke mah automerge :saddowns:
[QUOTE=Dj-J3;25271590]I'm aware of this, but i can't come up with anything interesting to add. Hopefully i will soon enough. :smile:
As always, ideas on how to improve are always welcome.[/QUOTE]
Firstly you will be needing to still search for items.
have something like
[code]public Item(string name, int pickup, int time, int weight, int stackmax, int value)[/code]
[QUOTE=nos217;25271462]Hmm, I've been working through Accelerated C++. With the exercises, say I haven't been fully following the exercises from the beginning. Should I go back and do them all, considering most exercises ask you to expand on old programs, or just miss those ones out?[/QUOTE]
I had a different book, but I usually didn't do the programs. I read the exercise and only actually wrote them and messed around with it if I couldn't imagine how to solve it.
[QUOTE=nos217;25271462]Hmm, I've been working through Accelerated C++. With the exercises, say I haven't been fully following the exercises from the beginning. Should I go back and do them all, considering most exercises ask you to expand on old programs, or just miss those ones out?[/QUOTE]
IIRC much of the point of Accelerated C++ is doing all/most of the exercises. You'll learn to utilize C++ better if you actually write it. That should be obvious.
Ah right sure, it just feels daunting thinking of how much time it will take to go back and do them all, and it feels like I've spent a very long time learning non OOP, and am still a long way off of being able to make simple OpenGL applications.
[QUOTE=Dj-J3;25271329]That actually sounds better then my current way. But unfortunately I can't come up with a way(at the moment, atleast) to do that. A little help? :3:
Got this handled by removing them from the input string. (I think that's an ok way to do it, right?)[/QUOTE]
Writing a paper atm so I will get back to ya.
HELL NO! You are losing data when you do that.
[QUOTE=high;25272766]HELL NO! You are losing data when you do that.[/QUOTE]
:saddowns:
What data would that be?
[editline].[/editline]
It doesn't matter anymore, I removed my current way of loading items, because it wouldn't work now that i've got an Item class instead of using simple strings for items.
Still working on a way to get all the items in Items.txt. I'm not adding them to the inventory, but to a list of valid Items, which i can use to spawn random items(with properties the user can set, like time it takes to mine it, chance to find, etc), or less random depending on input(?) in the "world".
[QUOTE=Dj-J3;25272997]:saddowns:
What data would that be?[/QUOTE]
In this case you probably wont lose much but what if someone wants something like "Item #1" in the name?
I don't think that would effect it because he is using "StartsWith()" for "#", Point stands for pipe and new line though.
Oh, what's this? A level without a thumbnail?
I've been experimenting a lot with Texture2D.SetData/GetData to make a thumbnail generator. I had a vague implementation where you'd get a clear shot of the level like this:
[img]http://imgur.com/QiPaf.png[/img]
and you could edit that into a preview to make this:
[img]http://imgur.com/3F5ZR.png[/img]
Now it's automatic. The camera is moved to the average shape position in each level and takes a snapshot, then the 3 layers for each texture are drawn and saved to a file. In this video the thumbnails are automatically set in the levels too.
[hd]http://www.youtube.com/watch?v=fzN9LvDaNI8[/hd]
Some levels will still have to be done manually if the designer wants to show something off but it's a whole lot less work now :v:
That's really, really cool.
Love the console too.
When are you going to sell that? I'd love to play it.
Very awesome NovembrDobby
[img]http://i55.tinypic.com/16m4z9t.png[/img]
:woop:
Gonna add in the rest of the properties now :v:
[cpp]static public void LoadItems(string itemFileName)
{
TextWriter textWriter;
if (!Directory.Exists(defaultDir))
{
Directory.CreateDirectory(defaultDir);
Console.WriteLine("The directory does not exist! Directory created at " + defaultDir + ".");
}
if (!File.Exists(defaultDir + "\\" + itemFileName)) // Create a new file with the default text.
{
textWriter = new StreamWriter(defaultDir + "\\" + itemFileName);
textWriter.WriteLine("#\tThis is where you enter your new items!\r\n#");
//textWriter.WriteLine("#\tThis is how you must create a new item:\r\n#");
textWriter.WriteLine("#\tI|ItemName|ItemAmount");
textWriter.WriteLine("#\r\n#\tGuide lines:\r\n#\tItemName = The name of your item.\r\n#\tItemAmount = How many of this item you want to add.\r\n#\r\n#\t# = Comment(will be ignored when parsing items)");
textWriter.WriteLine("#\tI = Define this as a new item.");
textWriter.Write("#\tExample: I|Stone|2");
textWriter.Close();
}
streamReader = new StreamReader(defaultDir + "\\" + itemFileName);
string[] lines = streamReader.ReadToEnd().Split('\n');
int length = 0;
bool insideParsing = false;
foreach (string line in lines)
length++;
for (int i = 0; i <= length; i++)
{
try
{
lines[i] = lines[i].Replace("\r", "");
lines[i] = lines[i].Replace("\t", "");
if (!insideParsing)
{
switch (lines[i])
{
default:
break;
case "I{":
item = new Item();
Console.WriteLine("New Item detected!");
insideParsing = true;
Console.WriteLine("Entered parsing loop");
break;
}
}
else
{
if (lines[i].StartsWith("ItemName="))
{
string itemName = lines[i].Remove(0, 9);
item.ItemName = itemName;
}
else if (lines[i] == "}")
{
insideParsing = false;
Console.WriteLine("Left parsing loop");
Program.plyInventory.AddItem(item, 1);
}
else
{
Console.WriteLine("Inside the parsing loop!");
}
}
}
catch
{
break;
}
}
}[/cpp]
I haven't had time to debug it properly yet, so if you see potential bugs, or even a way to make it better, please tell me.
wth, why is your mouse in the screenshot?
[QUOTE=Jallen;25275511]wth, why is your mouse in the screenshot?[/QUOTE]
Always forget to uncheck that option in ZScreen. :argh:
I would just use a dictionary. This way, special items can have special properties and you wouldn't need to add these to the parser.
[QUOTE=Dj-J3;25275462][IMG]http://i55.tinypic.com/16m4z9t.png[/IMG]
[/QUOTE]
Strictly speaking, not a bug, but recipes is still mispelt. :v:
[QUOTE=BlkDucky;25275816]Strictly speaking, not a bug, but recipes is still mispelt. :v:[/QUOTE]
Oh lol, I missed that :v:
Thanks :3:
[img_thumb]http://i55.tinypic.com/2ni8xar.png[/img_thumb]
All better. :smug:
[QUOTE=Overv;25275257]When are you going to sell that? I'd love to play it.[/QUOTE]
In time
I still have to work out most of the levels and finish the 'single' gamemode, and some other minor things
[QUOTE=NovembrDobby;25276407]In time
I still have to work out most of the levels and finish the 'single' gamemode, and some other minor things[/QUOTE]
If you dont mind me asking, how long have you been programming in c++ to get to that level?
[QUOTE=Richy19;25276948]If you dont mind me asking, how long have you been programming in c++ to get to that level?[/QUOTE]
His game uses C# (XNA)
Sorry, you need to Log In to post a reply to this thread.